Friday, May 10, 2024
15 changes · 17.0
Enhancements to existing features
This update makes the "is_kits" product field searchable, allowing users to easily find all product kits in their database. Previously, this field could not be searched, which was inconvenient for businesses with large product catalogs. The change also fixes a technical issue where the field was unnecessarily computed with elevated permissions.
Original PR description
Description of the issue/feature this PR addresses: Before this PR the field is_kits is not searchable. It is useful in large database to find all product kit easely. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#163830 Forward-Port-Of: odoo/odoo#156019
This update significantly improves the speed of loading the Discuss app when users have many pinned chats. The change optimizes how the system processes chat data, resulting in 50-70% faster load times depending on the number of pinned conversations. Users with large numbers of pinned chats will experience noticeably quicker access to their messaging interface.
Original PR description
Before this commit, when a user had many discuss chats pinned on the UI (i.e. in Discuss app Sidebar or in Messaging Menu), then the initial loading of Discuss could be very slow. This initial…
Before this commit, when a user had many discuss chats pinned on the UI (i.e. in Discuss app Sidebar or in Messaging Menu), then the initial loading of Discuss could be very slow. This initial loading happens at page load in version 17.0. This happens because when inserting the pinned thread data, the inner-working of computed fields related to Thread models was taking a lot of time. This comes from poor coding in ensuring computed fields are registered once in a single `Record.insert()` transaction: this uses an array, so it had to be fully parse to check whether it was present. This commit fixes the issue by using a `Set` instead of an array for the FC_QUEUE (the inner-queue of registered fields to compute), so that checking presence of field is an O(1) time rather than O(n). Note that arrays are fast so it needs a lot of threads and a lot of computed fields to see a big performance problem. In version 17.0: 200 pinned threads: 600ms => 400ms (50% faster) 1k6 pinned threads: 8.85s => 5.25s (70% faster)
Resolved issues and error corrections
This fix resolves an issue where customers who selected "Generic" payment format were not getting the correct ISO 20022 format consistently. Previously, when batch payments met SEPA requirements, the system would use SEPA format instead of the requested generic ISO 20022, causing bank rejections. Now the system correctly applies ISO 20022 format when selected, ensuring compatibility with banks that require this standard.
Original PR description
Before this commit, it was impossible to force the use of 'vanilla' ISO 20022 over SEPA in every case. The 'Generic' selection value existed in the PAIN version field, but its actual meaning was to…
Before this commit, it was impossible to force the use of 'vanilla' ISO 20022 over SEPA in every case. The 'Generic' selection value existed in the PAIN version field, but its actual meaning was to use the regular SEPA, not what the inner code of the module calls "generic SEPA", which actually corresponds to ISO 20022 without the SEPA-specific restrictions. ISO 20022 is currently automatically used a a fallback by our SEPA implementation when trying to generate a file which values would violate the SEPA restrictions (such as a non-IBAN account or non-EUR amount). This works fine when your wish is to do SEPA and you need something more generic "by accident", and maybe your bank accepts it. In that context, we got a report from a customer with his journal configured to "Generic", who actually wished to use ISO 20022 instead of SEPA: - When making a batch payment containing a non-EUR amount or non-IBAN account, this worked fine - When making a batch payment violating none of the SEPA restrictions, SEPA was used instead of ISO 20022 When SEPA was chosen, SvcLvl node was set to "SEPA" in the file, as it is the only accepted value. This got rejected by the customer's bank, which expected only ISO 20022, in which "SEPA" is not a legit SvcLvl value. With our commit, this node will now receive "NURG" as its value. This commit is intended as a small patch to unlock customers facing this exact issue. More proper and sandboxed support for ISO 20022 will follow in master. opw-3848174 Forward-Port-Of: odoo/enterprise#62054
This update corrects two validation errors in Belgium's tax reporting system. The amount threshold for tax grids 44 and 88 was incorrectly set to 99.999 instead of 99999, and a mislabeled validation message for grid 44 has been fixed. These corrections ensure accurate tax compliance checking for Belgian companies.
Original PR description
- Amounts should be matched to 99999, not 99.999. This was badly converted from previous versions when integrating these checks in the new report framework in 16.0 - The check made for grid 44 mentioned the wrong grid in its label. This had already be fixed in 15.0, but apparently crossed with the 16.0 refactoring, which undid it by mistake (probably because it moved the file) See documentation: https://eservices.minfin.fgov.be/intervat/static/help/FR/regles_de_validation_d_une_declaration.htm Forward-Port-Of: odoo/enterprise#62076 Forward-Port-Of: odoo/enterprise#61376
This fix corrects the Shop Floor display to show only work orders that are ready or in progress, rather than displaying all work orders including completed ones. Previously, when viewing the Shop Floor after completing a work order, users would see both the finished and upcoming operations, which was confusing. Now only the relevant work orders are displayed.
Original PR description
Steps to reproduce the bug:
- Create a storable product “P1”:
- BoM:
- Component: C1
- Workorders: OP1 and OP2
- Create a Manufacture order to produce one P1
- Confirm the MO
- start the OP1 and mark it as done
- start the Shop Floor from the "Work Orders" tab
Problem:
Operation 1 and 2 are visible, instead of only the OP2
opw-3904023This fix corrects an issue where allocated hours on shifts were being incorrectly recalculated when employees were auto-assigned. Previously, the system would change the allocated hours from what was manually set (8 hours) to a lower amount (7.5 hours) due to a percentage calculation error. Now the system properly preserves the allocated hours based on the employee's work schedule.
Original PR description
To reproduce: ============= - Create a 24-hour calendar representing a company without breaks. - Create an employee who will be working a night shift 21:30 to 6:00 - Create an open shift from 21:30…
To reproduce:
=============
- Create a 24-hour calendar representing a company without breaks.
- Create an employee who will be working a night shift 21:30 to 6:00
- Create an open shift from 21:30 to 6:00.
- as the company doesn't have breaks the shift will have 8 hours and 30 minutes of allocated hours. Set the allocated hours to 8 hours
- click auto-plan -> the employee is assigned to the shift but the allocated hours are changed
to 7 hours and 32 minutes.
Problem:
========
- when setting the allocated hours to 8 hours, the allocated percentage changed to 94%.
- after auto-planning, and setting the resource to the shift, the allocated hours are recomputed based on the allocated percentage and the working hours of the resource which is 8 * 0.94 = 7.52 hours.
Solution:
=========
after finding the resource to assign to the shift, we should recomputed the allocated percentage based on the working calendar of the resource and the allocated hours set on the shift.
opw-3874283When adding products from the catalogue to a purchase order, the system now correctly applies the project's analytic distribution settings. Previously, this automatic assignment was missing when using the catalogue, even though it worked when adding items manually. This fix ensures consistent behavior across both methods of adding products.
Original PR description
Steps to reproduce: - Install purchase, project and accounting - Setup an analytic distribution for the projec - Add a new item from the catalogue Issues: The analytic distribution is not added automatically as it would when adding an item without using the catalogue. Solution: The compute that add the analytic distribution requires the `project_id` to be in the context. https://github.com/odoo/odoo/blob/ed0bf10ad89ee78acc65f4e7be70c7ffb2a864bb/addons/project_purchase/models/purchase_order_line.py#L13 However if we go to the catalogue and add the items our context will be flushed, but this flush will be done with the old env. By passing the context and using `_recompute_recordset` we are forcing the compute with the env that has the correct context. As a side note `_recompute_recordset` is used instead of `flush_recordset` in order to prevent write operations that will be done later on. opw-3794948
Portal users were seeing incorrect button colors in the file viewer toolbar. This fix removes unnecessary dark mode styling that was being loaded for portal pages, ensuring buttons now display with the correct colors. This improves the visual consistency and user experience for portal users accessing files.
Original PR description
### Before this commit: The fileViewer toolbar buttons displayed incorrect colors for portal users. ### Reason for this behaviour The mail module's public assets loaded all components and their SCSS files. However, the file viewer had a separate SCSS file for dark mode button colors, which was unnecessary for portal users. Removing it would help fix the bug. ### After this commit: FileViewer toolbar button colors now display correctly for portal users. **task-3872205**
This update fixes several issues with how customer credit limits are calculated and displayed on invoices. The fixes address problems that occurred when using multiple companies, multiple currencies, or when creating invoices independently of sales orders. These corrections ensure that credit limit warnings accurately reflect a customer's total outstanding credit across all scenarios.
Original PR description
#### [FIX] account,sale: credit_to_invoice in multi-company Currently the credit_to_invoice includes sales orders from all allowed companies. But it should only include sales orders from the active…
#### [FIX] account,sale: credit_to_invoice in multi-company
Currently the credit_to_invoice includes sales orders
from all allowed companies.
But it should only include sales orders from the active company.
(Since a single sales order belongs to only 1 company)
#### [FIX] account: flush in _credit_debit_get of model res.partner
Function _credit_debit_get uses a raw SQL query,
but does not flush the used tables to the DB before.
Without this commit some of the tests in the following commits of this PR will fail
(since some of the invoice lines are not flushed yet).
#### [FIX] account,sale: credit limit in multi-currency setup
The partner credit limit (warning) may not be computed correctly in a
multi-currency setup.
Note that the partner credit is always in company currency.
1) Consider a draft invoice. To determine the warning amount
the current amount in document currency (not company currency)
is added to the current partner credit (roughly speaking).
2) To compute the credits from sales orders of the partner
(credit_to_invoice) we just add the amount_to_invoice
from each sales order of the partner.
But this field is in the currency of the order
and thus may be different from the company currency.
To fix these issues currency conversions were added for both cases.
#### [FIX] account,sale: credit limit warning
Currently the amount of the partner credit warning
on invoices is not computed correctly in some cases.
1) There are Sales Order credits
and we create an invoice independent of any of SO
2) We create an invoice from a Sales Order with
an amount greater than the Sales Order.
For (1) the problem is that we substract the current
amount of the invoice from the sales order credits
(since we need to do this in the sales order to invoice flow)
But in case the invoice does not come from a sales order
this is wrong.
For (2) the problem is that the `amount_to_invoice` of a
Sales Order may be negative. This can happen if we invoice
more than the sales order amount.
E.g. we can end up with one invoiced order with -100 and
one uninvoiced order of 100. In the sum this would leave us
with "nothing to invoice" (100 + -100 = 0).
Reproduce (1):
All monetary values here are in company currency.
- Ensure that the partner credit is 0:
i.e. remove all Sales Orders and Invoices.
- Activate 'Sales Credit Limit' in the settings
and set the 'Default Credit Limit' to 100
- Create a new customer; here 'Test'
- Create a Sales Order for customer of 200
and deliver it
- The total partner credit is now 200
- Create an Invoice (not from the Sales Order)
for customer 'Test' (without any lines at first).
- There should be a warning that the total amount
due is 200 (since it exceeds the limit of 100).
- Add a line of 200 to the Invoice
(any value ≤ 200 will do).
- The total amount due in the warning is still 200
but it should be 400 (200 + 200)
- Change the line to 800 (any value > 200 will do)
- The total amount due in the warning is now 800
but it should be 1000 (200 + 800)
Reproduce (2):
All monetary values here are in company currency.
- Ensure that the partner credit is 0:
i.e. remove all Sales Orders and Invoices.
- Activate 'Sales Credit Limit' in the settings
and set the 'Default Credit Limit' to 100
- Create a new customer; here 'Test'
- Create 2 Sales Orders for customer of 200 each
and deliver it
- The total partner credit is now 400
- Create an Invoice from exactly one of the Sales Orders
(full amount or downpayment does not matter here)
- There should be a warning that the total amount
due is 400 (since it exceeds the limit of 100).
- Modify the invoice (any line from the sales order)
s.t. it has a total of 400
- Confirm the invoice
- The amount_to_invoice of the Sales Order is now -200.
The sum of the amount_to_invoice of the Sales Orders is 0.
- Create a new invoice without any lines.
- There is a warning that the total amount
due is 400 (= 200 + -200 + 400 ; SO + SO + invoice).
But it should be 600 since the "overinvoiced" SO
should just be counted with amount_to_invoice 0.
Forward-Port-Of: odoo/odoo#164921
Forward-Port-Of: odoo/odoo#162770This fix resolves an issue where deadline dates were being unnecessarily updated multiple times across related stock moves. By improving how the system tracks which moves have already been processed, the fix reduces redundant updates from 11 operations down to 4, improving system performance and data consistency.
Original PR description
The date_deadline propagation would update the sale records multiple times depending on some configuration (check example below). This happens because 'already_propagate_ids' is copied at the…
The date_deadline propagation would update the sale records multiple times depending on some configuration (check example below). This happens because 'already_propagate_ids' is copied at the beginning of _set_date_deadline (set | set = new set). So, when a child move propagates to multiple other moves, it is not known by the parent move, which will redo the propagation.
To prevent this, we always keep the same reference for 'already_propagate_ids' (context: 'date_deadline_propagate_ids'). This means that a parent and child move share the exact same Set, and when the child move updates the Set, it also updates the parent Set. So when a child move propagates, the parent will know which moves have been done.
MOVES LINKAGE
```
Move B
/ | \
Move A | Move D
\ | /
Move C
```
PROPAGATION GRAPHS:
```
BEFORE | AFTER
------------+--------
A | A
/ \ | |
C B | B
/ \ / \ | |
B D C D | C
| | | | | |
D B D C | D
------------+--------
11 | 4 NUMBER OF CALLS
```
OPW-3904178

