Daily updates from Odoo
Monday, June 22, 2026
376 changes
8 changes
Resolved issues and error corrections
This update resolves an error that occurred when reloading chart templates after removing account codes. The recent change allowed for optional account codes, but the reload process incorrectly attempted to match them, leading to a 'bool' type error. This fix ensures that accounts without codes are handled correctly during the reload process, preventing the error and maintaining chart template functionality.
Original PR description
Currently, an error occurs when reloading a chart template. Steps to Reproduce: - Install the `Accounting` module with demo data. - Go to `Accounting` > `Configuration` > `Accounting` > `Chart of…
Currently, an error occurs when reloading a chart template. Steps to Reproduce: - Install the `Accounting` module with demo data. - Go to `Accounting` > `Configuration` > `Accounting` > `Chart of Accounts`. - Open the `Current Assets` account and remove its account code. - Go to `Settings` and click the `Reload` button under `Fiscal Localization`. `TypeError: expected string or bytes-like object, got 'bool'` After this [recent commit], account codes became optional and can be removed. As a result, when the code is removed from the Fixed Assets account and the chart template is reloaded, the reload process tries to match template accounts [1] with existing accounts [2]. It retrieves the existing account using its id [3] and correctly finds the account record, but its code field is False. Later, when the reload logic compares the existing account code with the template account code, it attempts to use account code in a regular expression, which raises error [4]. This commit ensures that accounts without a code are treated as having a non-matching code. [recent commit]: https://github.com/odoo/odoo/commit/c3313b336b9f1305c363097745926f2bdf61e277 [1]- https://github.com/odoo/odoo/blob/b04678b130438d5ee1605fadb9ca567930691fdf/addons/account/models/chart_template.py#L1153-L1155 [2]: https://github.com/odoo/odoo/blob/b04678b130438d5ee1605fadb9ca567930691fdf/addons/account/models/chart_template.py#L332 [3]: https://github.com/odoo/odoo/blob/b04678b130438d5ee1605fadb9ca567930691fdf/addons/account/models/chart_template.py#L435 [4]- https://github.com/odoo/odoo/blob/b04678b130438d5ee1605fadb9ca567930691fdf/addons/account/models/chart_template.py#L439 sentry-7556472625 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update resolves a problem where custom styling of text input fields within Odoo wasn't working correctly. The previous version prevented users from applying their own styles, but this fix now allows for proper styling of text inputs by combining the default style with any styles provided by the user. This ensures consistent and customizable text input appearance.
Original PR description
BuilderTextInput's template hardcoded `inputClasses` to 'o-hb-input-text', dropping any `inputClasses` prop passed by callers. As a result, options trying to style their text input had no effect. Introduced in 0aba7f383c86dec00e9fc6d324a5bfdec7a19707. Concatenate caller-supplied `inputClasses` with the default `o-hb-input-text`. Forward-Port-Of: odoo/odoo#265156
This update resolves an issue where the link editor unexpectedly appeared after creating multiple tracked links. The fix ensures the editor is only displayed when a user is actively editing a link, preventing confusion and improving the user experience. This change simplifies the process of managing tracked links.
Original PR description
Steps to reproduce: - Go to the Link Tracker page - Generate a first tracked link - Click on the button to start editing the code - Click on "create another tracker" - Generate a second tracked link => When you access the screen to see/edit the tracked link url, the buttons "ok" and "cancel" are already present. Clicking on "ok" display a traceback. To fix this issue, this commit also cancels edition when clicking on "create another tracker". task-4531974 Forward-Port-Of: odoo/odoo#269886 Forward-Port-Of: odoo/odoo#268573
This update resolves an issue where POS orders with tracked products and GS1 barcodes would fail to validate due to an incorrect search for existing lots. The fix ensures that lot names, even when partially matching GS1 barcodes, are correctly identified, preventing duplicate lot creation errors. This improves the reliability of POS order processing.
Original PR description
When validating a POS order containing a product tracked by lots, an error about duplicate lot numbers is raised if the lot name can be read as a GS1 barcode (e.g. "10156": "10" is the GS1…
When validating a POS order containing a product tracked by lots, an error about duplicate lot numbers is raised if the lot name can be read as a GS1 barcode (e.g. "10156": "10" is the GS1 Application Identifier for Batch/Lot) while the company uses a GS1 nomenclature and the Barcode app is installed.
Steps to reproduce:
-------------------
* Install Barcode, POS and Inventory, enable lots & serial numbers
* Set the barcode nomenclature to "Default GS1 Nomenclature"
* Create a product tracked by lots and a lot named "10156" (any name starting with "10"), set an on-hand quantity for it with this lot
* On the "PoS Orders" operation type, enable both "Create New" and "Use Existing ones" for lots/serial numbers
* In POS, sell the product with lot "10156" and validate the order
> Observation:
The order fails to validate with a duplicate lot number error: the search for existing lots does not find lot "10156", so the POS tries to create it again and hits the unique constraint on stock.lot.
Why the fix:
------------
With stock_barcode installed, `stock.lot._search` preprocesses any domain on `name` with `_preprocess_gs1_search_args` so that scanned GS1 barcodes can match lot records. The lot names sent at order validation by `_create_production_lots_for_pos_order` are real lot names coming from the order lines, not scanned barcodes, but "10156" is decomposable as a valid GS1 lot ("10" + "156"), so the search domain became `('name', '=', '156')` and missed the existing lot. Skip the GS1 preprocessing in that search with the existing `skip_preprocess_gs1` context key, as already done in `product` and `stock`.
opw-6274744
Forward-Port-Of: odoo/odoo#269787This update resolves an issue where the system incorrectly forecasted expiring perishable products, leading to unnecessary reordering recommendations. The fix clarifies how the system handles expiration dates, ensuring accurate stock availability and preventing an endless replenishment cycle. This improves inventory management and reduces potential waste.
Original PR description
Currently when the user receives a perishable product that expires in future, it is considered for reordering regardless if the user has maximum quantity or not. ## Steps to produce: - Install…
Currently when the user receives a perishable product that expires in future, it is considered for reordering regardless if the user has maximum quantity or not. ## Steps to produce: - Install Inventory - Go to settings > Enable 'Lots and Serial Numbers' and 'Expiration Dates' - Create a product 'Vegetable Oil' that is tracked by lots. - Enable Expiration date in the 'Inventory' Section and set Removal date to 2. - Create a receipt for 'Vegetable oil' with Demand 10 and mark it as todo - Details > Set 'Expiration Date' into the future > Set a Lot Number and Save - Validate the receipt - Open Product Form for Vegetable oil > Reordering Rules. - Create a new Reordering rule with Min 5 and Max 10 and save. ## Observed Behavior: The forecasted quantity is calculated as zero, resulting in a quantity to order of 10, even though no replenishment is actually required. The product already satisfies the maximum quantity defined on the reordering rule, and there is no existing demand, as there are no delivery orders or sales order reservations for the product. **Why this is an issue:** When the user navigates from the product form to the On Hand Quantity view to verify the stock situation, the forecasted quantity is shown as 10. This is inconsistent with the value displayed on the reordering rule, creating confusion and making it difficult to understand the actual inventory status. In addition, if the product is configured with a Buy route, running the `Procurement: Run Scheduler` action repeatedly generates new purchase orders for the perishable product. Even if the generated purchase orders are cancelled or completed, since newly purchased stock will also have an expiration date. As a result, the same incorrect forecast calculation occurs again, causing the scheduler to continuously create new purchase orders and leading to an endless replenishment cycle if they expire within horizon days. ## Root cause: When an orderpoint is created or updated, `_compute_qty_to_order` [1] is triggered. This method calls `_compute_qty_to_order_computed` [2] which accesses the forecasted quantity, causing its compute method to called. The forecast computation retrieves context from `_get_product_context` as seen in [3], where the lead horizon date (route lead time + horizon days configured in settings) is passed as `to_date` at [4]. It then reads the product's `virtual_available` quantity using the orderpoint context at [5]. This ultimately invokes `_compute_quantities`, which delegates the calculation of `virtual_available` to `_compute_quantities_dict`, as shown in [6]. As a result, `max_date` is set to the lead horizon date at [7] (for example, one year in the future). Since the product expires before that date, it is included in `expired_unreserved_quant_res`, causing `virtual_available` to be reduced to zero at [8]. Consequently, the forecasted quantity also becomes zero at [9]. Because the forecasted quantity falls below the orderpoint's minimum quantity, a replenishment is incorrectly triggered. **Why did this issue not occur in previous versions?** This behavior was introduced by [commit](https://github.com/odoo/odoo/commit/8ba2c1e38b636c567511139c5e19b7189430a182 ), which fixed the calculation of fresh(unexpired) quantity displayed in the stock availability widget on sales order lines. Which expects that `scheduled_date` (typically the committed delivery date or expected delivery date, including leadtime) is passed to `read_qties` at [10] , which stores it in the context using the `to_date` key. However, the same `to_date` key is also used by the orderpoint horizon-days logic. This overlap causes the expiration-aware quantity computation to use the horizon date instead of the intended `with_expiration` date , leading to incorrect forecast calculations and the unexpected replenishment behavior described above. [1]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L394-L396 [2]-https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L417-L427 [3]- https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L374-L381 [4]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L484-L491 [5]- https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L386 [6]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L152-L154 [7]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L215-L218 [8]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L260-L262 [9]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L391 [10]- https://github.com/odoo/odoo/blob/afa2b6b7b47d6420146ceb6dad897405aa92c682/addons/sale_stock/models/sale_order_line.py#L129 ## Solution It does not make sense to trigger replenishment for perishable products solely because they are expected to expire before the horizon date. Even when the available quantity already satisfies the maximum quantity defined on the reordering rule, the current logic forecasts those products as unavailable in advance of their expiration. Instead, products should only be excluded from the forecast once they have actually expired, or when they must be removed according to the original expiration-handling logic. To achieve this, an additional context key can be introduced to distinguish calls originating from the forecast availability widget from SO line. When the computation is performed for the forecast widget, the existing `to_date` context key should continue to be used so that availability is evaluated at the requested future date. For all other flows, including orderpoint calculations, the system should rely on the `with_expiration` context key instead. This preserves the original behavior, where only already-expired quantities (or quantities that must be removed due to expiration rules) are excluded from availability calculations, preventing incorrect replenishment recommendations for perishable products. opw-6200644 Forward-Port-Of: odoo/odoo#268223
This update resolves an issue where reducing the PO quantity after a partial receipt in multi-step warehouses incorrectly updated the remaining backorder demand. The fix ensures accurate quantity calculations by considering the current move status, preventing overestimation of required units.
Original PR description
**Issue** Reducing the PO quantity after performing a partial receipt, in multi-step receipts warehouse can incorrectly update the remaining receipt quantity. **Steps to reproduce** - Setup 2-route…
**Issue** Reducing the PO quantity after performing a partial receipt, in multi-step receipts warehouse can incorrectly update the remaining receipt quantity. **Steps to reproduce** - Setup 2-route receipt warehouse (Inventory > Configuration > Warehouse Management > Warehouses) - Create a PO for 35 units and confirm it - Click on receive products, set received quantity to 10 and create a backorder - Validate the next transfer - Go back to the PO and change the quantity to 20 - Check the receipt demand -> The backorder picking demand become 35 instead of 10 **Cause** Updating the quantity of a purchase order line, also updates the related picking: https://github.com/odoo/odoo/blob/5fc1e34d174f7f61d692d086d0ff65fbfc72b013/addons/purchase_stock/models/purchase_order_line.py#L120 It updates the picking associated to the backorder since the other one is done: https://github.com/odoo/odoo/blob/5fc1e34d174f7f61d692d086d0ff65fbfc72b013/addons/purchase_stock/models/purchase_order_line.py#L185-L187 https://github.com/odoo/odoo/blob/5fc1e34d174f7f61d692d086d0ff65fbfc72b013/addons/purchase_stock/models/purchase_order_line.py#L197 This ultimately calls: https://github.com/odoo/odoo/blob/5fc1e34d174f7f61d692d086d0ff65fbfc72b013/addons/purchase_stock/models/purchase_order_line.py#L228 To compute the new demand for the picking, it retrieves the `move_dest`: https://github.com/odoo/odoo/blob/5fc1e34d174f7f61d692d086d0ff65fbfc72b013/addons/purchase_stock/models/purchase_order_line.py#L240 To compute `qty_to_push`: https://github.com/odoo/odoo/blob/5fc1e34d174f7f61d692d086d0ff65fbfc72b013/addons/purchase_stock/models/purchase_order_line.py#L247-L249 However, since we are in a 2-route receipt setup, `move_dest` is the move from Input to stock for the done picking. Thus, `qty_to_push` is `20 - 10 = 10` instead of `20 - 35 = -15` **Solution** The previous logic assumes a pull flow, where downstream (move_dest_ids) quantities are always up-to-date and can be used as the source of truth to recompute demand. In push flows (e.g., multi-step receipts), this assumption does not hold. To fix this, we instead base the computation on the quantity of the current moves (qty) if nothing has to be attached. **Additional information** Known limitation: this does not address inconsistencies in return flows. When there're returns, units define in the pol and the one define in the sum of the picking can diverge, thus this pr won't fix that. opw-5512172 Forward-Port-Of: odoo/odoo#269666 Forward-Port-Of: odoo/odoo#248626
Code cleanup and technical improvements
This update enhances the 'fragment_to_query_string' function, making it usable by modules beyond the auth_oauth component. It also includes important security improvements to ensure compliance with JUC standards, documented for clarity and tested thoroughly. This expands the functionality and strengthens the overall system.
Original PR description
## [MOV] odoo,auth_oauth: fragment_to_query_string The aim of this commit is to allow module unrelated to auth_oauth to import fragment_to_query_string. task-id: 6071808 ## [REF] odoo: JUC compliant fragment_to_query_string The aim of this commit is to make `fragment_to_query_string` JUC compliant by: - documenting the behavior - clarifying the code - reducing possible side effect - testing the behavior - add a route to be able to test it manually task-id: 6071808 Forward-Port-Of: odoo/odoo#270955 Forward-Port-Of: odoo/odoo#270834
This update ensures that references to a key component, `fragment_to_query_string`, are accurately maintained as it's integrated into the core Odoo framework. This change improves the stability and reliability of the social media integration features within the Enterprise edition. It's a routine maintenance update.
Original PR description
The aim of this commit is to keep referencing fragment_to_query_string correctly as it is moved into `http.py`. task-id: 6071808 Forward-Port-Of: odoo/enterprise#121096 Forward-Port-Of: odoo/enterprise#121019
25 changes
Enhancements to existing features
This update standardizes the font style for customer notes in the Point of Sale system to align with the appearance of line customer notes. This enhances visual consistency and improves the overall user experience for customers and staff.
Original PR description
We updated the general customer note font to match the line customer note's one. task-6294200
Resolved issues and error corrections
This update corrects a bug where custom styling of text inputs within Odoo wasn't working correctly. The previous version prevented users from applying their own styles to text inputs. This change ensures that styling options passed to text inputs now function as intended, providing greater flexibility in design.
Original PR description
BuilderTextInput's template hardcoded `inputClasses` to 'o-hb-input-text', dropping any `inputClasses` prop passed by callers. As a result, options trying to style their text input had no effect. Introduced in 0aba7f383c86dec00e9fc6d324a5bfdec7a19707. Concatenate caller-supplied `inputClasses` with the default `o-hb-input-text`. Forward-Port-Of: odoo/odoo#265156
This update corrects an issue where the link editor unexpectedly appeared when creating new tracked links. The fix ensures the editor only opens when a user actively wants to modify a link, preventing confusion and improving the user experience. This resolves a minor bug that could have caused frustration for users.
Original PR description
Steps to reproduce: - Go to the Link Tracker page - Generate a first tracked link - Click on the button to start editing the code - Click on "create another tracker" - Generate a second tracked link => When you access the screen to see/edit the tracked link url, the buttons "ok" and "cancel" are already present. Clicking on "ok" display a traceback. To fix this issue, this commit also cancels edition when clicking on "create another tracker". task-4531974 Forward-Port-Of: odoo/odoo#269886 Forward-Port-Of: odoo/odoo#268573
This update fixes an issue where the chatter in Odoo POS incorrectly displayed the employee who made changes to tracked orders. Now, the chatter accurately reflects the employee currently interacting with the order, ensuring accurate order tracking and communication. This improves order management and reduces potential confusion.
Original PR description
**Steps to reproduce:** - Enable "Track orders edits" in the settings - Enable "Log in with Employees" - Go to the Restaurant, log in with employee A - Go to a table, order 3 Sushis - Go back to the…
**Steps to reproduce:** - Enable "Track orders edits" in the settings - Enable "Log in with Employees" - Go to the Restaurant, log in with employee A - Go to a table, order 3 Sushis - Go back to the floor plan and change to employee B - Go back to the table and change the qty of 3 Sushis to 2 Sushis - Go to the order in the backend and check the chatter - It will indicate that employee A did the change, but it was employee B **Why the fix:** We always used the cashier set on the order to determine who should be put in the chatter, regardless of who is actually connected at that point. We now use the session's current employee to write who did the change in the chatter. We do not change the order's employee, because it will be done once the order has been paid. In the case where we are not logged in but pos_hr is installed, the employee_id might be the id of a res.user, and browsing it might return the wrong value. To avoid this, we check if the value exists as a hr.employee before assigning the name. The way we return the value has been changed because the linter wasn't happy about it. opw-6213504 Forward-Port-Of: odoo/odoo#270416 Forward-Port-Of: odoo/odoo#265582
This update corrects a bug where the system incorrectly forecasted expiring perishable products as unavailable, leading to unnecessary reordering. Now, the system accurately reflects stock levels and avoids triggering replenishment for perishable goods until they actually expire, resolving confusion for users.
Original PR description
Currently when the user receives a perishable product that expires in future, it is considered for reordering regardless if the user has maximum quantity or not. ## Steps to produce: - Install…
Currently when the user receives a perishable product that expires in future, it is considered for reordering regardless if the user has maximum quantity or not. ## Steps to produce: - Install Inventory - Go to settings > Enable 'Lots and Serial Numbers' and 'Expiration Dates' - Create a product 'Vegetable Oil' that is tracked by lots. - Enable Expiration date in the 'Inventory' Section and set Removal date to 2. - Create a receipt for 'Vegetable oil' with Demand 10 and mark it as todo - Details > Set 'Expiration Date' into the future > Set a Lot Number and Save - Validate the receipt - Open Product Form for Vegetable oil > Reordering Rules. - Create a new Reordering rule with Min 5 and Max 10 and save. ## Observed Behavior: The forecasted quantity is calculated as zero, resulting in a quantity to order of 10, even though no replenishment is actually required. The product already satisfies the maximum quantity defined on the reordering rule, and there is no existing demand, as there are no delivery orders or sales order reservations for the product. **Why this is an issue:** When the user navigates from the product form to the On Hand Quantity view to verify the stock situation, the forecasted quantity is shown as 10. This is inconsistent with the value displayed on the reordering rule, creating confusion and making it difficult to understand the actual inventory status. In addition, if the product is configured with a Buy route, running the `Procurement: Run Scheduler` action repeatedly generates new purchase orders for the perishable product. Even if the generated purchase orders are cancelled or completed, since newly purchased stock will also have an expiration date. As a result, the same incorrect forecast calculation occurs again, causing the scheduler to continuously create new purchase orders and leading to an endless replenishment cycle if they expire within horizon days. ## Root cause: When an orderpoint is created or updated, `_compute_qty_to_order` [1] is triggered. This method calls `_compute_qty_to_order_computed` [2] which accesses the forecasted quantity, causing its compute method to called. The forecast computation retrieves context from `_get_product_context` as seen in [3], where the lead horizon date (route lead time + horizon days configured in settings) is passed as `to_date` at [4]. It then reads the product's `virtual_available` quantity using the orderpoint context at [5]. This ultimately invokes `_compute_quantities`, which delegates the calculation of `virtual_available` to `_compute_quantities_dict`, as shown in [6]. As a result, `max_date` is set to the lead horizon date at [7] (for example, one year in the future). Since the product expires before that date, it is included in `expired_unreserved_quant_res`, causing `virtual_available` to be reduced to zero at [8]. Consequently, the forecasted quantity also becomes zero at [9]. Because the forecasted quantity falls below the orderpoint's minimum quantity, a replenishment is incorrectly triggered. **Why did this issue not occur in previous versions?** This behavior was introduced by [commit](https://github.com/odoo/odoo/commit/8ba2c1e38b636c567511139c5e19b7189430a182 ), which fixed the calculation of fresh(unexpired) quantity displayed in the stock availability widget on sales order lines. Which expects that `scheduled_date` (typically the committed delivery date or expected delivery date, including leadtime) is passed to `read_qties` at [10] , which stores it in the context using the `to_date` key. However, the same `to_date` key is also used by the orderpoint horizon-days logic. This overlap causes the expiration-aware quantity computation to use the horizon date instead of the intended `with_expiration` date , leading to incorrect forecast calculations and the unexpected replenishment behavior described above. [1]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L394-L396 [2]-https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L417-L427 [3]- https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L374-L381 [4]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L484-L491 [5]- https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L386 [6]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L152-L154 [7]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L215-L218 [8]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L260-L262 [9]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L391 [10]- https://github.com/odoo/odoo/blob/afa2b6b7b47d6420146ceb6dad897405aa92c682/addons/sale_stock/models/sale_order_line.py#L129 ## Solution It does not make sense to trigger replenishment for perishable products solely because they are expected to expire before the horizon date. Even when the available quantity already satisfies the maximum quantity defined on the reordering rule, the current logic forecasts those products as unavailable in advance of their expiration. Instead, products should only be excluded from the forecast once they have actually expired, or when they must be removed according to the original expiration-handling logic. To achieve this, an additional context key can be introduced to distinguish calls originating from the forecast availability widget from SO line. When the computation is performed for the forecast widget, the existing `to_date` context key should continue to be used so that availability is evaluated at the requested future date. For all other flows, including orderpoint calculations, the system should rely on the `with_expiration` context key instead. This preserves the original behavior, where only already-expired quantities (or quantities that must be removed due to expiration rules) are excluded from availability calculations, preventing incorrect replenishment recommendations for perishable products. opw-6200644 Forward-Port-Of: odoo/odoo#268223
This update significantly reduces the memory usage and processing time when loading large General Ledger reports. By optimizing how display names are retrieved, the system now handles complex reports more efficiently, leading to a smoother user experience. This change addresses a performance bottleneck impacting report loading speed.
Original PR description
### Issue Loading a large General Ledger (e.g., during an "Unfold All" action) and retrieving display names for thousands of journal lines (`account.move.line`) causes excessive memory and…
### Issue Loading a large General Ledger (e.g., during an "Unfold All" action) and retrieving display names for thousands of journal lines (`account.move.line`) causes excessive memory and performance overhead. Profiling with `memray` showed that one of the main memory hotspots was located in `custom_label_builder`. **Previous behavior:** Accessing `record.display_name` in a loop without an explicit `fetch()` call triggered lazy computation of the field via `_compute_display_name()`. When the compute method accessed stored dependency fields (such as `name`, `ref`, `move_id`), each cache miss went through `_fetch_field()`, which greedily loaded **all fields sharing the same prefetch group** on the model, far beyond the dependencies of `display_name` alone. This caused the ORM cache to be filled with many unnecessary stored fields for every record in the prefetch set. --- ### Dataset Volume The performance metrics were captured using a dataset consisting of: * **455,694** Journal Items (`account.move.line`) * **19,947** Journal Entries (`account.move`) --- ### Solution Add a single `fetch(['display_name'])` call on the browsed recordset. By calling `fetch(['display_name'])` upfront, the ORM goes through `_determine_fields_to_fetch(['display_name'])`, which walks only the declared `field_depends` of `display_name` and fetches **only those specific stored fields**. nothing more. --- ### Impact & Results | Metric | Before Optimization | After Optimization | Change / Note | | :--- | :--- | :--- | :--- | | **Peak Memory** | ~856 MB | ~223 MB | ~74% reduction | | **Execution Time** | 2.48s | 2.13s | About the same time with multiple tries | OPW-6275158 Forward-Port-Of: odoo/enterprise#121020
This update fixes a visual issue in the spreadsheet dashboard where focused buttons were obscured by the surrounding container. The change ensures that buttons have their expected focus shadows, creating a cleaner and more professional user experience. This improves usability and overall appearance.
Original PR description
the searchbar container cropped the shadow of its button when they were focused. Task-6303342 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#270812
This update resolves an issue where invoices with reverse charge tax in Poland (fa3) were generating incorrect XML files for transmission to the KSEF. Specifically, the XML lacked the necessary information to accurately reflect the reverse charge amount and total sale value. This ensures proper tax reporting and compliance.
Original PR description
**STEP TO REPRODUCE** 1. Create an invoice with a tax with reverse charge (0% EU G for example). 2. Send the invoice to ksef. 3. Open the generated xml, and notice field P_18 is 2 while it should be 1 (because there is reverse charge). Also, there is not P13_10 indicated the total value of sale to which the reverse charge applies. opw-6041836 Forward-Port-Of: odoo/odoo#263764
This update fixes a visual issue where the field selection popover overlapped with the dropdown in the HTML editor. By adjusting the z-index, the dropdown now correctly appears in front of the popover, providing a smoother and more intuitive user experience when selecting fields. This ensures consistent functionality for creating and editing content.
Original PR description
a4efb745e9f4ba24dfa01f1e17e65f1a7cac90a5 merged the web_studio dynamic field and the mass_mailing dynamic field into a single field selector, included from the HTML editor. This introduces a new flow…
a4efb745e9f4ba24dfa01f1e17e65f1a7cac90a5 merged the web_studio dynamic field and the mass_mailing dynamic field into a single field selector, included from the HTML editor. This introduces a new flow where the user has to first "activate" the field selector popover ( /field ), which appears as an overlay item; then open the ModelFieldSelector dropdown to select a field on its model, which appears as another overlay item. As both overlay items overlap, and they have the same "z-index" property, the last sibling in the overlay container appears first. In mass_mailing, the ModelFieldSelector selector dropdown's overlay item is introduced as the first child of that container; this results in the dropdown appearing behind the item through which it was opened. Fix: Overlay items holding a Dynamic Field Popover have their z-index property reduced by 1, ensuring they appear behind their ModelFieldSelectors at all times. Steps to reproduce: - Create a new mailing - Add in any text node - Type in /field - Press Enter - Click the [-] to select a field task-5477951
This update fixes a potential issue causing unpredictable behavior in the website's dynamic content rendering. By adding 'protection' to the snippet's callback, the system now handles changes more reliably, preventing unexpected errors. This ensures a smoother and more consistent user experience on the website.
Original PR description
Commit dcb070244dbcef59cae1e3b1e87ce9030608ce0d changed the registration of callback for re-render of dynamic snippet on window resize. But did not ensure the callback is "protected", like it was implicitely done with `t-on-` in `dynamicContent`. This commit uses `protectSyncAfterAsync` to register the callback, so that is it protected when called again. This lack of "protection" is suspected to cause a non-deterministic failure in `test_shop_editor_no_alternative_products_visibility` where mutations of dom are observed at unexpected times. runbot-939193 Forward-Port-Of: odoo/odoo#271011
This update fixes an issue where delivery note costs (DDT) were incorrectly calculated for products tracked across multiple lots. The fix ensures that the total sale price of all lots is used in the cost calculation, resulting in accurate DDT pricing. This improves the reliability of financial reporting for multi-lot sales.
Original PR description
Steps to reproduce: 1. Install Italian localization and l10n_it_stock_ddt 2. Create a product tracked by lots with a price of 100 3. Create two lots for that product, each with 5 in stock 4. Create a sale order for a quantity of 8 5. Confirm the sale order and validate the delivery 6. Print the delivery note Issue: Only the first lot's sale price is used in the DDT cost calculation (price = 500 instead of 800) Why this happens: The QWeb template used `move.move_line_ids[0].sale_price`, which only reads the sale_price of the first move line. When a delivery is split across multiple lots, each lot produces its own move line, so only the first is considered in the price calculation. opw-6244076 Forward-Port-Of: odoo/odoo#270743 Forward-Port-Of: odoo/odoo#267757
This update prevents users from being added to member history when joining an already finished live chat through an invite link. This ensures that chat statistics are accurate and consistent with the latest Odoo version (19.3). It's a technical adjustment to improve data reliability.
Original PR description
Avoid adding users to member history when joining an already ended live chat via an invite link. This prevents skewed chat statistics and aligns behavior with 19.3. partial backported PR: [odoo/pull/224920/](https://github.com/odoo/odoo/pull/224920) task-6317650 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update resolves an issue where manually added by-products on manufacturing orders caused errors during production closure. The fix ensures that serial numbers are correctly applied to by-products created outside of the standard BOM process, improving the reliability of the shopfloor operation.
Original PR description
**Issue** Adding a serial-tracked by-product manually on a Manufacturing Order whose BOM does not define it, can lead to inconsistencies when assigning serial numbers in the shopfloor application.…
**Issue** Adding a serial-tracked by-product manually on a Manufacturing Order whose BOM does not define it, can lead to inconsistencies when assigning serial numbers in the shopfloor application. **Steps to reproduce** - Activate by-product in the settings - Create a product with an empty BOM (final product) - Create another product tracked by serial number (by-product) - Create and confirm a MO for the final product with 1 unit of the by-product - Go to Miscellaneaous -> operation Type -> shopfloor - Activate the option "Pre fill lot/serial numbers in shop floor" - Return to the MO and open the shopfloor view - Click on the '+' button next to the by-product and assign a serial number - Try to close the production -> A user error is raised stating that the by-product requires a serial number. **Cause** When the by-product is added manually on the MO, a stock move is created with an initial move line that does not contain any serial number. Later, when assigning a serial number from the shopfloor view: https://github.com/odoo/enterprise/blob/8030b105d3fce1eef9b8965a2bfc37195f71723c/mrp_workorder/models/stock_move.py#L121-L122 a new move line containing the serial number is created: https://github.com/odoo/enterprise/blob/8030b105d3fce1eef9b8965a2bfc37195f71723c/mrp_workorder/models/stock_move.py#L116-L119 However, the original empty move line is not removed (the issue): https://github.com/odoo/enterprise/blob/8030b105d3fce1eef9b8965a2bfc37195f71723c/mrp_workorder/models/stock_move.py#L124-L125 Because `self.picking_type_prefill_shop_floor_lots` is True, but `self.byproduct_id` is an empty recordset since: https://github.com/odoo/odoo/blob/8d14665af5acf1bd391d05a5048dc701986e8b15/addons/mrp/models/mrp_production.py#L1304-L1311 https://github.com/odoo/odoo/blob/8d14665af5acf1bd391d05a5048dc701986e8b15/addons/mrp/models/mrp_production.py#L1279 Indeed, `byproduct_id` is only populated from BOM-defined by-products. As a result, while confirming the production, there is 2 sml and among them, the original one without SN, which triggers the error: https://github.com/odoo/odoo/blob/8d14665af5acf1bd391d05a5048dc701986e8b15/addons/stock/models/stock_move_line.py#L590 https://github.com/odoo/odoo/blob/8d14665af5acf1bd391d05a5048dc701986e8b15/addons/stock/models/stock_move_line.py#L634-L635 https://github.com/odoo/odoo/blob/8d14665af5acf1bd391d05a5048dc701986e8b15/addons/stock/models/stock_move_line.py#L658-L659 https://github.com/odoo/odoo/blob/8d14665af5acf1bd391d05a5048dc701986e8b15/addons/stock/models/stock_move_line.py#L661-L669 opw-6223158 Forward-Port-Of: odoo/enterprise#118792
This update streamlines the process for applying Early Payment Discounts (EPD) to refund transactions. Previously, a technical issue prevented correct tax repartitioning, now resolved by ensuring the system correctly identifies and maps invoice and refund lines for EPD calculations. This enhancement improves the accuracy and reliability of EPD processing on refunds.
Original PR description
This commit does not bring native support for EPD on credit notes, only makes custom support a little easier and cleaner. It is quite easy to support EPD (early payment discounts) on refunds by…
This commit does not bring native support for EPD on credit notes, only makes custom support a little easier and cleaner. It is quite easy to support EPD (early payment discounts) on refunds by extending - `_early_payment_discount_move_types` - `_is_eligible_for_early_payment_discount` However, this approach breaks when it reaches `inverse_tax_rep` in `_get_invoice_counterpart_amls_for_early_payment_discount_per_payment_term_line`, which assumes tax repartition lines with `document_type == 'invoice'` and raises when called on `tax_rep` lines of 'refund' type instead. This commit fixes that by selecting source and target repartition lines according to the `tax_rep`'s document type, which ensures: - the `.index()` no longer raises a `ValueError`, as `tax_rep` is now looked up in the matching set (`refund_` for refunds, `invoice_` otherwise) - `inverse_tax_rep` returns the corresponding line in the opposite set, preserving the original invoice->refund mapping while adding the refund->invoice one Since `inverse_tax_rep` is a closure, downstream modules cannot patch it without copying the whole ~170-line method. Making it symmetric here lets custom EPD-on-refund support work without that duplication. task-[6265601](https://www.odoo.com/odoo/all-tasks/6265601) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#271102
This update resolves a bug that previously prevented the system from correctly calculating bill addresses when address fields were empty. Now, empty address fields are automatically set to blank strings, ensuring accurate billing information is processed. This improves the reliability of payment authorization transactions.
Original PR description
Fix bug introduced by commit https://github.com/odoo/odoo/pull/267592/changes/c4556637e8eeef07ce6e3cc3b3b4cf28fa10e468 that caused an error if an address field was not set, due to trying to cut a False field. Now, unset fields are set to empty strings. Forward-Port-Of: odoo/odoo#270295
This update corrects a visual issue where product images in the grid layout didn't appear in the expected left-to-right order. The change ensures that image navigation within the product image viewer now accurately reflects the visual arrangement of images, improving the user experience.
Original PR description
This commit ensures product images follow their visual order in the product image viewer when using the grid layout. Steps to reproduce: - Open a product page with multiple images (or add Extra Media…
This commit ensures product images follow their visual order in the product image viewer when using the grid layout. Steps to reproduce: - Open a product page with multiple images (or add Extra Media to the product) - Change layout mode to "Grid" and click save - Click any image to open the product image viewer - Navigate between images Images do not follow the visual left-to-right order. This regression was introduced by [commit], which replaced the row-based grid with a column-first layout. As a result, `querySelectorAll` returns images in DOM order, which no longer matches the visual order. To fix this, images are now reordered based on their visual placement in the grid so navigation matches the order seen by the user. Images are traversed in visual left-to-right order while also accounting for varying image heights and multi-column alignment. [commit]: https://github.com/odoo/odoo/commit/9a3628b9735550bf8ecc2252ea1b7338f68ab966 task-[4364143](https://www.odoo.com/odoo/project/974/tasks/4364143) Forward-Port-Of: odoo/odoo#270732 Forward-Port-Of: odoo/odoo#254077
This update fixes an issue where appointment invitations weren't always sent when appointments were in statuses other than 'booked' or 'request'. The change ensures that invitations are consistently sent for appointments, improving the user experience and preventing missed meeting notifications. This was originally identified and addressed in a related enterprise PR.
Original PR description
This PR adapts the code to fix the invitations at the appointments' update. See the enterprise PR to get more information about the issues. Enterprise PR: https://github.com/odoo/enterprise/pull/114304 Task-6139036 Forward-Port-Of: odoo/odoo#270925 Forward-Port-Of: odoo/odoo#260073
This update fixes issues with sending appointment invitations, ensuring they're only sent when an appointment is actually booked or requested. Previously, invitations were sent even when appointments were cancelled or updated, leading to unnecessary emails. This ensures a cleaner and more reliable invitation process for users.
Original PR description
This PR fix three issues related to the sending of the appointment invitations. Each one has its own commit: - Commit 1 sends invitations only if the event either "booked" or "request". Previously they were sent even if the appointment was cancelled. - Commit 2 prevents the sending of regular invitations and always sends appointment invitation to new attendees of existing booked appointments. - Commit 3 sent appointment invitations if the status of an existing event is set "request". It also add the status change in the log as it would have been if it was done at the creation. Community PR: https://github.com/odoo/odoo/pull/260073 Task-6139036 Forward-Port-Of: odoo/enterprise#121081 Forward-Port-Of: odoo/enterprise#114304
This update fixes an issue where the table of contents would obscure headings when the status bar was made sticky. The change adjusts how the table of contents scrolls to ensure headings remain visible, improving the user experience when navigating long documents.
Original PR description
Since [1] when the `o_form_statusbar` status bar was made `sticky` the table of content scrolls to a given heading without taking it into account. Because of this, when scrolling upwards the heading ends up behind the status bar. This commit fixes this by finding top-aligned sticky elements within the closest scrollable element impacted by the table of content. Steps to reproduce: - Go to a To do note - Define some headings - Have sufficient content so that reaching a heading requires scrolling - Define a table of content with `/toc` - Click on a heading => The heading ended up behind the status bar. [1]: https://github.com/odoo/odoo/commit/a3c63413825cf3492a10ade77a2c571c4eeb33a6 task-6302762 Forward-Port-Of: odoo/odoo#270043
This fix resolves an issue where invoices for returned dropshipped products incorrectly displayed both lot numbers instead of just the correct one. The update ensures that the invoice accurately reflects the returned product's serial/lot number, improving inventory accuracy and reporting. This was caused by a misinterpretation of return move lines during invoice generation.
Original PR description
**Issue** Printing an invoice for a returned dropshipped tracked product could display the wrong lot/serial number on the invoice report. **Steps to reproduce** - Activate "Display Lots & Serial…
**Issue**
Printing an invoice for a returned dropshipped tracked product could display the wrong lot/serial number on the invoice report.
**Steps to reproduce**
- Activate "Display Lots & Serial Numbers on Invoices"
- Create a product tracked by serial/lot and enable the dropship route
- Create two lots: "lot1" and "lot2"
- Create and confirm a SO for quantity 2
- Confirm the PO and validate the dropship for both lots
- Create and post an invoice
- Return "lot2" from the dropship picking
- Create and post a credit note for quantity 1
- Click on print on the invoice
-> The generated PDF displays "lot1 & lot2" instead of "lot1"
**Cause**
While rendering `account.report_invoice_with_payments`, the report calls `_get_invoiced_lot_values` to determine which lot/serial numbers should be displayed:
https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L31-L32 `invoiced_qties = 2` since the invoice is on a quantity of 2 https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L44 Three stock move lines are retrieved from the SO:
- the two original dropship deliveries,
- the return move for `lot2`. https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L63 However, none of them are considered as `is_stock_return` because the dropship locations use `supplier` instead of `internal`: https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L72-L76 As a consequence:
- The two original delivery move lines each keep quantity `1`: https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L69 they never pass through the return handling logic (as they should be): https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L77-L80
- for the last one, `is_stock_return = False` while it should not, thus the quantity is 1 instead of 0. Furthermore, it does not pass by this code:
https://github.com/odoo/odoo/blob/8759429547e42e9f63b15a7c80475be46ef437e2/addons/sale_stock/models/account_move.py#L79 which would make the quantity for lot2 equalled to 0 (1-1) The quantities are therefore accumulated as:
https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L92
resulting in:
`qties_per_lot = {lot1: 1, lot2: 2}`
instead of:
`qties_per_lot = {lot1: 1, lot2: 0}`
The report selects both lots since it starts with lot1 (qty of 1): https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L94-L99
opw-6236855
Forward-Port-Of: odoo/odoo#270599This update fixes two issues related to USPS shipping rates. First, it now displays the correct packaging dimension unit of measure, resolving confusion about inch vs. foot conversions. Second, it ensures USPS rates are calculated accurately based on the selected service type, not just domestic or international.
Original PR description
Issue ----- There are 2 issues with USPS rest: 1. USPS packagings do not have their size UOM displayed. This leads to confusion as users input in inches but the dimensions are treated as feet. 2.…
Issue ----- There are 2 issues with USPS rest: 1. USPS packagings do not have their size UOM displayed. This leads to confusion as users input in inches but the dimensions are treated as feet. 2. USPS returns the same rate regardless of the package type. Steps to reproduce ----- - Set USPS up - Open the Package Type form > go to its' Dimensions tab > Issue 1 - Set USPS up (domestic) - Select a `Domestic Rating Indicator` (eg LF - Flat Rate Box) - Create a SO with some product - Open the delivery widget and add a rate with USPS - Discard the changes - Go to the delivery method and change the rating (eg SP - Single Piece) - Go back to the SO - Open the delivery widget and add a rate with USPS > Issue 2, rate is the same as before Issue 1 ----- By default, there is no displayed UOM on the form because of https://github.com/odoo/odoo/blob/38c737c2a4cc29b48235a100cfa9d6152af73826/addons/stock_delivery/models/stock_package_type.py#L20-L33 We can change this behaviour for USPS specifically as done in Envia https://github.com/odoo/enterprise/blob/20cc61e69aa3f6a59de1e962b25ce11fa402bf22/delivery_envia/models/stock_package_type.py#L37-L46 Issue 2 ----- In `usps_rest_rate_shipment`, we request rates for every package of the delivery, which we receive as lists. We then iterate over the list to find the rate matching the `mail_class`. The problem is that this only filters over whether the delivery is domestic or international. We don't filter based on the actual service selected on the carrier (`usps_domestic_rating_indicator` for domestic and `usps_international_rating_indicator` for international). https://github.com/odoo/enterprise/blob/20cc61e69aa3f6a59de1e962b25ce11fa402bf22/delivery_usps_rest/models/delivery_usps.py#L224-L236 ----- Ticket: opw-6224918 Forward-Port-Of: odoo/enterprise#120789 Forward-Port-Of: odoo/enterprise#120594
This update resolves an issue where mass email campaigns were incorrectly using users' personal email servers, causing delays and errors. The changes ensure that personal servers are excluded from mass mailing selections and campaign execution, improving reliability and preventing campaigns from getting stuck.
Original PR description
A personal outgoing mail server is an `ir.mail_server` that belongs to one user. The system only lets that user send through it. Mass mailings do not always respect this, which can cause a few…
A personal outgoing mail server is an `ir.mail_server` that belongs to one user. The system only lets that user send through it. Mass mailings do not always respect this, which can cause a few problems: 1. Admins cannot duplicate a personal server. The copy keeps the same owner, and the rule that says one user can own only one server stops the save. 2. In *Email Marketing > Settings*, the "Dedicated Server" picker offers every server, even personal ones. If an admin picks a personal one, all campaigns get stuck. The cron job runs as Odoobot, the personal server rejects it, and the mailing stays in the queue. 3. When no dedicated server is set, the fallback selection can still land on a personal server (for example because its `from_filter` matches the sender). The cron sends through it and gets rejected. One commit per problem: 1. **mail**: duplicating a personal server now produces a copy with no owner. 2. **mass_mailing**: the picker in the settings hides personal servers. Setting an owner on a server that is already used for mass mailing now raises a clear error that names the campaign blocking the change. 3. **mass_mailing**: personal servers are skipped when the fallback selection runs, so only shared servers are considered. opw-6086077 Forward-Port-Of: odoo/odoo#270607 Forward-Port-Of: odoo/odoo#261537
This update fixes an issue where comment counts on course slides weren't accurately reflecting the number of active comments. The change adjusts how comments are tracked due to recent portal chatter updates, ensuring the displayed count matches the actual number of comments. This improves the user experience for course reviews.
Original PR description
Steps to reproduce: - Open a slide of a course in non fullscreen mode (website). - Go to the comments tab and add a comment in the chatter. - The comments count does not change in the tab. - The same thing happens when a comment is deleted. - Another way to see the incorrect counter is to add a note in the slide form view (backend). Before this change, `website_slides` used `website_message_ids` to calculate the comments. Since #138233 the old portal chatter has been replaced with the mail chatter and the way messages are displayed on the portal has changed. For example notes are no longer considered portal messages and also deleted messages should not be displayed or counted as such. This change ensures that comments calculations are based on a domain that considers those changes meaning that comments will be synced with the actual number of available comments. Forward-Port-Of: odoo/odoo#270800 Forward-Port-Of: odoo/odoo#260376
This update significantly speeds up appointment scheduling by optimizing how the system checks resource availability. The change eliminates a redundant process, resulting in faster slot availability checks, particularly when managing many resources like tables in a restaurant. This improves the user experience and system responsiveness.
Original PR description
In the current code, for each slot, and for each "available" resource, we check if the resource is available on the slot, based on availability values. Then, we check the remaining capacity of that…
In the current code, for each slot, and for each "available" resource, we check if the resource is available on the slot, based on availability values. Then, we check the remaining capacity of that resource. Also, linked resources information is added when computing the original resource remaining capacity. If many linked resources exist, this will be done several times and is not useful. This commit makes that loop disappear. We now check all resources at once in terms of availability, and linked resources that could be selected (in the appointment resources, in the slot resources (if any restricted resource)) at the same time. Then, the total capacity is the sum of the resource remaining capacity and the ones of available linked resources. Therefore, _slot_availability_is_resource_available is renamed to _slot_available_resources, as it now takes more than one resource and returns all resources among 'resources' that are valid on the slot, based on the availability_values, slot restrictions and booking lines. A noticeable difference is mainly seen when using many resources (and linked resources). For instance, a restaurant with a lot of small tables will have their slot availability check much shorter. BENCHMARK, LOCAL (time only, as number of requests does not change) Only appointment installed For a restaurant with - 10 tables of 2 - 5 tables of 2 linked, 2 times - 10 tables of 4 - 2 table of 2 - time then auto assign On loading /appointment/id: ~ 3.1s -> ~ 1.6s On selecting any number of people (1 to 10): [2s, 2.5s] -> [0.6s, 0.8s] Task-4144524 Forward-Port-Of: odoo/enterprise#121005 Forward-Port-Of: odoo/enterprise#107711
Documentation and clarification updates
This pull request formally records Adrien Didot's signature on the Odoo Individual Contributor License Agreement. It adds documentation confirming the CLA signing, ensuring compliance with Odoo's licensing terms. This update is a standard legal step for contributors.
Original PR description
Individual Contributor License Agreement signature. Adds `doc/cla/individual/adridot.md` per the CLA signing instructions. Related contribution: #270196 Forward-Port-Of: odoo/odoo#270411 Forward-Port-Of: odoo/odoo#270197
24 changes
Security fixes and vulnerability patches
This update strengthens Odoo's security by ensuring users only have read access to data, preventing potential issues and maintaining data integrity. The change focuses on the core Odoo database structure, addressing a vulnerability that could lead to unexpected behavior. This update is a standard security fix.
Original PR description
Ensure that the user has read access to prevent any unexpected behavior. Task-6226863 Forward-Port-Of: odoo/odoo#267709
Resolved issues and error corrections
This update resolves an error that occurred when syncing AvaTax exemption codes. The issue stemmed from a mismatch in how AvaTax represented 'all countries' values, causing a crash during synchronization. This fix ensures correct data handling and successful exemption code synchronization.
Original PR description
Steps to reproduce: - Create a US company - Go to Accounting > Configuration > Settings - Activate `Avatax` > Set Credentials - Try to "Sync Parameters" Traceback: ```py File…
Steps to reproduce:
- Create a US company
- Go to Accounting > Configuration > Settings
- Activate `Avatax` > Set Credentials
- Try to "Sync Parameters"
Traceback:
```py
File "/home/odoo/src/enterprise/saas-19.2/account_avatax/models/res_company.py", line 113, in avatax_sync_company_params
'valid_country_ids': [(6, 0, get_countries(vals['validCountries']).ids)],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/enterprise/saas-19.2/account_avatax/models/res_company.py", line 90, in get_countries
return self.env['res.country'].browse([country_cache[code] for code in code_list])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/odoo/src/odoo/saas-19.2/odoo/orm/models.py", line 5208, in browse
assert all(ids) or all(isinstance(x, NewId) or x for x in ids), "Invalid falsy real id"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Invalid falsy real id
```
The issue occurs because AvaTax return `*` in the `validCountries` field to indicate that an exemption code is valid for all countries. The synchronization logic stores this value in the country cache as `False` and later passes it to `res.country.browse()`. Since `browse()` does not accept a mix of valid IDs and falsy values, the operation crashes during the synchronization process.
This commit filter out falsy country IDs when resolving country codes to prevent crashes and allow exemption codes to be synchronized successfully.
opw-6298189The Odoo team has partially reverted a recent code update due to unexpected changes introduced by Weblate. This ensures the translation updates made during the Weblate integration are preserved while correcting the unwanted code modifications. This resolves a technical issue impacting multiple modules.
Original PR description
For some reason Weblate reverted some code changes apart from the translations updates it did. We partially revert the commit here to fix the code, but keep the translation updates. This partially reverts commit 06c83da5410fd3869af0d9c3edddf9cc1a7d7c55.
This update fixes an issue where DIAN XML invoices were being rejected due to incorrect calculations of prepaid payments. The fix combines payment amounts into a single tag, ensuring accurate totals and preventing the creation of negative payment lines, which were causing API errors.
Original PR description
**Steps to reproduce:** To test this, you will need an official DIAN setup, because this error comes from the response to our API call to the DIAN. - Setup the DIAN in a colombian company - Open the…
**Steps to reproduce:** To test this, you will need an official DIAN setup, because this error comes from the response to our API call to the DIAN. - Setup the DIAN in a colombian company - Open the PoS - Order a product - Before paying, make the amount we are paying bigger than the amount due - We get an error response from the API, the error is saying that the total due does not match what we paid **Why the fix:** Currently, the xml is rejected because the sum of the **PaidAmount** in the **PrepaidPayment** tag is not equal to what we are trying to pay for. This is happening because to avoid the fact that we can not send a line with negative amount, we used the **abs()** function on the line amount to make it positive. The negative line comes from the fact that when we have a total due that is below the amount paid, we create a new payment line with a negative amount to balance it out. But as we can't send lines with negative amount, we needed to make it positive. This does not work, as the sum of the lines' amount will then be too much compared to what we are paying for, because instead of substracting it we will be adding it. To avoid this, we now group the amount in one single tag and send it this way. This ensures that the sent amount is correct and equals the amount due, and does not send a negative line. opw-6232575 Forward-Port-Of: odoo/enterprise#121075 Forward-Port-Of: odoo/enterprise#119255
This update resolves an issue where invoices with reverse charge tax in Poland (fa3) were generating incorrect XML files for ksef transmission. Specifically, the XML lacked the necessary information to accurately reflect the reverse charge amount and total sale value. This fix ensures proper tax reporting and compliance.
Original PR description
**STEP TO REPRODUCE** 1. Create an invoice with a tax with reverse charge (0% EU G for example). 2. Send the invoice to ksef. 3. Open the generated xml, and notice field P_18 is 2 while it should be 1 (because there is reverse charge). Also, there is not P13_10 indicated the total value of sale to which the reverse charge applies. opw-6041836 Forward-Port-Of: odoo/odoo#263764
This update resolves an issue where users couldn't link bank statement lines to child contacts when using the 'Set Partner' button. The fix aligns the system's logic to correctly recognize and select child contacts, ensuring accurate bank statement reconciliation. This improves the usability of the bank reconciliation process.
Original PR description
When creating a bank statement line, we can not set an individual contact that is a children of a company contact. However, when clicking on the 'Set Partner' button, all contacts are shown in the modal list view. This commit aligns the domain coming from the 'Set Partner' button with the domain from the 'partner_id' field of the auto reconcile wizard Steps: - Have a contact X, with a child contact Y - Create and confirm an invoice for contact Y, amount 1000 - Create a bank statement line for 1000 -> You can not select Y, only X - Click 'Add & Close' - Click on 'Set Partner' button -> Y is displayed opw-6205154 Forward-Port-Of: odoo/enterprise#118036
This update resolves an issue where sign templates with auto-filled fields would incorrectly display placeholders instead of the actual values, or fail to generate documents. The fix ensures falsy values from auto-fields are properly handled, preventing errors and guaranteeing accurate sign document generation.
Original PR description
Version: - 19.0 Steps to reproduce: - Create a sign template with a readonly sign item linked to an auto field. - Use a reference record where the linked field value is empty or False. - Send the…
Version: - 19.0 Steps to reproduce: - Create a sign template with a readonly sign item linked to an auto field. - Use a reference record where the linked field value is empty or False. - Send the document for signing. - Complete the signing flow. Issue: - Readonly sign items linked to auto-filled values could not properly handle falsy values. Empty values could trigger the error "Some required items are not filled" and completed sign requests displayed the sign item placeholder instead of the actual auto-filled value. - completed document generation could fail when rendering falsy values for textarea sign items. Cause: - Falsy auto-filled values were ignored during constant item population and replaced by the sign item placeholder. Additionally, readonly constant items were included in required field validation and completed sign requests continued to display placeholders when the stored value was empty. - document rendering assumed sign item values were always strings for textarea sign items but when auto field is empty it value can be False. Fix: - Preserve falsy values when populating readonly constant items, exclude constant items from signer validation, and hide placeholders for empty auto-filled constant items when displaying completed sign requests. - Normalize falsy values to prevent crashes and allow completed documents to be generated correctly. Forward-Port-Of: odoo/enterprise#121009
This update fixes a potential instability issue with dynamic website content snippets. The change ensures callbacks are properly protected during re-renders, preventing unexpected behavior and test failures. This improves the reliability of the website experience.
Original PR description
Commit dcb070244dbcef59cae1e3b1e87ce9030608ce0d changed the registration of callback for re-render of dynamic snippet on window resize. But did not ensure the callback is "protected", like it was implicitely done with `t-on-` in `dynamicContent`. This commit uses `protectSyncAfterAsync` to register the callback, so that is it protected when called again. This lack of "protection" is suspected to cause a non-deterministic failure in `test_shop_editor_no_alternative_products_visibility` where mutations of dom are observed at unexpected times. runbot-939193 Forward-Port-Of: odoo/odoo#271011
This update fixes an issue where the withholding tax return incorrectly combined balances with the regular tax return. The change ensures the withholding tax return accurately calculates the independent balance due, resolving a discrepancy in Italian tax reporting. This improves the accuracy of financial reporting for Italian businesses.
Original PR description
Steps to reproduce: - setup an Italian company - make an invoice (for example in May) with a withholding tax and make a transaction to pay it - generate tax returns (opening date in June so that it generates from May) - validate regular tax return for May - validate withholding tax return for May -> The withholding tax return shows an amount to pay with a balance that is a combination of both the regular tax return and the withholding one, while it should be independent of the regular one. task-6116304 Forward-Port-Of: odoo/enterprise#119375
This update corrects a bug where custom styling of text input fields within Odoo wasn't working correctly. The previous version ignored styling instructions passed from the user. Now, styling options are properly applied, ensuring consistent and customizable text input appearances.
Original PR description
BuilderTextInput's template hardcoded `inputClasses` to 'o-hb-input-text', dropping any `inputClasses` prop passed by callers. As a result, options trying to style their text input had no effect. Introduced in 0aba7f383c86dec00e9fc6d324a5bfdec7a19707. Concatenate caller-supplied `inputClasses` with the default `o-hb-input-text`. Forward-Port-Of: odoo/odoo#265156
This update fixes a bug in the Preparation Time report for Point of Sale, ensuring that preparation durations are displayed correctly based on the user's current timezone. Previously, the report always used the timezone of the OdooBot, leading to inaccurate data. This change improves reporting accuracy and provides a more reliable view of preparation times.
Original PR description
In POS, the Preparation Time report groups average preparation durations by hour. Those hour buckets were always computed with the timezone of the user who ran the module upgrade (OdooBot /…
In POS, the Preparation Time report groups average preparation durations by hour. Those hour buckets were always computed with the timezone of the user who ran the module upgrade (OdooBot / superuser), not the timezone of the user viewing the report. Changing the user, company, or browser timezone had no effect on the graph until the module was upgraded again. Steps to reproduce: ------------------- * Configure a Preparation Display and create POS orders with measured preparation times. * Open Point of Sale → Reporting → Preparation Time. * Note the hour bucket used for the orders. * Change your user timezone in Preferences and reload the report. > Observation: The hour buckets stay the same. Before the fix, they only changed after upgrading `pos_enterprise`, because the timezone was embedded in the SQL view created during `init()` as superuser. Why the fix: ------------ Replace the static PostgreSQL view with a dynamic `_table_query` so `order_hour` is computed with the current user's timezone on each report read. `init()` now only drops the legacy view instead of recreating it with a frozen timezone. opw-6220248 Forward-Port-Of: odoo/enterprise#118365
This fix resolves an issue where extra prices were incorrectly added to combos when using 'always' attribute types. The update ensures that extra prices are now set on the combo creation page, aligning with the intended behavior for product variants. This improves the accuracy of point-of-sale pricing.
Original PR description
## Steps to reproduce - Create an attribute A, of type always, with 2 values, one should have an extra price - Create an attribute B, of type never, with 2 values - Create a product that has both…
## Steps to reproduce - Create an attribute A, of type always, with 2 values, one should have an extra price - Create an attribute B, of type never, with 2 values - Create a product that has both those attributes - Create a combo with that product with both values for A - Go to the PoS and order that combo with the value that has an extra price for A - The extra price is added ## Why the fix: For variants of type always, a product is created, meaning we can chose which products of this variants to have in our combo. As we can chose this, it means that we can and should chose the extra price on the combo creation page, not on the attribute page. It does not make sense to take the attribute extra price into account, as we do not take the unit price of combo items into account, so this extra price should be set on the combo page and we should ignore the attribute's extra price if the type is "always". The variants are then considered as different products, as they should in this case. If the type of the attribute is never, we can't chose which one gets an extra price on the combo page, so we should still take the attribute's extra price in this situation, as we have no other way to set it. We need to have both an always and a never attribute in order to reproduce this bug because if we only have "always" values, the configuration of the combo item is bypassed and is undefined, so **attribute_value_ids** will be undefined in this code and we won't get any value for the extra price in this code: https://github.com/odoo/odoo/blob/c09e8b2fc24ee75495fc947924e29cf5c601506f/addons/point_of_sale/static/src/app/models/utils/compute_combo_items.js#L44-L49 We now ignore the attribute's extra price if it's type is always, otherwise, it the behavior stays the same. opw-6262431 Forward-Port-Of: odoo/odoo#270625 Forward-Port-Of: odoo/odoo#268567
This update resolves an issue where the system incorrectly forecasted expiring perishable products, leading to unnecessary purchase orders. The fix ensures that forecasts accurately reflect product availability and prevents the scheduler from continuously generating purchase orders for items nearing expiration. This improves inventory accuracy and reduces operational waste.
Original PR description
Currently when the user receives a perishable product that expires in future, it is considered for reordering regardless if the user has maximum quantity or not. ## Steps to produce: - Install…
Currently when the user receives a perishable product that expires in future, it is considered for reordering regardless if the user has maximum quantity or not. ## Steps to produce: - Install Inventory - Go to settings > Enable 'Lots and Serial Numbers' and 'Expiration Dates' - Create a product 'Vegetable Oil' that is tracked by lots. - Enable Expiration date in the 'Inventory' Section and set Removal date to 2. - Create a receipt for 'Vegetable oil' with Demand 10 and mark it as todo - Details > Set 'Expiration Date' into the future > Set a Lot Number and Save - Validate the receipt - Open Product Form for Vegetable oil > Reordering Rules. - Create a new Reordering rule with Min 5 and Max 10 and save. ## Observed Behavior: The forecasted quantity is calculated as zero, resulting in a quantity to order of 10, even though no replenishment is actually required. The product already satisfies the maximum quantity defined on the reordering rule, and there is no existing demand, as there are no delivery orders or sales order reservations for the product. **Why this is an issue:** When the user navigates from the product form to the On Hand Quantity view to verify the stock situation, the forecasted quantity is shown as 10. This is inconsistent with the value displayed on the reordering rule, creating confusion and making it difficult to understand the actual inventory status. In addition, if the product is configured with a Buy route, running the `Procurement: Run Scheduler` action repeatedly generates new purchase orders for the perishable product. Even if the generated purchase orders are cancelled or completed, since newly purchased stock will also have an expiration date. As a result, the same incorrect forecast calculation occurs again, causing the scheduler to continuously create new purchase orders and leading to an endless replenishment cycle if they expire within horizon days. ## Root cause: When an orderpoint is created or updated, `_compute_qty_to_order` [1] is triggered. This method calls `_compute_qty_to_order_computed` [2] which accesses the forecasted quantity, causing its compute method to called. The forecast computation retrieves context from `_get_product_context` as seen in [3], where the lead horizon date (route lead time + horizon days configured in settings) is passed as `to_date` at [4]. It then reads the product's `virtual_available` quantity using the orderpoint context at [5]. This ultimately invokes `_compute_quantities`, which delegates the calculation of `virtual_available` to `_compute_quantities_dict`, as shown in [6]. As a result, `max_date` is set to the lead horizon date at [7] (for example, one year in the future). Since the product expires before that date, it is included in `expired_unreserved_quant_res`, causing `virtual_available` to be reduced to zero at [8]. Consequently, the forecasted quantity also becomes zero at [9]. Because the forecasted quantity falls below the orderpoint's minimum quantity, a replenishment is incorrectly triggered. **Why did this issue not occur in previous versions?** This behavior was introduced by [commit](https://github.com/odoo/odoo/commit/8ba2c1e38b636c567511139c5e19b7189430a182 ), which fixed the calculation of fresh(unexpired) quantity displayed in the stock availability widget on sales order lines. Which expects that `scheduled_date` (typically the committed delivery date or expected delivery date, including leadtime) is passed to `read_qties` at [10] , which stores it in the context using the `to_date` key. However, the same `to_date` key is also used by the orderpoint horizon-days logic. This overlap causes the expiration-aware quantity computation to use the horizon date instead of the intended `with_expiration` date , leading to incorrect forecast calculations and the unexpected replenishment behavior described above. [1]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L394-L396 [2]-https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L417-L427 [3]- https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L374-L381 [4]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L484-L491 [5]- https://github.com/odoo/odoo/blob/96b7eed9153eab60288d1624252df6f90ea9505e/addons/stock/models/stock_orderpoint.py#L386 [6]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L152-L154 [7]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L215-L218 [8]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/product.py#L260-L262 [9]- https://github.com/odoo/odoo/blob/9ae1df190cf5ee6a5775eddb32be7b13f5ed92c9/addons/stock/models/stock_orderpoint.py#L391 [10]- https://github.com/odoo/odoo/blob/afa2b6b7b47d6420146ceb6dad897405aa92c682/addons/sale_stock/models/sale_order_line.py#L129 ## Solution It does not make sense to trigger replenishment for perishable products solely because they are expected to expire before the horizon date. Even when the available quantity already satisfies the maximum quantity defined on the reordering rule, the current logic forecasts those products as unavailable in advance of their expiration. Instead, products should only be excluded from the forecast once they have actually expired, or when they must be removed according to the original expiration-handling logic. To achieve this, an additional context key can be introduced to distinguish calls originating from the forecast availability widget from SO line. When the computation is performed for the forecast widget, the existing `to_date` context key should continue to be used so that availability is evaluated at the requested future date. For all other flows, including orderpoint calculations, the system should rely on the `with_expiration` context key instead. This preserves the original behavior, where only already-expired quantities (or quantities that must be removed due to expiration rules) are excluded from availability calculations, preventing incorrect replenishment recommendations for perishable products. opw-6200644 Forward-Port-Of: odoo/odoo#268223
This update fixes an issue where the number of comments on course slides wasn't accurately displayed. Previously, the system incorrectly counted messages due to changes in how the portal chatter system works. This change ensures the comment counts now reflect the actual number of active comments, improving the user experience.
Original PR description
Steps to reproduce: - Open a slide of a course in non fullscreen mode (website). - Go to the comments tab and add a comment in the chatter. - The comments count does not change in the tab. - The same thing happens when a comment is deleted. - Another way to see the incorrect counter is to add a note in the slide form view (backend). Before this change, `website_slides` used `website_message_ids` to calculate the comments. Since #138233 the old portal chatter has been replaced with the mail chatter and the way messages are displayed on the portal has changed. For example notes are no longer considered portal messages and also deleted messages should not be displayed or counted as such. This change ensures that comments calculations are based on a domain that considers those changes meaning that comments will be synced with the actual number of available comments. Forward-Port-Of: odoo/odoo#270800 Forward-Port-Of: odoo/odoo#260376
This update simplifies the process of applying Early Payment Discounts (EPD) to refund transactions. Previously, a technical issue prevented correct mapping of tax repartition lines, now fixed by ensuring the system correctly identifies invoice and refund types. This enhancement improves the reliability of EPD calculations for refunds.
Original PR description
This commit does not bring native support for EPD on credit notes, only makes custom support a little easier and cleaner. It is quite easy to support EPD (early payment discounts) on refunds by…
This commit does not bring native support for EPD on credit notes, only makes custom support a little easier and cleaner. It is quite easy to support EPD (early payment discounts) on refunds by extending - `_early_payment_discount_move_types` - `_is_eligible_for_early_payment_discount` However, this approach breaks when it reaches `inverse_tax_rep` in `_get_invoice_counterpart_amls_for_early_payment_discount_per_payment_term_line`, which assumes tax repartition lines with `document_type == 'invoice'` and raises when called on `tax_rep` lines of 'refund' type instead. This commit fixes that by selecting source and target repartition lines according to the `tax_rep`'s document type, which ensures: - the `.index()` no longer raises a `ValueError`, as `tax_rep` is now looked up in the matching set (`refund_` for refunds, `invoice_` otherwise) - `inverse_tax_rep` returns the corresponding line in the opposite set, preserving the original invoice->refund mapping while adding the refund->invoice one Since `inverse_tax_rep` is a closure, downstream modules cannot patch it without copying the whole ~170-line method. Making it symmetric here lets custom EPD-on-refund support work without that duplication. task-[6265601](https://www.odoo.com/odoo/all-tasks/6265601) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#271102
This update resolves a bug that previously caused errors when address fields were missing in payment authorization requests. Now, missing address fields are automatically set to empty strings, ensuring the system functions correctly and avoids disruptions to payment processing. This improves the reliability of the payment authorization module.
Original PR description
Fix bug introduced by commit https://github.com/odoo/odoo/pull/267592/changes/c4556637e8eeef07ce6e3cc3b3b4cf28fa10e468 that caused an error if an address field was not set, due to trying to cut a False field. Now, unset fields are set to empty strings. Forward-Port-Of: odoo/odoo#270295
This update fixes a bug in the stock valuation calculation that was incorrectly displaying product values. The fix ensures that values are accurately converted to the main company's currency (USD) when multiple companies and currencies are involved, resulting in correct stock valuation reports. This improves the accuracy of financial reporting across all company setups.
Original PR description
**Steps to reproduce:** - make sure your main company (company 1) has dollars as its main currency - create second company (company 2) and a warehouse in this second company - set euro has the main…
**Steps to reproduce:** - make sure your main company (company 1) has dollars as its main currency - create second company (company 2) and a warehouse in this second company - set euro has the main currency in the company 2 From company 1: - set an exchange rate of 1$ = 0.5 eur on the euro currency - create a storable product with a cost of 10$ and an on-hand quantity of 1 From company 2: - set the cost to 10 eur and set an on-hand quantity of 1 with both company selected and company 1 as the main company selected: - open the stock view and look for your product **Current behavior:** the total value is 20$ **Expected behavior:** with conversion rate, it should be 30$ **Cause of the issue:** when computing the total value we do not apply a conversion rate from the value of the company to the main company selected https://github.com/odoo/odoo/blob/8759429547e42e9f63b15a7c80475be46ef437e2/addons/stock_account/models/product.py#L273 opw-6280108 Forward-Port-Of: odoo/odoo#270575
This update fixes an issue where the table of contents would obscure headings when the status bar was sticky. The change ensures headings remain visible by intelligently accounting for sticky elements during scrolling within the table of contents, improving usability.
Original PR description
Since [1] when the `o_form_statusbar` status bar was made `sticky` the table of content scrolls to a given heading without taking it into account. Because of this, when scrolling upwards the heading ends up behind the status bar. This commit fixes this by finding top-aligned sticky elements within the closest scrollable element impacted by the table of content. Steps to reproduce: - Go to a To do note - Define some headings - Have sufficient content so that reaching a heading requires scrolling - Define a table of content with `/toc` - Click on a heading => The heading ended up behind the status bar. [1]: https://github.com/odoo/odoo/commit/a3c63413825cf3492a10ade77a2c571c4eeb33a6 task-6302762 Forward-Port-Of: odoo/odoo#270043
This update fixes an issue where the sandwich rule incorrectly excluded public holidays from leave calculations. Now, when 'Include Public Holidays as Working Day' is enabled, the system accurately determines leave duration, including weekend days that fall on holidays. A new test case ensures this fix functions as expected.
Original PR description
Problem: When a time off type is configured with "Include Public Holidays as Working Day", the sandwich rule was still treating public holidays as non-working days. This caused the sandwiched weekend days to not be included in the leave duration. Example: Employee applies leave from May 15 (Friday, Public Holiday) to May 18 (Monday). Expected duration is 4 days since May 15 is a working day and May 16-17 (weekend) should be sandwiched. Instead, only 1 day was calculated. Fix: Now when "Include Public Holidays as Working Day" is enabled, the correct number of days are calculated in the sandwich rule. Also added a test case to verify that public holidays are correctly treated as working days during sandwich rule evaluation. Task-4570118 Forward-Port-Of: odoo/odoo#270254 Forward-Port-Of: odoo/odoo#266624
This update resolves an issue related to how Odoo handles direct debit mandates for SEPA accounts. The change adds a constraint to ensure that direct debits are only processed through the correct partner bank, improving data accuracy and reducing potential errors. This enhances the reliability of our SEPA direct debit functionality.
Original PR description
Forward-Port-Of: odoo/enterprise#121023 Forward-Port-Of: odoo/enterprise#120901
This update resolves a bug where overtime was incorrectly generated when using Timing type rules with employer tolerances. The fix ensures that attendance limits are accurately considered during overtime calculations, preventing unnecessary overtime charges. This improves the accuracy of employee time tracking.
Original PR description
**Version:** - 19.0 **Steps to reproduce:** - Create a rule of Timing type. - Add a tolerance for the employer. - Set the ruleset on the employee. - Add an attendance of less than the tolerance. **Issue:** - When using a Timing type rule with employer tolerance, overtime is still created even if the attendance is below the tolerance limit. **Cause:** - The timing rule calculation was missing the tolerance check that exists in the quantity rule calculation. **Fix:** - Added the missing tolerance check in the timing rule calculation. - Removed employee tolerance from view for timing rules. **Task-6064081** Forward-Port-Of: odoo/odoo#257079
This update significantly reduces the memory used when loading large General Ledgers, primarily by optimizing how display names are retrieved. Previously, the system loaded excessive data, leading to slow performance. Now, a single fetch call ensures only the necessary display name information is loaded, resulting in a substantial performance boost.
Original PR description
### Issue Loading a large General Ledger (e.g., during an "Unfold All" action) and retrieving display names for thousands of journal lines (`account.move.line`) causes excessive memory and…
### Issue Loading a large General Ledger (e.g., during an "Unfold All" action) and retrieving display names for thousands of journal lines (`account.move.line`) causes excessive memory and performance overhead. Profiling with `memray` showed that one of the main memory hotspots was located in `custom_label_builder`. **Previous behavior:** Accessing `record.display_name` in a loop without an explicit `fetch()` call triggered lazy computation of the field via `_compute_display_name()`. When the compute method accessed stored dependency fields (such as `name`, `ref`, `move_id`), each cache miss went through `_fetch_field()`, which greedily loaded **all fields sharing the same prefetch group** on the model, far beyond the dependencies of `display_name` alone. This caused the ORM cache to be filled with many unnecessary stored fields for every record in the prefetch set. --- ### Dataset Volume The performance metrics were captured using a dataset consisting of: * **455,694** Journal Items (`account.move.line`) * **19,947** Journal Entries (`account.move`) --- ### Solution Add a single `fetch(['display_name'])` call on the browsed recordset. By calling `fetch(['display_name'])` upfront, the ORM goes through `_determine_fields_to_fetch(['display_name'])`, which walks only the declared `field_depends` of `display_name` and fetches **only those specific stored fields**. nothing more. --- ### Impact & Results | Metric | Before Optimization | After Optimization | Change / Note | | :--- | :--- | :--- | :--- | | **Peak Memory** | ~856 MB | ~223 MB | ~74% reduction | | **Execution Time** | 2.48s | 2.13s | About the same time with multiple tries | OPW-6275158 Forward-Port-Of: odoo/enterprise#121020
This update fixes an issue where invoices for returned dropshipped products incorrectly displayed both lots (lot1 and lot2) instead of just the returned lot (lot2). The fix ensures that the invoice accurately reflects the returned quantity, resolving a potential discrepancy in inventory tracking and reporting.
Original PR description
**Issue** Printing an invoice for a returned dropshipped tracked product could display the wrong lot/serial number on the invoice report. **Steps to reproduce** - Activate "Display Lots & Serial…
**Issue**
Printing an invoice for a returned dropshipped tracked product could display the wrong lot/serial number on the invoice report.
**Steps to reproduce**
- Activate "Display Lots & Serial Numbers on Invoices"
- Create a product tracked by serial/lot and enable the dropship route
- Create two lots: "lot1" and "lot2"
- Create and confirm a SO for quantity 2
- Confirm the PO and validate the dropship for both lots
- Create and post an invoice
- Return "lot2" from the dropship picking
- Create and post a credit note for quantity 1
- Click on print on the invoice
-> The generated PDF displays "lot1 & lot2" instead of "lot1"
**Cause**
While rendering `account.report_invoice_with_payments`, the report calls `_get_invoiced_lot_values` to determine which lot/serial numbers should be displayed:
https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L31-L32 `invoiced_qties = 2` since the invoice is on a quantity of 2 https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L44 Three stock move lines are retrieved from the SO:
- the two original dropship deliveries,
- the return move for `lot2`. https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L63 However, none of them are considered as `is_stock_return` because the dropship locations use `supplier` instead of `internal`: https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L72-L76 As a consequence:
- The two original delivery move lines each keep quantity `1`: https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L69 they never pass through the return handling logic (as they should be): https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L77-L80
- for the last one, `is_stock_return = False` while it should not, thus the quantity is 1 instead of 0. Furthermore, it does not pass by this code:
https://github.com/odoo/odoo/blob/8759429547e42e9f63b15a7c80475be46ef437e2/addons/sale_stock/models/account_move.py#L79 which would make the quantity for lot2 equalled to 0 (1-1) The quantities are therefore accumulated as:
https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L92
resulting in:
`qties_per_lot = {lot1: 1, lot2: 2}`
instead of:
`qties_per_lot = {lot1: 1, lot2: 0}`
The report selects both lots since it starts with lot1 (qty of 1): https://github.com/odoo/odoo/blob/786c373d5ac8afdfb79eb7a7d69c5eb83b919625/addons/sale_stock/models/account_move.py#L94-L99
opw-6236855
Forward-Port-Of: odoo/odoo#270599Documentation and clarification updates
This pull request formally records Adrien Didot's (Adridot) signature on the Odoo Individual Contributor License Agreement. Adding the associated documentation ensures compliance with Odoo's licensing terms. This update supports Adrien Didot's contribution to the Odoo project.
Original PR description
Individual Contributor License Agreement signature. Adds `doc/cla/individual/adridot.md` per the CLA signing instructions. Related contribution: #270196 Forward-Port-Of: odoo/odoo#270411 Forward-Port-Of: odoo/odoo#270197
3 changes
Resolved issues and error corrections
This update resolves a performance issue related to handling complex invoice cancellation scenarios in the Mexican accounting module. By using a specialized index, the system can now efficiently process invoices with many associated documents, improving overall processing speed and reliability. This change ensures smoother operations for users managing invoices with multiple related records.
Original PR description
The field `l10n_mx_edi_cfdi_origin` can contain a large number of associated UUIDs, especially in complex cancellation scenarios. The default B-tree index fails when this field exceeds 2704 bytes, which occurs after approximately 20 UUIDs. By switching to a trigram index, we avoid the entry size limit of PostgreSQL's B-tree nodes. This ensures that invoices with many related documents can be processed while maintaining efficient search performance for partial matches on this field. **Video before the fix:** https://youtu.be/24u0HbxwIH8 **Video after the fix:** https://youtu.be/sUelv1HZMvI Forward-Port-Of: odoo/enterprise#118868
This update resolves a problem where Italian fiscal printers would intermittently stop printing receipts due to unsupported characters in product or payment names. The fix replaces these characters with spaces, aligning with Epson's official printer documentation to ensure reliable receipt generation. This prevents lost sales and data discrepancies for Italian POS users.
Original PR description
Steps to reproduce: - Setup an Italian fiscal printer - Modify the name of a product to use the non-blocking space character "\ "; - In the POS, create an order with the product. Error: the fiscal device will stop midway in the printing process and return an incomplete response to the frontend. The issue can also be reproduce if the character is included in the payment method name or the POS config name. Solution: When formating the xml command, replace all non-supported character by a space character. The non-supported character list is provided by the official [EPSON fiscal printer documentation](https://support.epson.net/setupnavi/?PINF=bsmanual&OSC=WS&LG2=EN&MKN=FP-90III%20RT) in the document "ePOS Fiscal Print Solution Development Guide". Other: Rename the file "dispaly_text.xml" to "display_text.xml". [opw-6244089](https://www.odoo.com/odoo/project/49/tasks/6244089) Forward-Port-Of: odoo/enterprise#120169
This update resolves an issue where international UPS shipments were failing due to incorrect commercial invoice address information. The fix initially used the delivery address, but this caused further problems. Now, the system defaults to the delivery address if country codes don't match, with a warning displayed to the user to ensure accurate invoice details.
Original PR description
Issue ----- When making an international delivery to a partner with different invoice and delivery addresses, we send the delivery address as the `Sold To` address as well. Problematic case 1 ----- -…
Issue ----- When making an international delivery to a partner with different invoice and delivery addresses, we send the delivery address as the `Sold To` address as well. Problematic case 1 ----- - Create a belgian company - Setup UPS - Create a French customer - Add a different french delivery address - Create a product (with some weight) - Create a SO (with UPS delivery) to the customer & confirm - Validate the transfer > Commercial invoice `Sold To` uses the delivery address Solution for case 1 ----- Use the delivery address' `commercial_partner_id`. This leads to another issue in some edge cases... Problematic case 2 (caused by case 1 fix) ----- - Create a belgian company - Setup UPS - Create a French customer - Add a delivery address in Switzerland - Create a product (with some weight) - Create a SO (with UPS delivery) to the customer & confirm - Validate the transfer > UPS error `The Sold To party's country code must be the same as the Ship To party's country code with the exception of Canada and satellite countries.` Solution for case 2 ----- Default back to delivery address for the `Sold To` field when countries don't match, as this is a limitation of the UPS API. Warn the user, either on the SO or the transfer itself (if no SO). Warning looks like this (on SO): <img width="1914" height="716" alt="image" src="https://github.com/user-attachments/assets/f7aa73c4-f24c-42da-8f3e-6a58765ef020" /> ----- Ticket: opw-6200263 Forward-Port-Of: odoo/enterprise#120592 Forward-Port-Of: odoo/enterprise#118031
12 changes
Resolved issues and error corrections
This update resolves a technical issue impacting how Odoo handles Mexican tax invoices (CFDI). The system was struggling to process invoices with many related documents due to a database index limitation. Switching to a different index type ensures smoother processing and improved performance for complex cancellation scenarios.
Original PR description
The field `l10n_mx_edi_cfdi_origin` can contain a large number of associated UUIDs, especially in complex cancellation scenarios. The default B-tree index fails when this field exceeds 2704 bytes, which occurs after approximately 20 UUIDs. By switching to a trigram index, we avoid the entry size limit of PostgreSQL's B-tree nodes. This ensures that invoices with many related documents can be processed while maintaining efficient search performance for partial matches on this field. **Video before the fix:** https://youtu.be/24u0HbxwIH8 **Video after the fix:** https://youtu.be/sUelv1HZMvI Forward-Port-Of: odoo/enterprise#118868
This update resolves an issue where the XML generated for Polish e-invoices (FA3) with reverse charge taxes was incorrectly formatted. Specifically, the XML fields related to reverse charge were not accurately reflected, leading to potential errors in tax reporting. This fix ensures accurate data transmission to the KSEF system.
Original PR description
**STEP TO REPRODUCE** 1. Create an invoice with a tax with reverse charge (0% EU G for example). 2. Send the invoice to ksef. 3. Open the generated xml, and notice field P_18 is 2 while it should be 1 (because there is reverse charge). Also, there is not P13_10 indicated the total value of sale to which the reverse charge applies. opw-6041836 Forward-Port-Of: odoo/odoo#263764
This update resolves a critical issue where paying with an Adyen terminal could cause the POS system to crash due to duplicate notifications from Adyen. The fix ensures that the system only processes each payment line once, preventing errors and improving payment reliability.
Original PR description
The following error is raised in the POS when paying with an Adyen terminal: ``` TypeError: Cannot read properties of undefined (reading 'uuid') at Proxy.handleAdyenStatusResponse ``` Adyen delivers…
The following error is raised in the POS when paying with an Adyen terminal: ``` TypeError: Cannot read properties of undefined (reading 'uuid') at Proxy.handleAdyenStatusResponse ``` Adyen delivers webhook notifications at-least-once, so the ADYEN_LATEST_RESPONSE event can fire several times for a single payment, running handleAdyenStatusResponse concurrently. After the await on get_latest_adyen_status, a previous (duplicate) notification may already have resolved the payment line, so getPendingPaymentLine no longer returns it and the subsequent line.uuid dereference crashes. opw-6237987 patched the same root cause on a single line by adding an optional chaining operator in isPaymentSuccessful, which only moved the crash to the next dereference. Fetch the pending line once at the start of handleAdyenStatusResponse and bail out when it is gone, so every dereference below is safe. The same guard is added to the remaining branches of _adyen_handle_response for consistency with the existing Reject branch. opw-6237987 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#270880 Forward-Port-Of: odoo/odoo#269720
This update corrects an issue where emojis, particularly complex ones like `👨🚒`, were being displayed incorrectly due to how they were encoded. The fix backports a more robust regex pattern from a recent version of Odoo that properly handles these variations in emoji formatting, ensuring emojis are displayed correctly.
Original PR description
Bug === Some emoji like `👨🚒` are separated, because they are built using `👨 + Emoji_Modifier + 🚒` (`\uFE0F` can also be used to get the variant of the emoji). Adapt the regex to take into account those Unicode variations. Task-5491124 Forward-Port-Of: odoo/odoo#270779 Forward-Port-Of: odoo/odoo#269719
This update resolves an issue where international UPS shipments were failing due to incorrect commercial invoice addresses. The fix initially used the delivery address, but this caused further problems. Now, the system defaults back to the delivery address if country codes don't match, with a warning displayed to the user to ensure accurate invoice information.
Original PR description
Issue ----- When making an international delivery to a partner with different invoice and delivery addresses, we send the delivery address as the `Sold To` address as well. Problematic case 1 ----- -…
Issue ----- When making an international delivery to a partner with different invoice and delivery addresses, we send the delivery address as the `Sold To` address as well. Problematic case 1 ----- - Create a belgian company - Setup UPS - Create a French customer - Add a different french delivery address - Create a product (with some weight) - Create a SO (with UPS delivery) to the customer & confirm - Validate the transfer > Commercial invoice `Sold To` uses the delivery address Solution for case 1 ----- Use the delivery address' `commercial_partner_id`. This leads to another issue in some edge cases... Problematic case 2 (caused by case 1 fix) ----- - Create a belgian company - Setup UPS - Create a French customer - Add a delivery address in Switzerland - Create a product (with some weight) - Create a SO (with UPS delivery) to the customer & confirm - Validate the transfer > UPS error `The Sold To party's country code must be the same as the Ship To party's country code with the exception of Canada and satellite countries.` Solution for case 2 ----- Default back to delivery address for the `Sold To` field when countries don't match, as this is a limitation of the UPS API. Warn the user, either on the SO or the transfer itself (if no SO). Warning looks like this (on SO): <img width="1914" height="716" alt="image" src="https://github.com/user-attachments/assets/f7aa73c4-f24c-42da-8f3e-6a58765ef020" /> ----- Ticket: opw-6200263 Forward-Port-Of: odoo/enterprise#119747 Forward-Port-Of: odoo/enterprise#118031
This update resolves a bug that previously prevented the system from correctly calculating bill addresses when address fields were empty. The fix ensures that empty address fields are now handled gracefully, preventing errors and improving the reliability of payment authorization processes. This change ensures accurate billing information is consistently processed.
Original PR description
Fix bug introduced by commit https://github.com/odoo/odoo/pull/267592/changes/c4556637e8eeef07ce6e3cc3b3b4cf28fa10e468 that caused an error if an address field was not set, due to trying to cut a False field. Now, unset fields are set to empty strings. Forward-Port-Of: odoo/odoo#270295
This update resolves a problem where Italian fiscal printers would intermittently stop printing receipts due to unsupported characters in product or payment method names. The fix replaces these characters with spaces, aligning with Epson's official documentation to ensure proper receipt generation. This prevents lost sales and data discrepancies.
Original PR description
Steps to reproduce: - Setup an Italian fiscal printer - Modify the name of a product to use the non-blocking space character "\ "; - In the POS, create an order with the product. Error: the fiscal device will stop midway in the printing process and return an incomplete response to the frontend. The issue can also be reproduce if the character is included in the payment method name or the POS config name. Solution: When formating the xml command, replace all non-supported character by a space character. The non-supported character list is provided by the official [EPSON fiscal printer documentation](https://support.epson.net/setupnavi/?PINF=bsmanual&OSC=WS&LG2=EN&MKN=FP-90III%20RT) in the document "ePOS Fiscal Print Solution Development Guide". Other: Rename the file "dispaly_text.xml" to "display_text.xml". [opw-6244089](https://www.odoo.com/odoo/project/49/tasks/6244089) Forward-Port-Of: odoo/enterprise#120169
This update resolves an issue where the table of contents would obscure headings when the status bar was made sticky. The fix ensures headings remain visible by intelligently accounting for sticky elements during scrolling within the table of contents, improving usability.
Original PR description
Since [1] when the `o_form_statusbar` status bar was made `sticky` the table of content scrolls to a given heading without taking it into account. Because of this, when scrolling upwards the heading ends up behind the status bar. This commit fixes this by finding top-aligned sticky elements within the closest scrollable element impacted by the table of content. Steps to reproduce: - Go to a To do note - Define some headings - Have sufficient content so that reaching a heading requires scrolling - Define a table of content with `/toc` - Click on a heading => The heading ended up behind the status bar. [1]: https://github.com/odoo/odoo/commit/a3c63413825cf3492a10ade77a2c571c4eeb33a6 task-6302762 Forward-Port-Of: odoo/odoo#270043
This update removes a redundant step in a test related to bank account matching. Previously, the test required manually unlinking a bank account to prevent incorrect partner identification. Now that the system correctly identifies partners using VAT numbers, this step is no longer needed, streamlining the testing process.
Original PR description
Since `saas-18.3`, the partner is correctly found using the VAT number, so the test no longer needs to remove `partner_1`'s bank account to avoid a wrong match. Remove the unnecessary `self.partner_1.bank_ids.unlink()` from `test_xml_ubl_au.py`.
This update resolves a technical issue that caused the restaurant order tour to fail intermittently. The fix ensures the system waits for order processing to complete before proceeding, preventing duplicate requests and improving the reliability of the tour. This enhances the user experience for restaurant order setup.
Original PR description
The tour could fail because `sendOrderInPreparationUpdateLastChange` is asynchronous when sending the order to the kitchen. The test was continuing to the next steps before the request was fully resolved, which could lead to sending the order again while the previous call was still in progress. This commit updates the tour to explicitly wait for the async call to complete before continuing, by adding a delay step after clicking the order button. This prevents race conditions during the test. --- Runbot Error: https://runbot.odoo.com/odoo/runbot.build.error/181846 Forward-Port-Of: odoo/enterprise#120910 Forward-Port-Of: odoo/enterprise#110909
This update fixes an issue where CFDI payment documents incorrectly displayed rates when payments were made in foreign currencies (like USD). The fix ensures the correct payment amount and exchange rate are used, accurately reflecting transactions for Mexican tax reporting. This improves the reliability of our CFDI generation process.
Original PR description
The rate and payment amount shown on the CFDI document generated after updating payments was wrong when the payment was made in a foreign currency. Steps to reproduce: ------------------- * Create a journal that use USD as currency and set the rate to 20 MXN for 1 USD * Create an invoice in MXN and make sure it is set to PPD * Add any product to the invoice for 300$ and post it * Send the invoice to CFDI (a first document should be generated) * Create a payment of 15 USD in the new journal and reconcile it with the invoice * Go back to the invoice and click on "Update payments" to generate the second CFDI document > Observation: The payment document shows an amount of 300 USD with a rate of 1 instead of 15 USD with a rate of 20. Why the fix: ------------ We make sure to use the amount from the statement line when there is one. opw-5974519 Forward-Port-Of: odoo/enterprise#115779
Documentation and clarification updates
This pull request formally records Adrien Didot's signature on the Odoo Individual Contributor License Agreement. It adds documentation confirming the CLA signing, ensuring compliance with Odoo's licensing terms. This update is a standard legal step for contributions to the Odoo project.
Original PR description
Individual Contributor License Agreement signature. Adds `doc/cla/individual/adridot.md` per the CLA signing instructions. Related contribution: #270196 Forward-Port-Of: odoo/odoo#270411 Forward-Port-Of: odoo/odoo#270197
6 changes
Resolved issues and error corrections
This update resolves an issue that prevented efficient processing of invoices with numerous related documents (specifically, those related to Mexican tax filings). By using a different database index, the system can now handle complex cancellation scenarios and maintain fast search performance for finding invoices. This ensures smoother operations for our Mexican customers.
Original PR description
The field `l10n_mx_edi_cfdi_origin` can contain a large number of associated UUIDs, especially in complex cancellation scenarios. The default B-tree index fails when this field exceeds 2704 bytes, which occurs after approximately 20 UUIDs. By switching to a trigram index, we avoid the entry size limit of PostgreSQL's B-tree nodes. This ensures that invoices with many related documents can be processed while maintaining efficient search performance for partial matches on this field. **Video before the fix:** https://youtu.be/24u0HbxwIH8 **Video after the fix:** https://youtu.be/sUelv1HZMvI Forward-Port-Of: odoo/enterprise#118868
This update corrects a display issue in the list autofill feature of the Enterprise edition. Previously, a loading error was shown in tooltips when lists weren't immediately ready. Now, tooltips display the correct information, ensuring a smoother user experience when lists are loading.
Original PR description
The getter `getTooltipListFormula` would return the result of `getListHeaderValue` as the content of the tooltip, but this returned a loading error instead of a string if the list was not ready yet. Task: [6289944](https://www.odoo.com/web#id=6289944&cids=1&menu_id=4720&action=333&active_id=2328&model=project.task&view_type=form) Forward-Port-Of: odoo/enterprise#119876
This update resolves a problem where Italian fiscal printers would intermittently stop printing POS orders due to unsupported characters in product or payment method names. The fix replaces these characters with spaces, aligning with Epson's official printer documentation to ensure reliable printing functionality. This prevents order data loss and improves the POS experience for Italian users.
Original PR description
Steps to reproduce: - Setup an Italian fiscal printer - Modify the name of a product to use the non-blocking space character "\ "; - In the POS, create an order with the product. Error: the fiscal device will stop midway in the printing process and return an incomplete response to the frontend. The issue can also be reproduce if the character is included in the payment method name or the POS config name. Solution: When formating the xml command, replace all non-supported character by a space character. The non-supported character list is provided by the official [EPSON fiscal printer documentation](https://support.epson.net/setupnavi/?PINF=bsmanual&OSC=WS&LG2=EN&MKN=FP-90III%20RT) in the document "ePOS Fiscal Print Solution Development Guide". Other: Rename the file "dispaly_text.xml" to "display_text.xml". [opw-6244089](https://www.odoo.com/odoo/project/49/tasks/6244089) Forward-Port-Of: odoo/enterprise#120169
This update resolves an issue where international UPS shipments were failing due to incorrect commercial invoice address information. The fix now uses the delivery address for the invoice, but a fallback mechanism is implemented when countries don't match, with a user warning to ensure compliance with UPS API requirements. This ensures accurate shipments and avoids delivery delays.
Original PR description
Issue ----- When making an international delivery to a partner with different invoice and delivery addresses, we send the delivery address as the `Sold To` address as well. Problematic case 1 ----- -…
Issue ----- When making an international delivery to a partner with different invoice and delivery addresses, we send the delivery address as the `Sold To` address as well. Problematic case 1 ----- - Create a belgian company - Setup UPS - Create a French customer - Add a different french delivery address - Create a product (with some weight) - Create a SO (with UPS delivery) to the customer & confirm - Validate the transfer > Commercial invoice `Sold To` uses the delivery address Solution for case 1 ----- Use the delivery address' `commercial_partner_id`. This leads to another issue in some edge cases... Problematic case 2 (caused by case 1 fix) ----- - Create a belgian company - Setup UPS - Create a French customer - Add a delivery address in Switzerland - Create a product (with some weight) - Create a SO (with UPS delivery) to the customer & confirm - Validate the transfer > UPS error `The Sold To party's country code must be the same as the Ship To party's country code with the exception of Canada and satellite countries.` Solution for case 2 ----- Default back to delivery address for the `Sold To` field when countries don't match, as this is a limitation of the UPS API. Warn the user, either on the SO or the transfer itself (if no SO). Warning looks like this (on SO): <img width="1914" height="716" alt="image" src="https://github.com/user-attachments/assets/f7aa73c4-f24c-42da-8f3e-6a58765ef020" /> ----- Ticket: opw-6200263 Forward-Port-Of: odoo/enterprise#119747 Forward-Port-Of: odoo/enterprise#118031
This update resolves an issue where payslips weren't correctly identifying employees registered within branch companies. The fix adjusts the system's search criteria to include all child companies in the hierarchy, ensuring accurate payslip generation for all employees across the Odoo Enterprise system.
Original PR description
Bug: employees registered on branch companies don't appear in the
employee_id field when creating a payslip from the parent company.
Reason: the domain used ('company_id', '=', company_id) which only
matches the exact company, not its children.
Solution: replaced '=' with 'child_of' to include all descendant
companies in the hierarchy.
task - 6299634
Forward-Port-Of: odoo/enterprise#120974This update fixes an error in the CFDI (Mexican electronic invoice) generation process. Previously, when payments were made in foreign currencies (like USD), the CFDI documents incorrectly displayed the exchange rate. The fix ensures the correct payment amount and rate are reflected in the generated CFDI documents, improving accuracy for Mexican tax reporting.
Original PR description
The rate and payment amount shown on the CFDI document generated after updating payments was wrong when the payment was made in a foreign currency. Steps to reproduce: ------------------- * Create a journal that use USD as currency and set the rate to 20 MXN for 1 USD * Create an invoice in MXN and make sure it is set to PPD * Add any product to the invoice for 300$ and post it * Send the invoice to CFDI (a first document should be generated) * Create a payment of 15 USD in the new journal and reconcile it with the invoice * Go back to the invoice and click on "Update payments" to generate the second CFDI document > Observation: The payment document shows an amount of 300 USD with a rate of 1 instead of 15 USD with a rate of 20. Why the fix: ------------ We make sure to use the amount from the statement line when there is one. opw-5974519 Forward-Port-Of: odoo/enterprise#115779
8 changes
Enhancements to existing features
This update adds necessary fields to the payment process for Saltedge, enabling seamless payment initiation. The changes were made to ensure compatibility with Saltedge's requirements. The update will be applied across all Odoo Enterprise versions.
Original PR description
In order to be able to initiate payments using Saltedge we need to include a couple more fields in our payload. This commit adds them. This PR is in master to ease testing but will be backported to 18.0 to cover all versions of the payment initiation flow. Task ID: 6095729
This update enhances the safety of product template merging by preventing the automatic merging of complex templates with variant configurations. Previously, this could lead to unexpected product behavior. Now, only simple, single-variant templates can be merged directly, ensuring more reliable and predictable product management.
Original PR description
Before product template merge could try to merge templates with variant configuration this could lead to unsupported or confusing product behavior there was no clear check for only simple templates After added a merge guard for product templates only plain single variant templates can be merged directly configurable or multi variant templates now stop with a clear message Impact safer product merge behavior prevents incorrect merges on configured products keeps de-duplication limited to the simplest valid cases task id - 5928499
Resolved issues and error corrections
This update resolves an issue where new tasks created through Timesheets Assistant rules were incorrectly set as private. The fix ensures that tasks are always associated with the selected project, improving workflow and data organization within the Timesheets module. This prevents confusion and ensures accurate task tracking.
Original PR description
Steps to reproduce: - Install Timesheets and enable Timesheets Assistant. - Go to Timesheets -> Configuration -> Assistant Rules. - Open an existing rule or create a new one. - Select a Project and enter a new Task name. Issue 1: - Click Create. - The task is created as a private task, and the project is cleared. Issue 2: - Click Create and Edit. - Remove the project and save. - The task is saved as a private task. Cause: - When using Create, the `default_project_id` from the context is not applied, so the task is created as a private task. - When using Create and Edit, users can remove the prefilled project before saving, which also results in a private task. Fix: - Pass `default_project_id` and `form_view_ref='project.view_task_form_res_partner'` in the context. This prefills the project and makes it required when creating a task. task-6293306 Forward-Port-Of: odoo/enterprise#121188 Forward-Port-Of: odoo/enterprise#120862
This update fixes a previous limitation where users couldn't properly set prices for hybrid subscription products (those allowing one-time sales). Now, the system requires a plan to be selected for subscription products and correctly filters pricelist items to support one-time pricing for hybrid subscriptions, ensuring accurate and flexible pricing options.
Original PR description
Before this commit:
1. Users could save a pricelist rule for a pure subscription product without assigning a plan.
2. Hybrid subscription products (where 'Allow One-Time Sale' is True) were filtered out of the pricelist item form when no plan was selected, preventing users from setting a one-time price.
After this commit:
- The `plan_id` field on the product template form is now mandatory if the product is a subscription and does not allow one-time sales.
- The `product_tmpl_id` domain on the pricelist item form is updated to `['|', ('recurring_invoice', '=', bool(plan_id)), ('allow_one_time_sale', '=', True)]`, allowing users to select hybrid products for one-time pricing.
task: 6164232
Forward-Port-Of: odoo/enterprise#120323
Forward-Port-Of: odoo/enterprise#115271This update allows for more flexible scheduling by introducing 'duration-based' calendars for resources. Previously, resources were limited to strict time slots or fully flexible arrangements. Now, resources can have a mix of fixed and flexible days, ensuring better resource allocation and utilization while maintaining capacity limits.
Original PR description
Currently, resources are either entirely strict (bound by fixed start/end intervals) or entirely flexible. There is no native way to support a hybrid calendar where an employee has specific days that…
Currently, resources are either entirely strict (bound by fixed start/end intervals) or entirely flexible. There is no native way to support a hybrid calendar where an employee has specific days that are flexible (duration-based) and other days that are strict. This commit introduces "duration-based" scheduling, allowing the system to bypass strict time intersections on specifically flagged days while maintaining a strict capacity cap. Changes include: - `resource.resource`: Added `_is_duration_based(start_dt, end_dt)` helper to dynamically identify if a resource has flexible attendance within a specific date range or single day. - `planning.slot`: - `auto_plan_ids`: Expanded the bulk interval fetch for hybrid resources to prevent the core HR module from clipping flexible days, and implemented a day-by-day intersection bypass inside the `find_resource` allocation loop. - `_get_working_hours_over_period`: Intercepted manual shift calculations. If a shift falls on a duration-based day, it bypasses the strict `work_intervals` overlap and assigns the literal shift duration (safely capped at the employee's daily capacity). Timezone-aware date conversions ensure accuracy. - `_gantt_unavailability`: Filtered out grey unavailability blocks on duration-based days so the Gantt chart accurately reflects flexible placement. Task-ID: 6285642
This update ensures that cancelled and no-show appointment bookings now correctly appear as 'free' in the calendar, rather than 'busy'. Previously, the calendar incorrectly marked these bookings as occupied. This change improves the accuracy of appointment scheduling and reduces confusion for users.
Original PR description
When an appointment booking status is changed to `cancelled` or `no_show`, the calendar event could remain marked as `busy`. This commit updates the appointment event synchronization so `show_as` is set to `free` for cancelled and no-show bookings, and restored to `busy` when the booking goes back to an active appointment state. task-6108930
This update corrects a technical issue where the wage types menu domain wasn't updated after changes to payroll rules. This ensures the menu accurately reflects the new capabilities of wage types, allowing for correct payroll calculations. It's a minor fix to maintain payroll accuracy.
Original PR description
After the change to rules that allowed them to be used in multiple structures, the domain for the wage types menu was not updated. This commit fixes it.
Code cleanup and technical improvements
This update ensures that references to the fragment query string functionality are accurate as it's being reorganized within Odoo. This change is part of a larger effort to improve the internal structure of the code and maintain consistency across modules. It ensures the social media integrations continue to function correctly.
Original PR description
The aim of this commit is to keep referencing fragment_to_query_string correctly as it is moved into `http.py`. task-id: 6071808 Forward-Port-Of: odoo/enterprise#121195 Forward-Port-Of: odoo/enterprise#121019
1 change
Resolved issues and error corrections
This update resolves an issue where DIAN XML files were being rejected due to incorrect calculations of prepaid payments. The fix combines payment amounts into a single tag, ensuring accurate totals and preventing negative payment lines that triggered errors with the DIAN API. This ensures proper reporting and compliance for Colombian Point of Sale transactions.
Original PR description
**Steps to reproduce:** To test this, you will need an official DIAN setup, because this error comes from the response to our API call to the DIAN. - Setup the DIAN in a colombian company - Open the…
**Steps to reproduce:** To test this, you will need an official DIAN setup, because this error comes from the response to our API call to the DIAN. - Setup the DIAN in a colombian company - Open the PoS - Order a product - Before paying, make the amount we are paying bigger than the amount due - We get an error response from the API, the error is saying that the total due does not match what we paid **Why the fix:** Currently, the xml is rejected because the sum of the **PaidAmount** in the **PrepaidPayment** tag is not equal to what we are trying to pay for. This is happening because to avoid the fact that we can not send a line with negative amount, we used the **abs()** function on the line amount to make it positive. The negative line comes from the fact that when we have a total due that is below the amount paid, we create a new payment line with a negative amount to balance it out. But as we can't send lines with negative amount, we needed to make it positive. This does not work, as the sum of the lines' amount will then be too much compared to what we are paying for, because instead of substracting it we will be adding it. To avoid this, we now group the amount in one single tag and send it this way. This ensures that the sent amount is correct and equals the amount due, and does not send a negative line. opw-6232575 Forward-Port-Of: odoo/enterprise#121075 Forward-Port-Of: odoo/enterprise#119255
9 changes
New functionality added to Odoo
This update adds missing translations for various user-visible messages within the Odoo POS modules. This ensures the POS system is correctly localized for different languages, improving the user experience and supporting international expansion. The changes cover dialogs, errors, and other UI elements.
Original PR description
pos* = All POS module In this commit: -------------------------------- Add missing translations for user-visible strings across POS modules. - Translated dialogs, errors, alerts, and other UI-visible messages - Updated Python-side UserError, ValidationError, and warning messages Task-5406947 Related PR-https://github.com/odoo/odoo/pull/239972
Resolved issues and error corrections
This update resolves an issue where E-Way Bill amounts were incorrectly calculated when sales orders used tax-included prices. The fix ensures that tax is properly accounted for, leading to accurate E-Way Bill generation for sales and purchase orders with tax-included pricing. This improves compliance and reporting accuracy.
Original PR description
`*` = `ewaybill_Stock, sale_stock, purchase_stock` **Steps to reproduce:** * Install `l10n_in_ewabill_stock` and `l10n_in_sale_Stock`. * Set the Default Tax Price Setting to "Tax Included". * Create…
`*` = `ewaybill_Stock, sale_stock, purchase_stock` **Steps to reproduce:** * Install `l10n_in_ewabill_stock` and `l10n_in_sale_Stock`. * Set the Default Tax Price Setting to "Tax Included". * Create a Sales Order (e.g. unit price 300, qty 600, 18% GST) and confirm the Delivery Challan/Delivery Order. * Generate an E-Way Bill from the Delivery Challan. **Observed behavior:** * The Taxable Amount and Total Invoice Amount are displayed incorrectly in the generated E-Way Bill, including both the printed document and the JSON. * The `ewaybill_price_unit` shows the tax-excluded price (e.g. 254.24) instead of the original tax-included price (300), leading to a double tax exclusion when `compute_all` processes it. **Cause:** * `_l10n_in_get_product_price_unit` in both `l10n_in_sale_stock` and `l10n_in_purchase_stock` unconditionally used `price_subtotal / qty` to compute the E-Way Bill price unit. `price_subtotal` is always tax-excluded, so for tax-included prices, the tax was already stripped. * `_l10n_in_tax_details_by_stock_move` then passed this already tax-excluded price to `compute_all` with taxes that have `price_include=True`, causing `compute_all` to strip the tax a second time (e.g. 254.24 / 1.18 = 215.46 instead of the correct 254.24). **Fix:** * Check whether any of the line's taxes have `price_include` set. If so, use `price_total / qty` (which preserves the tax-included price) so that `compute_all` can correctly extract the tax. Otherwise, continue using `price_subtotal / qty` as before. opw-6273101 Forward-Port-Of: odoo/odoo#268504
This update resolves a crash that occurred when users attempted to view Instagram videos within Odoo. The fix now displays the video link instead of the image, ensuring a smooth user experience. This prevents the previewer from crashing when encountering a real Instagram video.
Original PR description
Purpose ======= When we have a real on Instagram, we try to show the video as an image. When clicking on the broken image, the previewer crash. To fix that issue, we know show the link of the video in the message. Task-5491124 Forward-Port-Of: odoo/enterprise#113487
This update resolves a bug that previously prevented the system from correctly calculating bill addresses when address fields were empty. Now, empty address fields are automatically set to empty strings, ensuring accurate billing information is processed. This improves the reliability of payment authorization transactions.
Original PR description
Fix bug introduced by commit https://github.com/odoo/odoo/pull/267592/changes/c4556637e8eeef07ce6e3cc3b3b4cf28fa10e468 that caused an error if an address field was not set, due to trying to cut a False field. Now, unset fields are set to empty strings. Forward-Port-Of: odoo/odoo#270295
This update fixes an issue where flexible employees couldn't request single-day leave on public holidays. The change ensures that a single-day request on a public holiday is correctly processed as 1 day, aligning with multi-day leave behavior. This improves the flexibility and usability of the HR holiday request system.
Original PR description
Currently, flexible employees can request a multi-day leave spanning a public holiday when the leave type includes public holidays in duration. However, requesting the public holiday date alone is…
Currently, flexible employees can request a multi-day leave spanning a public holiday when the leave type includes public holidays in duration. However, requesting the public holiday date alone is rejected. ### **Steps to reproduce:** - Create a public holiday. - Create a time off type with "Public Holiday Included" enabled. - Select/create an employee with a flexible work schedule and its time zone must be same as admin. - Request a time off on the public holiday date only. ### **Observed Behavior:** The request is rejected because its duration is computed as 0 days. ### **Expected Behavior:** The request should be allowed and count as 1 day, consistent with the multi-day request behavior. ### **Root Cause:** At [1], a dedicated duration computation path is used for single-day leaves of flexible employees. This logic always retrieves overlapping public holidays and computes the leave duration based on the remaining intervals. As a result, a leave requested entirely on a public holiday is computed as 0 days, even when `include_public_holidays_in_duration` is enabled. [1]- https://github.com/odoo/odoo/blob/242f6d3cf7288853f163ac6986a3b7aa4279efaf/addons/hr_holidays/models/hr_leave.py#L436-L444 ### **Fix:** This commit ensures that the `include_public_holidays_in_duration` setting is taken into account when computing single-day leave durations for flexible employees **opw-6284768**
This update corrects a bug where the invoice status cron job only processed invoices for the primary company in an Odoo setup. Now, it correctly retrieves and updates the status of invoices across all companies within the Odoo environment, ensuring accurate reporting and compliance.
Original PR description
The invoice status cron was only fetching the main company's invoices. Fetch all companies' invoice statuses. Reference: https://github.com/odoo/odoo/pull/267144#discussion_r3441968099 no-task
This update fixes an issue where payslips weren't generating correctly for employees registered within branch companies of a larger organization. The fix ensures that all employees within a company's branch network are properly included when creating payslips, improving payroll accuracy and reporting.
Original PR description
Bug: employees registered on branch companies don't appear in the
employee_id field when creating a payslip from the parent company.
Reason: the domain used ('company_id', '=', company_id) which only
matches the exact company, not its children.
Solution: replaced '=' with 'child_of' to include all descendant
companies in the hierarchy.
task - 6299634
Forward-Port-Of: odoo/enterprise#120974This update replaces the Tenor GIF API key with a Klipy GIF API key to ensure continued functionality of the GIF sharing feature within Odoo. The Tenor API is scheduled to end on June 30, 2026, necessitating this change to avoid disruptions to GIF usage. Users should note that updating the API key is required for the GIF feature to remain operational.
Original PR description
Tenor API will be terminated on June 30, 2026: https://developers.google.com/tenor/guides/quickstart This commit makes the Tenor API key input settings use a Klipy GIF API key instead of a Tenor GIF API key. To keep GIF working after this commit, the API key must necessarily be changed to a Klipy GIF API key, as the old Tenor API key would be considered as an invalid Klipy API key. Task-5491965 Upgrade: https://github.com/odoo/upgrade/pull/10516 Forward-Port-Of: odoo/odoo#250113
This update corrects an issue where a purchase order was being created twice when fulfilling a sale order with a 'ship later' option. The fix prevents a second procurement creation, ensuring accurate order quantities and streamlining the fulfillment process. Users should now see the correct purchase order quantity after fulfilling the sale order.
Original PR description
Step to reproduce: - install purchase, pos_sale - from setting enable mto route and ship later feature for pos - from routes, unarchive mto route - create a product, add mto and buy route, add a…
Step to reproduce: - install purchase, pos_sale - from setting enable mto route and ship later feature for pos - from routes, unarchive mto route - create a product, add mto and buy route, add a vendor - create a SO with that product, qty = 5 - open that quotation in pos and fulfill the order, set ship later date - go to backend and open purchase Observation: - purchase qty is 10 Cause: - the procurement for the order is created 2 times - once from `_launch_stock_rule_from_pos_order_lines` https://github.com/odoo/odoo/blob/0b17840fb3cc72935e1a6302a057fb55c253c498/addons/point_of_sale/models/pos_order.py#L1185-L1191 - again from `_action_launch_stock_rule` https://github.com/odoo/odoo/blob/0b17840fb3cc72935e1a6302a057fb55c253c498/addons/sale_stock/models/sale_order.py#L180-L182 - later as vendor is same, both procurements are merged and PO quantity is updated to 10 Fix: - we skip the procurement trgger from `_action_launch_stock_rule` when confirming the sale order Note: After this fix, SO will not have a PO linked to it, as the SO is now transfered to pos, we have to go to pos and fulfill the delivery there. opw-6259660 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
4 changes
Resolved issues and error corrections
This update resolves a bug that previously prevented the system from correctly calculating bill addresses when address fields were empty. The fix now sets empty address fields to empty strings, ensuring accurate billing information is processed. This improves the reliability of payment authorization transactions.
Original PR description
Fix bug introduced by commit https://github.com/odoo/odoo/pull/267592/changes/c4556637e8eeef07ce6e3cc3b3b4cf28fa10e468 that caused an error if an address field was not set, due to trying to cut a False field. Now, unset fields are set to empty strings. Forward-Port-Of: odoo/odoo#270295
This update corrects a technical issue where the average product review star rating was incorrectly displayed as an H1 element. The change now uses a more appropriate span tag with styling, ensuring better website accessibility and a cleaner design. This improves the overall user experience on product pages.
Original PR description
Problem: The average number of stars in the review on product pages is shown as an h1. This is not sementically valid. Solution: Use a span and apply an h1-like style. Task-6185328 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update ensures Odoo generates PDF invoices that fully comply with ZUGFeRD standards, a crucial requirement for electronic invoice processing. Specifically, it adds a necessary tag to the PDF file to accurately link the visual invoice with its underlying XML data, addressing a technical specification update. This ensures proper integration with Factur-X and supports future ZUGFeRD versions.
Original PR description
Adapt `add_attachment` to allow setting the "AFRelationship" tag on the PDF filespec object, In compliance with Factur-X/ZUGFeRD specs that require the AFRelationship tag in the PDF filespec object to reflect the relationship between the embedded XML and the visual PDF content: - /Data: the visual PDF contains more invoicing data than the XML. - /Alternative: the XML and the PDF are two equivalent representations of the same invoice. Additionally, update the embedded XML filename from `zugferd-invoice.xml` to `factur-x.xml`. The former is marked as deprecated since ZUGFeRD 2.0 Ref: sections 6.2.2, 6.3.1, 6.3.2 of the ZUGFeRD 2.4 specification: https://www.ferd-net.de/en/downloads/publications/details/zugferd-24-english opw-6252082
This update resolves an issue where Odoo Server would unexpectedly crash (exit code 130) during automatic reloads. The fix prevents a race condition triggered by `SIGHUP` signals, ensuring Odoo Server remains stable and reliable even with frequent updates or file changes. This improves the overall stability and uptime of the Odoo instance.
Original PR description
### Summary When `dev_mode` includes `reload`, the `ThreadedServer` FSWatcher triggers a phoenix restart by sending the process a `SIGHUP`, and `signal_handler` turns `SIGHUP` into…
### Summary When `dev_mode` includes `reload`, the `ThreadedServer` FSWatcher triggers a phoenix restart by sending the process a `SIGHUP`, and `signal_handler` turns `SIGHUP` into `KeyboardInterrupt`. `ThreadedServer.run()` only catches that in its wait-loop — but there are two windows where the `KeyboardInterrupt` is raised **outside** the `try/except`, escapes `run()`/`main()`, and exits the interpreter with code **130**. Under Docker's default `restart: no`, PID 1 dies and the container does not come back. 1. **Startup** — a `SIGHUP` during `self.start() + preload_registries()` (e.g. a save while a previous reload is still loading modules). 2. **Teardown / duplicate** — a single save often emits two FS events; the FSWatcher's `if not odoo.phoenix:` dedup races across threads and fires two `SIGHUP`s. The first begins the phoenix teardown; the second lands during `self.stop()` / `_reexec()`, outside the guarded region, and escapes the same way. ### Reproducer (deterministic) Boot a threaded server and signal it a few times in quick succession: ```bash odoo-bin -d <db> --workers 0 # ThreadedServer # once it is up, with <pid> = the odoo process: for i in $(seq 8); do kill -HUP <pid>; sleep 0.12; done ``` Unpatched the process exits **130**; patched it survives after a single clean phoenix reload. The same happens from a single editor save (duplicate FS events) or a bulk file change. ### Fix Two guards in `signal_handler`, plus bracketing the startup window in `run()`: - **Startup**: a module flag marks the `self.start() + preload_registries()` window; a `SIGHUP` arriving then is *deferred* (recorded, not raised). After the window `run()` replays its effect inline so the wait-loop performs the normal phoenix restart. - **Duplicate**: if `odoo.phoenix` is already set a restart is already in flight, so a further `SIGHUP` is redundant and is ignored rather than raised. `SIGINT`/`SIGTERM` are untouched — `Ctrl-C` and `docker stop` keep working unchanged. The fast path (no `SIGHUP`) is one flag set + one clear per startup. ### Notes - Targeted at **17.0** (oldest affected branch) for forward-porting. The 17.0 → 18.0 hop will conflict: on 18.0/master the flag is the module-level `server_phoenix` global and `run()` wraps the critical section in `with Registry._lock:`. I'll resolve the forward-port. - Prior art: #21209 (introduced the phoenix flag), #206898 (graceful reload), #207930. - CLA: signed via #269075 (Codeforward corporate CLA).