---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#164734This update fixes performance issues in the web editor that were causing slow response times when dropping snippets, dragging columns, and performing other editing operations. The fix reduces unnecessary processing by only updating snippet drop zones when actually needed, rather than on every visibility toggle, resulting in faster and more responsive editing experience.
Original PR description
Commit [1] added the support to also consider invisible dropped snippets when checking if the snippets in the right panel are droppable. In order for this status to be properly updated when showing…
Commit [1] added the support to also consider invisible dropped snippets when checking if the snippets in the right panel are droppable. In order for this status to be properly updated when showing and hiding invisible elements, the `reload_snippet_dropzones` event is now triggered in each call to `toggleTargetVisibility`. However, this function is called a lot of times when doing different operations (e.g. drag and dropping (in `buildSnippet` and `cleanForSave` functions), removing a snippet, showing/hiding an invisible element), which means that `_disableUndroppableSnippets` is also called each time. This slowed down the editor a lot: - Drop a "Text-Image" snippet and click on it to activate it. => It takes a bit long for the "Undo" arrow and the overlay to appear. - Drag and drop one of the snippet columns. => It takes a while for it to be dropped and for the dropzones to disappear, while it should be instant. It also made some tours having steps that drop snippets fail when launched in the browser console (e.g. `carousel_content_removal`). This happens because the "drop" step takes too long to complete, making the next one fail. Also, this made the call to `_disableUndroppableSnippets` redundant in certain cases. For example, when removing a snippet: in `removeSnippet` there is a call to `toggleTargetVisibility` which will therefore call this function. At the end, it triggers the `snippet_removed` event which will call `_onSnippetRemoved` which also calls this function. This commit therefore fixes these issues by removing the trigger from `toggleTargetVisibility` and by calling `_disableUndroppableSnippets` directly when showing/hiding invisible elements, so only when necessary. [1]: https://github.com/odoo/odoo/commit/922b4ba13d679a237bcc43d7296ff402beacb022 task-3902277 Forward-Port-Of: odoo/odoo#164826 Forward-Port-Of: odoo/odoo#164159
When customers apply coupons or discount codes in eCommerce, the system now properly generates official e-invoices instead of proforma PDFs. The fix handles negative unit prices by inverting both the price and quantity, which complies with invoice format standards while maintaining the correct financial result.
Original PR description
Currently, when we use eCommerce with automatic invoicing enabled, and we have the Peppol format enabled in the invoicing settings, there is an issue when coupons or discount codes are applied. These discounts create a sale order line (and afterwards a move line) with a negative unit price. Since UBL BIS3 does not allow negative unit prices, the automatic generation of the e-invoice is not executed and the customer receives a "proforma invoice" PDF instead (which has no official value). A message is logged in the chatter, but the user has no notification or anything. We can do better, and instead invert both the unit price and quantity fields (since UBL BIS3 does allow negative quantities), to have the same result when generating the e-invoice. task-3916181 Forward-Port-Of: odoo/odoo#164810 Forward-Port-Of: odoo/odoo#164735
Fixed a display issue in repair orders where the destination location for recycled products was hidden behind the source location field. When confirming a repair order with recycled storable products, users can now see where the recycled items will be sent, improving visibility and tracking of inventory movements.
Original PR description
**Steps to reproduce the bug:**
- Create a storable product “P1”
- Create a repair order:
- Select any product to repair
- add “P1” as recycled product
- Confirm the repair order
**Problem:**
Display the detailed operation of P1 stock move, the field “quant_id” (source location) is displayed and the dest location is hidden, because the field `show_quant` is True
As the product is storable, the show_quant is set as True:
https://github.com/odoo/odoo/blob/4da8c6ebca024b31278a946aef55cc37f0210b33/addons/stock/models/stock_move.py#L601-L602
https://github.com/odoo/odoo/blob/d45f6ab2267f4cf3c2419e7274b2c550b00a796d/addons/stock/views/stock_move_views.xml#L243-L245
https://github.com/odoo/odoo/blob/d45f6ab2267f4cf3c2419e7274b2c550b00a796d/addons/stock/views/stock_move_views.xml#L243-L245
opw-3852774
Forward-Port-Of: odoo/odoo#164672This fix corrects how the country information is populated in Italian electronic invoices. Previously, when a customer had an invalid or generic VAT number (like "/" or "NA"), the system would use that invalid code instead of the customer's actual country. Now it correctly prioritizes the customer's country information, ensuring electronic invoices are generated with accurate country data for EU customers.
Original PR description
Steps to reproduce: - Install Accounting, l10n_it_edi and Contacts - Switch to an Italian company (e.g. IT Company) - Go to Contacts - Create an EU contact with "/" or "NA" as VAT (e.g. a Germnan contact with a full address) - Create an invoice: * Customer: [the created contact] * Product: [any] - Confirm the invoice - Process the electronic invoice - Check the generated electronic invoice Issue: In the XML, the "Nazione" field of customer is set to "/" (or "NA"), instead of the code of the customer's country. Cause: The "Nazione" field is computed from the VAT of the customer with a fallback on customer's country. It should be the opposite. opw-3889051 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#164950
This fix prevents redundant updates to account codes when the code prefix hasn't actually changed. By avoiding these unnecessary updates, the system uses less memory and processes upgrades more efficiently, reducing the risk of memory errors that could occur during large-scale account updates.
Original PR description
Updating the code field of accounts can trigger a lot of recomputes. Especially during upgrades, this can lead to MemoryError. For this reason, in https://github.com/odoo/odoo/pull/125320, it was decided that only tags should be updated on `account.account` when updating a CoA. But, it can happen that a superfluous code update sneeks in through `ResCompany.reflect_code_prefix_change()`, even though the old code and the new one are the same. Avoid this unnecessary update by returning early from the function when old and new codes are the same. Forward-Port-Of: odoo/odoo#165070