Daily updates from Odoo
Thursday, May 21, 2026
129 changes
24 changes
Enhancements to existing features
This update enhances the user experience for warehouse staff who frequently use tablets to view transfer lists. The changes improve the visibility of key information like reference IDs and contact details, ensuring they are easily readable on medium-sized screens. This addresses a usability issue for a common workflow.
Original PR description
Devices with medium screen sizes such as tablets are often used in warehouses. However, when we check a transfer list view, we can not read clearly important info such as reference or contacts because fields are not entirely displayed. Task-id: 6030156
Resolved issues and error corrections
This update corrects a problem where the ABA file generated for Australian payroll wasn't being created correctly. The fix ensures the payslip batch is assigned before payment validation, guaranteeing the ABA file contains accurate payment information. This resolves a previous issue and improves the reliability of payroll reporting.
Original PR description
Payslip batch needs to be assgned before the payment batch is validated, otherwise the ABA file will be blank. This commit ensures that flow and the test ensure both aba flows generate the same file content. task-6123029 Forward-Port-Of: odoo/enterprise#116907 Forward-Port-Of: odoo/enterprise#114970
This update corrects a bug where attendance records were disappearing after a public holiday was added. The issue stemmed from a mismatch between how attendance dates were stored (in UTC) and how they were compared against local timezones. The fix ensures attendance dates are correctly converted to the employee's timezone for accurate reporting.
Original PR description
**Steps to reproduce in runbot:** 1. Install hr_holidays_attendance. 2. Create an employee with a contract start date (e.g., April 1st). 3. Set the timezone(for both user and emp working schedule) to…
**Steps to reproduce in runbot:** 1. Install hr_holidays_attendance. 2. Create an employee with a contract start date (e.g., April 1st). 3. Set the timezone(for both user and emp working schedule) to Europe/Brussels. 4. Create an attendance record (e.g., April 15th). 5. Go to Reporting > Time Off Ledger and remove all filters. -> Attendance is correctly shown for all dates from April 1st 6. Create a public holiday on April 16th starting at 00:00. 7. Check the Time Off Ledger again. **Issue:** The attendance entry for April 15th disappears after adding the public holiday. **Cause:** Calendar leave datetime fields (date_from/date_to) are stored in UTC but compared against attendance dates without converting to the employee's resource calendar timezone, causing date boundaries to shift and records to be incorrectly excluded. https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_holidays_attendance/report/hr_leave_attendance_report.py#L133-L144 **Solution:** Convert calendar leave datetimes to the employee timezone before casting to date, ensuring comparisons reflect the correct local boundaries. **NOTE:** This issue is mainly reproducible on runbot since its server timezone is GMT. On local machines configured with UTC, the stored datetime values already align with the expected conversions, so the date shift does not occur. opw-6118043 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265129 Forward-Port-Of: odoo/odoo#262179
This update resolves a problem where the Brazilian localization module (`l10n_br`) was incorrectly referencing a field that had moved in a recent upgrade. The change ensures the module correctly pulls data from the updated address form fields, maintaining accurate address information for Brazilian users. This update is a critical fix to prevent potential data inconsistencies.
Original PR description
Issue: ------ `l10n_br.address_form_fields` inherits from `portal.address_form_fields` but targets a `<select>` element that was moved to `portal_address_extended.address_extended_form_fields` in…
Issue: ------ `l10n_br.address_form_fields` inherits from `portal.address_form_fields` but targets a `<select>` element that was moved to `portal_address_extended.address_extended_form_fields` in [saas~19.2]. Traceback: ---------- ```py Error while parsing or validating view: Element '<xpath expr="//select[@name='city_id']/option[not(@value='')]">' cannot be located in parent view ``` Steps to reproduce: ------------------- 1. Install `l10n_br` in v19 2. Upgrade to v19.2 3. Upgrade the `l10n_br` module → Traceback Root cause: ----------- The view is adapting an element owned by a sibling view, making the inheritance hierarchy conceptually wrong and fragile. Solution: --------- Update the `inherit_id` of `l10n_br.address_form_fields` to `portal_address_extended.address_extended_form_fields` so it correctly inherits from the view that owns the targeted element. opw: [6125901] [saas~19.2]: https://github.com/odoo/odoo/commit/026c6f9f2a388ee509a135c53e38f5bb3d08ff73 [6125901]: https://www.odoo.com/odoo/70/tasks/6125901?debug=1 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#264045
This update resolves an issue where users couldn't edit dates within the blog section due to a missing plugin configuration. The fix ensures the `DateTimeFieldPlugin` is correctly included in the necessary Odoo lists, allowing for proper date field editing and preventing potential save errors. This improves the user experience for blog content management.
Original PR description
The plugin `DateTimeFieldPlugin` was only added in registry `builder-plugins`. But it should also be included in the lists `CORE_PLUGINS` of `html_builder` and `TRANSLATION_PLUGINS` of `website` (the same as `MonetaryFieldPlugin` and similar plugins) Steps to reproduce: - Open `/blog` in translate mode - Click on a date - Bug: you can edit the text (and it will likely cause an error on save) task-6226376 Forward-Port-Of: odoo/odoo#265400 Forward-Port-Of: odoo/odoo#264943
This update fixes an error in the WPS payroll report generation process. Specifically, it ensures the report accurately reflects payment dates and values, preventing potential discrepancies when generating the WPS file. This improves the reliability of payroll reporting for Saudi Arabia.
Original PR description
In this commit, we: - corrected the tooltip description of `l10n_sa_wps_value_date`; - added back the Debit Date to the WPS file and assigned it the value of the `effective_date`; - added back the user error in case the Payment Date is greater than or equal to the Value Date. TaskID-6130969 Forward-Port-Of: odoo/enterprise#115762
This update resolves an issue where the skill addition form in Odoo 19.3 would freeze when using 'Save & New'. The fix ensures the form correctly retrieves and updates data, preventing this freezing behavior and guaranteeing the badges many2one field functions reliably.
Original PR description
Issue: - Since 19.3, using "Save & New" while adding skills could freeze the subsection in forms using the badges many2one field. - The component was relying on `record` and `field` values captured during setup, which became stale after the form state was recreated. Fix: - Updated the special data hook to read `record`, `name`, and related field values directly from hook props instead of setup-scoped values. - Updated `useSelectCreate` to dynamically retrieve the relation from current props. Impact: - Prevents the skill subsection from freezing after using "Save & New". - Ensures the badges many2one field always works with the latest record state. Task: 6147646 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes an issue where certain Italian taxes (INPS and Pension Fund) weren't properly imported from CSV files. The fix ensures these taxes are correctly configured within Odoo, allowing for accurate processing of vendor bills and compliance with Italian tax regulations. This improves the reliability of tax calculations and reporting.
Original PR description
### Issue before this commit: In the previous implementation, several Italian taxes, specifically the 4% INPS and the 4% Pension Fund (F.Pens), were not correctly initialized. Although the relevant…
### Issue before this commit: In the previous implementation, several Italian taxes, specifically the 4% INPS and the 4% Pension Fund (F.Pens), were not correctly initialized. Although the relevant EDI data was present in the source CSV templates, it was missing from the actual tax records in the database. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it_edi 2. Go to Accounting -> Taxes 3. Open 4% INPS tax and 4% F.Pens and go to Advanced Options tab and see that no Pension Fund Type is associated by default ### Cause of the issue: While moving the witholding data from l10n_it_edi to l10n_it in this commit https://github.com/odoo/odoo/commit/40e09ca01242 the templates were not correcly rendered and set up. ### Reason to introduce the fix: For a tax to be correctly recognized from the XML, it is essential that we have the corresponding tax already configured in Odoo, including the specific type. We should have at least these two taxes fully configured so the system can elaborate them correctly when imported from vendor bills. opw-6093221 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#258947
This update ensures that the customer reference field from invoices is correctly included in the fa3 XML files sent to the Polish tax authority (KSEF). Previously, this information was missing, which could cause processing delays. This fix improves invoice accuracy and compliance with Polish tax regulations.
Original PR description
**STEP TO REPRODUCE** 1. Create an invoice and fill the customer reference field (other info tab). 2. send the invoice to ksef. 3. Open the generated fa3 file, and notice there is no mention of the customer reference. Ticket [link](https://www.odoo.com/odoo/project.task/6150812) opw-6150812 Forward-Port-Of: odoo/odoo#263797
This update fixes an issue where updating a manufacturing order (MO) with a multi-level BOM would only create MOs for the immediate child components, missing the next level. The fix ensures that all necessary MOs are created during the BOM update process, preventing incomplete manufacturing operations. This improves the reliability of production planning.
Original PR description
When updating a mo, if the new component has a multilvl bom, it will only create a mo for the direct child and not the next Steps to reproduce: ------------------- * Create a products "Main",…
When updating a mo, if the new component has a multilvl bom, it will only create a mo for the direct child and not the next Steps to reproduce: ------------------- * Create a products "Main", "Final", "Semi", "Raw" * Create a Bom for "Final" with "Semi" as component * Create a Bom for "Semi" with "Raw as component * Add MTO on Final and Semi * Create a MO for Main with no components and confirm it * Add "Final" to the mo as component as save. -> The MO for "Final" is correctly created with "Semi" as component but there is no MO for "Semi" with "Raw" as component. Observation: ------------- When updating de MO, it will write the new SM (Final) to the production, and we will call ```_autoconfirm_production``` with ```no_procurement```: https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/mrp/models/mrp_production.py#L1051 Where we will directly confirm the sm (```_action_confirm```). From the SM ```_action_confirm``` we will create and run a procurement (manufacture in our case). From the manufacture we will create the new move line for Semi and go through ```action_confirm``` on the manufacturing order: https://github.com/odoo/odoo/blob/9ef76a4d6010191ab7ab1a0d1085972901280dda/addons/mrp/models/stock_rule.py#L116-L118 In the MO ```action_confirm```, we will confirm the move and should create new procurement for the moves that need them, but, since in our case we have ```no_procurement``` in the context, we will set ```create_proc``` to false: https://github.com/odoo/odoo/blob/9ef76a4d6010191ab7ab1a0d1085972901280dda/addons/mrp/models/mrp_production.py#L1635 Since ```create_proc``` is false we will not create a procurement for those move lines: https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/stock/models/stock_move.py#L1557-L1558 https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/stock/models/stock_move.py#L1571-L1580 opw-6005675 Forward-Port-Of: odoo/odoo#258153
This update fixes an issue where service products didn't consistently apply user-defined default units of measure. Previously, the default unit was overridden when a product was marked as a service. Now, the system correctly applies the user's preferred unit of measure for all products, including services, ensuring accurate time tracking and invoicing.
Original PR description
A user-defined default on `product.template` Unit is not applied when the product is of type Service 1. Install Sales and Sales Timesheet 2. Go to Settings > Sales > Product Catalog and enable Units of Measure & Packagings 3. Enable debug mode 4. Go to Sales > Products, open a new product form and set unit to Days 5. In the debug menu (bug icon in the top right), select Set Default Values for Unit = Days and save 6. Reload the page 7. Set the type to Service 8. Unit changes from Days to Hours Same issue happens for `product.product` Issue: User default values are overwritten when certain conditions are met by https://github.com/odoo/odoo/blob/6955370fd2d62c83f0ea24247abf7a9e4b4ebed3/addons/sale_timesheet/models/product_template.py#L55-L57 Solution: Use the user defined default on `uom_id` except for service products that are invoiced with timesheets as they need a time unit of measure opw-6139603 Forward-Port-Of: odoo/odoo#262597
This update fixes an issue where Fedex labels were missing a crucial 'REF' field, which is required by the shipping carrier. The fix ensures that all Fedex labels now correctly include this reference, preventing potential delivery delays or errors. This improves the accuracy and reliability of our shipping process.
Original PR description
Issue ----- `REF` field of Fedex labels is missing. Steps to reproduce ----- - Setup Fedex - Create a product (set weight) - Create a delivery for the product - Set carrier as Fedex - Validate…
Issue
-----
`REF` field of Fedex labels is missing.
Steps to reproduce
-----
- Setup Fedex
- Create a product (set weight)
- Create a delivery for the product
- Set carrier as Fedex
- Validate delivery
- Opend the label
> REF field is empty
Cause
-----
When filling the `CustomerReferences`, we only specify the SO
https://github.com/odoo/enterprise/blob/aae680f5b86fa87193ba6616e8431eed985b2ee7/delivery_fedex_rest/models/fedex_request.py#L309-L313
The `REF` field is populated using `CUSTOMER_REFERENCE` references, which is not present in this case.
Excerpt of the API DOC
-----
```
"CustomerReference": {
"type": "object",
"properties": {
"customerReferenceType": {
"type": "string",
"description": [...],
"example": "DEPARTMENT_NUMBER",
"enum": [
"CUSTOMER_REFERENCE",
"DEPARTMENT_NUMBER",
"INVOICE_NUMBER",
"P_O_NUMBER",
"INTRACOUNTRY_REGULATORY_REFERENCE",
"RMA_ASSOCIATION"
]
},
"value": {
"type": "string",
"description": [...],
"example": "3686"
}
}
},
```
[...] replaces long description strings, refer to API for full documentation.
Result after fix
-----
<img width="477" height="738" alt="image" src="https://github.com/user-attachments/assets/0d3a0786-5b7d-41cc-8548-2dc7b0f379ab" />
-----
Ticket:
opw-6101620
Forward-Port-Of: odoo/enterprise#116870This update significantly speeds up the process of finding BOMs for product records, particularly when dealing with large numbers of products. The change optimizes how the system identifies relevant BOMs, reducing processing time and improving overall MRP performance. This results in faster product configuration and order fulfillment.
Original PR description
Before this commit, finding a bom for a recordset of `products` involved looping over all the boms and it will loop over all the `product_variant_ids` of `bom.product_tmpl_id` if the bom's…
Before this commit, finding a bom for a recordset of `products` involved looping over all the boms and it will loop over all the `product_variant_ids` of `bom.product_tmpl_id` if the bom's `product_id` is NULL. This approach might loop over variants which we are not trying to find a bom for. In additon to that, due to the fact that multiple boms might have the same `product_tmpl_id`, this approach might consider the same variants in the inner loop redundantly even though we matched the variant with a bom in a previous itration.
Worst case, this might result in a time complexity of $O(N * M)$ where N is the number of boms and M is the number of variants.
To improve the performance, I only considered the variants given in the paramater `products` and in addition to that, I created a new dictionary mapping a `product_tmpl_id` to its bom if the bom doesn't have a variant set. By doing this, I can loop over the `products` given and if it doesn't have a bom set then it will be set to the one its template had taken from the previos loop.
In a method call with the following constraints
- **2** products the method was finding a bom for
- The 2 products had the same template and the template contained **550** active variants
- The boms were only related to the template rather than the variants themselves.
| Input Size | Before | After |
| :--- | :--- | :--- |
| 100 | 0.78s | 0.03s |
| 1000 | 8.53s | 0.11s |
| 10000 | 80.99s | 0.73s |
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#247465This update resolves an issue that prevented users from successfully duplicating sale orders when the order's company differed from the website's company. The fix ensures that the duplication process handles company discrepancies gracefully, preventing a traceback error and improving the user experience. This ensures sales operations can continue without interruption.
Original PR description
When duplicating a sale order whose company differs from the website's company, a traceback is raised. Steps to reproduce the error: - Install ``website_sale`` module with demo data - Create a new Company A - Select both the companies your company and Company A - Go to Website > eCommerce > Order > Open any order > Other info, change the company from your company to Company A > Save - Actions > Duplicate Traceback: ```py ValueError: The company of the website you are trying to sell from (Hune Specialized International Co LLC) is different than the one you want to use (My Company (San Francisco)) ``` https://github.com/odoo/odoo/blob/ea56382f804e494a86a72dab02a26134ef358c50/addons/website_sale/models/sale_order.py#L165-L171 Here, when the website's company and sale order's company is different, The above traceback will generate. sentry-7465306461 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes an issue where recurring plans weren't appearing in quotation reports when using the DIN5008 template for Swiss companies. The fix ensures that recurring plans are always visible in the generated reports, improving accuracy and providing a complete view of subscription details. This resolves a previous reporting discrepancy.
Original PR description
When generating a quotation for a recurring plan, if the quotation uses the DIN5008 template, the recurring plan is not shown in the report. Steps to reproduce: ------------------- * Make sure…
When generating a quotation for a recurring plan, if the quotation uses the DIN5008 template, the recurring plan is not shown in the report. Steps to reproduce: ------------------- * Make sure l10n_din5008 is installed * Create a Swiss company * Go to the subscription app and create an order with a recurring plan * Print the quotation > Observation: The recurring plan is not shown in the report. Why the fix: ------------ We add a new scss rule to make sure the recurring plan is always shown in the report. https://github.com/odoo/enterprise/blob/fb2eb6cfdc4527e102dd22321975ab3f0d24b88b/sale_subscription/views/subscription_templates.xml#L7-L23 Before: <img width="790" height="677" alt="image" src="https://github.com/user-attachments/assets/342753fa-9655-41ac-a958-f94f6ae2b6c7" /> After: <img width="808" height="756" alt="image" src="https://github.com/user-attachments/assets/4ed726c5-0702-48ee-8578-8b0d2c0f4e55" /> opw-5960219 Forward-Port-Of: odoo/odoo#261727
This update fixes a problem where adding rental products to the cart would fail due to mismatched date calculations. The fix ensures that rental product durations are correctly handled, preventing errors when mixing different rental periods. This improves the reliability of the rental product checkout process.
Original PR description
Steps to reproduce: =================== 1. Go to the shop page and use the rental date picker to select a start and end date with hours. 2. Find a rental product configured with "Days" pricing. 3.…
Steps to reproduce: =================== 1. Go to the shop page and use the rental date picker to select a start and end date with hours. 2. Find a rental product configured with "Days" pricing. 3. Add to card directly from the product card 4. Add a rental product from product image that has date type value date 5. Go to that product details page. 6. Click add to cart -> Invalid operation, You cannot mix different rental periods... Cause: ====== When adding a product from the shop list view, the system uses the default start/end dates (from the rental period) exactly as first added. However, the "Add to Cart" logic on the product details page attempts to adapt the selected dates to the product's specific rental unit (e.g., normalizing the time component for 'Day' pricing). This re-calculation creates a timestamp mismatch between the item already in the cart (from the shop view) and the new item being added (from the details page). Solution: ========= The add-to-cart flow has been updated to correctly utilize the default duration values (the globally selected dates) if they exist. opw-5450576 Forward-Port-Of: odoo/enterprise#117058 Forward-Port-Of: odoo/enterprise#103373
This update fixes a problem where combo prices were incorrectly doubling when multiple items were ordered during pricelist changes. The update ensures that free items are scaled correctly and that parent unit prices are accurately updated, resulting in more reliable combo pricing in the Point of Sale system. This improves the accuracy of sales calculations and prevents overcharging customers.
Original PR description
Fix combo prices doubling when quantity > 1 during pricelist changes. Correctly scale free items in 'getFreeAndExtraChildLines' and ensure parent unit prices are updated in 'setPricelist'. task-id: 5971935 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#250666
This update allows users to re-submit invoices that were previously rejected by the tax authorities (SPV). Previously, rejected invoices were deleted and recreated, losing important tracking information. Now, rejected invoices are preserved, providing a history of attempts and improving traceability for Romanian VAT compliance.
Original PR description
Allow users to re-send invoices that were rejected by the SPV. Previously, EDI documents were deleted and recreated on every interaction, losing history in the process. This commit updates existing EDI documents in place instead, preserving failed documents as history for traceability. task-[5976612](https://www.odoo.com/odoo/project/967/tasks/5976612) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#254882
This update ensures payments to Viva.com are reliably confirmed, even if the connection is temporarily lost. Previously, a dropped connection would halt payment processing, leading to potential issues with Viva.com. Now, the system automatically retries payment confirmation until successful, providing a smoother and more accurate payment experience.
Original PR description
When a payment was sent to Viva.com and the connection dropped before receiving confirmation, the polling loop in waitForPaymentConfirmation would stop because _handleOdooConnectionFailure set the payment status to "retry" and rejected the promise. This left the payment debited on Viva's side but unconfirmed in the POS. Now the polling uses a direct silent ORM call instead of _call_viva_com to avoid triggering _handleOdooConnectionFailure. On connection failure, the poll silently retries on the next interval until a definitive success/failure response is received. A one-time warning notification informs the user that connectivity was lost. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#259746 Forward-Port-Of: odoo/odoo#259564
This update resolves an error that prevented users from viewing historical payslip details in the Indonesian payroll system. The fix ensures that the system correctly handles the retrieval of payslip information, allowing users to access the necessary data. This improves the usability of the payroll reporting feature.
Original PR description
Currently, an error occurs when users click on View GROSS/PPH21/JHT/JP History to see historical payslip line values. Steps to Reproduce: - Install the `l10n_id_hr_payroll` module with demo data. -…
Currently, an error occurs when users click on View GROSS/PPH21/JHT/JP History to see historical payslip line values. Steps to Reproduce: - Install the `l10n_id_hr_payroll` module with demo data. - Switch to the `Indonesian` company. - Go to `Employees` and open an `existing record or create a new one`. - Click on `GROSS/PPH21/JHT/JP History` button. `ValueError: External ID not found in the system: hr_payroll.act_contribution_reg_payslip_lines` The issue occurs because, in [this commit], the act_contribution_reg_payslip_lines window action was removed. However, when viewing historical lines, and it still tries to retrieve this action using its XML ID [1] and then updates its domain, context, and views. As a result, it raises an error due to the missing XML ID. This commit ensures that the method returns a standalone window action dictionary instead of relying on the removed window action record. [this commit]: http://github.com/odoo/enterprise/pull/112571/changes/7094cdc033591258cae7c7df46888c29eaae6248 [1]- https://github.com/odoo/enterprise/blob/103500a805d1ffc1185ed639d613c2d1ede492cb/l10n_id_hr_payroll/models/hr_employee.py#L17-L24 sentry-7489148694
This update resolves an error that occurred when automatically checking out employees with no defined check-out date, specifically when using the hr_attendance and hr_work_entry_attendance modules. The fix ensures accurate overtime calculations by correctly handling timezones, preventing the creation of duplicate overtime entries.
Original PR description
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both…
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both installed. When setting an attendance for an employee that has a check-in date but no check-out date, and running the scheduled action `Automatically check-out employees`, an `expected singleton` error occurs. ## Reproduction Steps 1. Install hr_work_entry_attendance. 2. Create an Employee. In the Payroll tab, set a start date for the contract. In the Settings tab, make sure their timezone is set to Brussels, and set the Overtime Ruleset field to Default Ruleset. 3. In Settings, check the Automatic Check-out box. 4. Go to Attendances. Create an attendance for the employee you just created. Set a Check-in date to 8 am on April 17th, for example, and leave the check-out field empty. 5. Open Scheduled Actions. Search the action Automatically check-out employees and click Run Manually. ### Expected behavior The attendance check-out should be set at the end of April 17th. ### Unexpected behavior An error occurs: `Expected singleton: hr.attendance.overtime.line(39, 40)` ## Origin of the issue When the attendance goes over several days, we set the check-out date to: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L618 This is a Naive date. However, it will later be considered as a UTC date. Because the employee's timezone is Brussels, this time will be transformed to 2 am next day when we retrieve attendance intervals. This will result in the creation of overtime entries for both days, causing the Expected Singleton error. https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L687 https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L667-L672 In our case, `self.check_in` = April 17th at 06:00:00 and `self.check_out` = April 17th at 23:59:59. Converted, we will obtain April 17th at 08:00:00 and April 18th at 1:59:59. Because of that, at the return: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L706-L709 We will return a dict containing 2 intervals: one for 17th April and one for 18th April. We will then create overtime entries with such attendances: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L333 leading to the creation of 2 different overtimes for the same attendance. So, when we retrieve the overtime for that attendance: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L185, We get the 2. Thus when trying to access their status with: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L191 An Expected Singleton Occurs. __ opw-6036064 Forward-Port-Of: odoo/odoo#262257
This update resolves an error that occurred when automatically checking out employees with no defined check-out date, particularly when the hr_attendance and hr_work_entry_attendance modules are used. The fix corrects a timezone calculation issue that was creating duplicate overtime entries, preventing the scheduled checkout action from functioning correctly. This ensures accurate overtime calculations for employees.
Original PR description
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both…
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both installed. When setting an attendance for an employee that has a check-in date but no check-out date, and running the scheduled action `Automatically check-out employees`, an `expected singleton` error occurs. ## Reproduction Steps 1. Install hr_work_entry_attendance. 2. Create an Employee. In the Payroll tab, set a start date for the contract. In the Settings tab, make sure their timezone is set to Brussels, and set the Overtime Ruleset field to Default Ruleset. 3. In Settings, check the Automatic Check-out box. 4. Go to Attendances. Create an attendance for the employee you just created. Set a Check-in date to 8 am on April 17th, for example, and leave the check-out field empty. 5. Open Scheduled Actions. Search the action Automatically check-out employees and click Run Manually. ### Expected behavior The attendance check-out should be set at the end of April 17th. ### Unexpected behavior An error occurs: `Expected singleton: hr.attendance.overtime.line(39, 40)` ## Origin of the issue When the attendance goes over several days, we set the check-out date to: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L618 This is a Naive date. However, it will later be considered as a UTC date. Because the employee's timezone is Brussels, this time will be transformed to 2 am next day when we retrieve attendance intervals. This will result in the creation of overtime entries for both days, causing the Expected Singleton error. https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L687 https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L667-L672 In our case, `self.check_in` = April 17th at 06:02:00 and `self.check_out` = April 17th at 23:59:59. Converted, we will obtain April 17th at 08:02:00 and April 18th at 1:59:59. Because of that, at the return: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L706 We will return a dict containing 2 intervals: one for 17th April and one for 18th April. We will then create overtime entries with such attendances: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L333 leading to the creation of 2 different overtimes for the same attendance. So, when we retrieve the overtime for that attendance: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L185, We get the 2. Thus when trying to access their status with: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L191 An Expected Singleton Occurs. __ opw-6036064 Forward-Port-Of: odoo/enterprise#115828
This update enhances the working files feature within the account reports, making it safer and more user-friendly. Specifically, a confirmation dialog has been added when deleting a working file, and the button is now hidden for non-accountant users to prevent accidental deletions. This ensures data integrity and simplifies the reporting process.
Original PR description
contains: [FIX] account_reports: Working files delete button: - hide it for non-accountant - add confirmation dialog [FIX] account_reports: Working file should always open in cycle view [FIX] account_reports: Always show embedded actions in Working files task-5880319 Forward-Port-Of: odoo/enterprise#115596
This update fixes a bug that caused duplicate vendor creation during EDI import of Swiss VAT documents. The change ensures Odoo correctly matches VAT numbers, regardless of format (flat or formatted), preventing unnecessary partner duplication. This improves data accuracy and streamlines import processes.
Original PR description
### Issue: When importing EDI documents such as Peppol files, Swiss VAT numbers are often provided in a flat format (e.g., CHE530781296TVA), while existing Odoo partners usually store them in the…
### Issue: When importing EDI documents such as Peppol files, Swiss VAT numbers are often provided in a flat format (e.g., CHE530781296TVA), while existing Odoo partners usually store them in the official formatted version (e.g., CHE-530.781.296 TVA) This mismatch prevents proper partner matching and may create duplicate partners during import ### Cause: `_retrieve_partner` lacks Swiss-specific VAT normalization logic in `_import_retrieve_customer_from_vat()` As a result, the matching process fails to: - match formatted and unformatted Swiss VAT numbers - properly handle language suffixes such as `TVA`, `MWST`, or `IVA` If `base_vat` is installed, and the imported XML VAT is `CHE530781296TVA`, a new partner will be created with the structure format `CHE-530.781.296 TVA` As the match won't be made new partner will be created at each import ### Steps to reproduce: - Install `account` - Create a Vendor (Name: Test CH Vendor, Country: Switzerland, Tax ID: CHE-530.781.296 TVA) - Import the bill [CH_bill_to_import.xml](https://github.com/user-attachments/files/27202997/CH_bill_to_import.xml) from the ticket Before the fix, the existing partner is not matched and a duplicate partner is created opw-6072239 Forward-Port-Of: odoo/odoo#262011
19 changes
Resolved issues and error corrections
This update fixes an error in the WPS payroll report generation process. Specifically, it ensures the report correctly uses the value date and prevents issues when the payment date is too close to or equal to the value date, leading to more accurate and reliable reports for Saudi Arabian payroll.
Original PR description
In this commit, we: - corrected the tooltip description of `l10n_sa_wps_value_date`; - added back the Debit Date to the WPS file and assigned it the value of the `effective_date`; - added back the user error in case the Payment Date is greater than or equal to the Value Date. TaskID-6130969 Forward-Port-Of: odoo/enterprise#115762
This update corrects a bug where users couldn't edit dates within the blog translate mode. The fix ensures the `DateTimeFieldPlugin` is correctly included in the necessary Odoo modules, allowing for proper date field editing and preventing potential save errors. This improves the user experience for blog content management.
Original PR description
The plugin `DateTimeFieldPlugin` was only added in registry `builder-plugins`. But it should also be included in the lists `CORE_PLUGINS` of `html_builder` and `TRANSLATION_PLUGINS` of `website` (the same as `MonetaryFieldPlugin` and similar plugins) Steps to reproduce: - Open `/blog` in translate mode - Click on a date - Bug: you can edit the text (and it will likely cause an error on save) task-6226376 Forward-Port-Of: odoo/odoo#265400 Forward-Port-Of: odoo/odoo#264943
This update corrects a bug in the Odoo holiday scheduling module. Previously, a key field was missing from a system update trigger, preventing proper validation of dates. Now, any changes to the popover form in validated state will trigger a correct validation error, ensuring accurate holiday calculations.
Original PR description
Related-https://github.com/odoo/enterprise/pull/114445 The `work_entry_type_request_unit` field was missing from the @api.depends decorator of `_compute_date_from_to()`. This prevented the method from recomputing `date_from` and `date_to` when related fields changed, which meant the `_check_date_state` constraint was never triggered. After this change, whenever any field changes on popover form in validated state it will raise proper validation error task-[6117310](https://www.odoo.com/odoo/project/1251/tasks/6117310) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update resolves an issue where users could set an asset to 'draft' after a lock date was applied, leading to accounting errors. The fix prevents this action to maintain data integrity and ensure accurate financial reporting. It corrects a logic error related to finalized accounting entries.
Original PR description
Steps to reproduce: 1- Install Accounting 2- Go to [Accounting -> Assets] and create a new asset with start date 1/1/2025 3- Specify the fixed asset account and confirm the asset 4- Open [Accounting -> Lock Dates] 5- Set a Lock date on everything with the date 31/12/2025 and save 6- Cancel the asset, set to draft and confirm again Issue: `Invalid Operation: The remaining value on the last depreciation line must be 0` Expected behavior: Should not be able to set to draft once the asset is cancelled Why this happens: Commit 66db1d5 introduced a new condition on the `Set to Draft` button which results in the button being visible when it should not be. If a Lock Date is set after an asset is confirmed, the acquisition and any depreciation entries are effectively finalized in the accounting history. Allowing a user to "Set to Draft" at that point would involve deleting or modifying entries in a closed period, which violates accounting integrity. opw-6152777
This update resolves a potential error in the MRP planning view that could cause it to crash when maintenance requests lacked scheduled dates. The fix filters out incomplete maintenance intervals, ensuring the view functions reliably. A related constraint has also been added to the maintenance request model to prevent future issues.
Original PR description
#### Issue: Opening the MRP planning view could raise a traceback when a maintenance request had a ``Scheduled End`` but no ``Scheduled Date``. ```TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'``` #### Cause: In `_get_maintenances_intervals`, `mrp_maintenance` loaded maintenance intervals for gantt unavailability without filtering out incomplete rows. If an interval like False, datetime reached Intervals, it crashed when comparing None with a datetime. #### Fix: Filter out incomplete maintenance intervals in the gantt query. Also added a constraint on `maintenance.request` to require `schedule_date` and `schedule_end` to either both be set or both be empty in this community PR: https://github.com/odoo/odoo/pull/265208 opw-6225772
This update fixes an issue where certain Italian taxes (INPS and Pension Fund) weren't properly imported from vendor bills. The fix ensures these taxes are correctly configured within Odoo, allowing the system to accurately process and recognize tax data during import. This improves the reliability of tax calculations and reporting for Italian businesses.
Original PR description
### Issue before this commit: In the previous implementation, several Italian taxes, specifically the 4% INPS and the 4% Pension Fund (F.Pens), were not correctly initialized. Although the relevant…
### Issue before this commit: In the previous implementation, several Italian taxes, specifically the 4% INPS and the 4% Pension Fund (F.Pens), were not correctly initialized. Although the relevant EDI data was present in the source CSV templates, it was missing from the actual tax records in the database. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it_edi 2. Go to Accounting -> Taxes 3. Open 4% INPS tax and 4% F.Pens and go to Advanced Options tab and see that no Pension Fund Type is associated by default ### Cause of the issue: While moving the witholding data from l10n_it_edi to l10n_it in this commit https://github.com/odoo/odoo/commit/40e09ca01242 the templates were not correcly rendered and set up. ### Reason to introduce the fix: For a tax to be correctly recognized from the XML, it is essential that we have the corresponding tax already configured in Odoo, including the specific type. We should have at least these two taxes fully configured so the system can elaborate them correctly when imported from vendor bills. opw-6093221 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#258947
This update ensures that the customer reference field from invoices is correctly included in the fa3 file generated for transmission to the Polish KSEF system. Previously, this information was missing, which could cause processing delays. This fix ensures compliance with Polish tax regulations.
Original PR description
**STEP TO REPRODUCE** 1. Create an invoice and fill the customer reference field (other info tab). 2. send the invoice to ksef. 3. Open the generated fa3 file, and notice there is no mention of the customer reference. Ticket [link](https://www.odoo.com/odoo/project.task/6150812) opw-6150812 Forward-Port-Of: odoo/odoo#263797
This update resolves an issue where updating a manufacturing order (MO) with a multi-level BOM would only create MOs for the immediate child components, failing to generate MOs for subsequent components in the BOM hierarchy. The fix ensures that all necessary MOs are created during the update process, maintaining accurate manufacturing tracking. This prevents disruptions in production planning.
Original PR description
When updating a mo, if the new component has a multilvl bom, it will only create a mo for the direct child and not the next Steps to reproduce: ------------------- * Create a products "Main",…
When updating a mo, if the new component has a multilvl bom, it will only create a mo for the direct child and not the next Steps to reproduce: ------------------- * Create a products "Main", "Final", "Semi", "Raw" * Create a Bom for "Final" with "Semi" as component * Create a Bom for "Semi" with "Raw as component * Add MTO on final and Semi * Create a MO for Main with no components and confirm it * Add "Final" to the mo as component as save. -> The MO for "Final" is correctly created with "Semi" as component but there is no MO for "Semi" with "Raw" as component. Observation: ------------- When updating de MO, it will write the new SM (Final) to the production, and we will call ```_autoconfirm_production``` with ```no_procurement```: https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/mrp/models/mrp_production.py#L1051 Where we will directly confirm the sm (```_action_confirm```). From the SM ```_action_confirm``` we will create and run a procurement (manufacture in our case). From the manufacture we will create the new move line for Semi and go through ```action_confirm``` on the manufacturing order: https://github.com/odoo/odoo/blob/9ef76a4d6010191ab7ab1a0d1085972901280dda/addons/mrp/models/stock_rule.py#L116-L118 In the MO ```action_confirm```, we will confirm the move and should create new procurement for the moves that need them, but, since in our case we have ```no_procurement``` in the context, we will set ```create_proc``` to false: https://github.com/odoo/odoo/blob/9ef76a4d6010191ab7ab1a0d1085972901280dda/addons/mrp/models/mrp_production.py#L1635 Since ```create_proc``` is false we will not create a procurement for those move lines: https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/stock/models/stock_move.py#L1557-L1558 https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/stock/models/stock_move.py#L1571-L1580 opw-6005675 Forward-Port-Of: odoo/odoo#258153
This update fixes a problem where adding rental products to the cart resulted in an error message about incompatible rental periods. The fix ensures that rental product durations are correctly calculated and applied, allowing users to add rental products with hourly pricing to their carts without encountering this issue. This improves the overall rental product purchasing experience.
Original PR description
Steps to reproduce: =================== 1. Go to the shop page and use the rental date picker to select a start and end date with hours. 2. Find a rental product configured with "Days" pricing. 3.…
Steps to reproduce: =================== 1. Go to the shop page and use the rental date picker to select a start and end date with hours. 2. Find a rental product configured with "Days" pricing. 3. Add to card directly from the product card 4. Add a rental product from product image that has date type value date 5. Go to that product details page. 6. Click add to cart -> Invalid operation, You cannot mix different rental periods... Cause: ====== When adding a product from the shop list view, the system uses the default start/end dates (from the rental period) exactly as first added. However, the "Add to Cart" logic on the product details page attempts to adapt the selected dates to the product's specific rental unit (e.g., normalizing the time component for 'Day' pricing). This re-calculation creates a timestamp mismatch between the item already in the cart (from the shop view) and the new item being added (from the details page). Solution: ========= The add-to-cart flow has been updated to correctly utilize the default duration values (the globally selected dates) if they exist. opw-5450576 Forward-Port-Of: odoo/enterprise#117058 Forward-Port-Of: odoo/enterprise#103373
This update fixes an issue where service products didn't consistently apply user-defined default units of measure. Previously, the default unit was overridden when a product was marked as a service. Now, the system correctly applies the user's preferred unit of measure for all products, including services, ensuring accurate time tracking and invoicing. This improves data consistency and simplifies product management.
Original PR description
A user-defined default on `product.template` Unit is not applied when the product is of type Service 1. Install Sales and Sales Timesheet 2. Go to Settings > Sales > Product Catalog and enable Units of Measure & Packagings 3. Enable debug mode 4. Go to Sales > Products, open a new product form and set unit to Days 5. In the debug menu (bug icon in the top right), select Set Default Values for Unit = Days and save 6. Reload the page 7. Set the type to Service 8. Unit changes from Days to Hours Same issue happens for `product.product` Issue: User default values are overwritten when certain conditions are met by https://github.com/odoo/odoo/blob/6955370fd2d62c83f0ea24247abf7a9e4b4ebed3/addons/sale_timesheet/models/product_template.py#L55-L57 Solution: Use the user defined default on `uom_id` except for service products that are invoiced with timesheets as they need a time unit of measure opw-6139603 Forward-Port-Of: odoo/odoo#262597
This update fixes an issue where Fedex delivery labels were missing a crucial 'REF' field, which is required by the shipping carrier. The fix ensures all labels now include this reference, preventing potential delivery delays or errors. This improves the accuracy and reliability of our shipping process.
Original PR description
Issue ----- `REF` field of Fedex labels is missing. Steps to reproduce ----- - Setup Fedex - Create a product (set weight) - Create a delivery for the product - Set carrier as Fedex - Validate…
Issue
-----
`REF` field of Fedex labels is missing.
Steps to reproduce
-----
- Setup Fedex
- Create a product (set weight)
- Create a delivery for the product
- Set carrier as Fedex
- Validate delivery
- Opend the label
> REF field is empty
Cause
-----
When filling the `CustomerReferences`, we only specify the SO
https://github.com/odoo/enterprise/blob/aae680f5b86fa87193ba6616e8431eed985b2ee7/delivery_fedex_rest/models/fedex_request.py#L309-L313
The `REF` field is populated using `CUSTOMER_REFERENCE` references, which is not present in this case.
Excerpt of the API DOC
-----
```
"CustomerReference": {
"type": "object",
"properties": {
"customerReferenceType": {
"type": "string",
"description": [...],
"example": "DEPARTMENT_NUMBER",
"enum": [
"CUSTOMER_REFERENCE",
"DEPARTMENT_NUMBER",
"INVOICE_NUMBER",
"P_O_NUMBER",
"INTRACOUNTRY_REGULATORY_REFERENCE",
"RMA_ASSOCIATION"
]
},
"value": {
"type": "string",
"description": [...],
"example": "3686"
}
}
},
```
[...] replaces long description strings, refer to API for full documentation.
Result after fix
-----
<img width="477" height="738" alt="image" src="https://github.com/user-attachments/assets/0d3a0786-5b7d-41cc-8548-2dc7b0f379ab" />
-----
Ticket:
opw-6101620
Forward-Port-Of: odoo/enterprise#116870This update resolves an issue that caused Odoo to run out of memory when importing large PDF files into the Documents App. The fix disables a resource-intensive process within the PDF indexing library, improving the stability and reliability of this key feature. This ensures smoother operation for users working with larger documents.
Original PR description
### Description: When trying to import a large PDF file into the Documents App, it can sometimes fail because of an Out-of-Memory error (OOM). This is caused by the library `pdfminer.six` and the function `group_textboxes` that helps order the result of the indexing. This function is memory heavy and is not useful for our use case. To avoid it, we can just disable the "advanced layout analysis" by disabling `boxes_flow`. ### Reference: opw-6164752 Forward-Port-Of: odoo/odoo#264301
This update fixes an issue where vendor bills were incorrectly using Swiss tax rates when the invoice originated from a Belgian company. The change ensures that the tax rate aligns with the company's fiscal localization, preventing errors in financial reporting. This improves data accuracy and compliance.
Original PR description
**Steps to reproduce:** - Create a company in Belgium and set the fiscal localisation accordingly. - In the same company, create a fiscal position in Switzerland, set the foreign tax ID and then…
**Steps to reproduce:** - Create a company in Belgium and set the fiscal localisation accordingly. - In the same company, create a fiscal position in Switzerland, set the foreign tax ID and then generate the taxes for it. - Install the module account_edi_ubl_cii. - Create and invoice for a belgian customer, with one product line having a 0% tax. - Export the invoice as XML. - Go to taxes, filter by purchase, and make sure that the 0% switzerland tax has a higher sequence than the belgian 0% tax. - Import the previous invoice XML as a vendor bill. **Issue:** After importing the bill, the switzerland tax is used even though the fiscal localisation is belgian, which is wrong as it violates the constraint _validate_taxes_country **Solution:** Added a more selective domain to _import_fill_invoice_line_taxes opw-5467936 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265200 Forward-Port-Of: odoo/odoo#255848
This update fixes an error that occurred when selecting shift templates on planning slots, specifically when dealing with long time differences in resource schedules. The change ensures the system falls back to a previously calculated end date if the initial template calculation fails, preventing the application from crashing.
Original PR description
Currently, an error occurs when a user selects a shift template on a planning slot. **Steps to Reproduce:** - Install the `Planning` module with demo data. - Create a `Resource Time Off` record with…
Currently, an error occurs when a user selects a shift template on a planning slot. **Steps to Reproduce:** - Install the `Planning` module with demo data. - Create a `Resource Time Off` record with `start` and `end date` separated by more than `1400 days (around 3.9 years)`, and Set the Working Hours field to Standard 40 hours/week. - Go to `Planning` > `Configuration` > `Shift Templates`, open an `existing record` or create a `new one`, and set the `Working Days` to more than 1 day. - Create a new `planning slot`, Assign the resource `Abigail Peterson`, and select the above `shift template`. `AttributeError: 'bool' object has no attribute 'replace'` This error occurs because when the user sets the shift template, the compute method runs to calculate the start and end datetimes [1]. It computes the end datetime by adding the template duration in working days from the given start datetime using the resource working calendar within a searchable range of around 1400 days [2]. During this computation, leaves and non-working days are skipped [3]. If no valid working interval is found within the searchable range, then it returns False [4], which raises the error [5]. This commit ensures that if plan_days returns False, the computation falls back to the previously calculated end date. [1]: https://github.com/odoo/enterprise/blob/6ae5d3df6e9305416e4d6f74259cd01753025f42/planning/models/planning.py#L662-L671 [2]: https://github.com/odoo/odoo/blob/a439bd305112f6efc752ce900f7782e7faaf7312/addons/resource/models/resource_calendar.py#L826-L835 [3]: https://github.com/odoo/odoo/blob/a439bd305112f6efc752ce900f7782e7faaf7312/addons/resource/models/resource_calendar.py#L533-L537 [4]: https://github.com/odoo/odoo/blob/a439bd305112f6efc752ce900f7782e7faaf7312/addons/resource/models/resource_calendar.py#L835 [5]- https://github.com/odoo/enterprise/blob/6ae5d3df6e9305416e4d6f74259cd01753025f42/planning/models/planning.py#L653-L654 sentry-7472958590 Forward-Port-Of: odoo/enterprise#117851 Forward-Port-Of: odoo/enterprise#117073
This update significantly speeds up the process of finding a Bill of Materials (BOM) for a set of products within the MRP module. The change optimizes how the system identifies relevant BOMs, reducing processing time and improving overall system performance. This results in faster product creation and management.
Original PR description
Before this commit, finding a bom for a recordset of `products` involved looping over all the boms and it will loop over all the `product_variant_ids` of `bom.product_tmpl_id` if the bom's…
Before this commit, finding a bom for a recordset of `products` involved looping over all the boms and it will loop over all the `product_variant_ids` of `bom.product_tmpl_id` if the bom's `product_id` is NULL. This approach might loop over variants which we are not trying to find a bom for. In additon to that, due to the fact that multiple boms might have the same `product_tmpl_id`, this approach might consider the same variants in the inner loop redundantly even though we matched the variant with a bom in a previous itration.
Worst case, this might result in a time complexity of $O(N * M)$ where N is the number of boms and M is the number of variants.
To improve the performance, I only considered the variants given in the paramater `products` and in addition to that, I created a new dictionary mapping a `product_tmpl_id` to its bom if the bom doesn't have a variant set. By doing this, I can loop over the `products` given and if it doesn't have a bom set then it will be set to the one its template had taken from the previos loop.
In a method call with the following constraints
- **2** products the method was finding a bom for
- The 2 products had the same template and the template contained **550** active variants
- The boms were only related to the template rather than the variants themselves.
| Input Size | Before | After |
| :--- | :--- | :--- |
| 100 | 0.78s | 0.03s |
| 1000 | 8.53s | 0.11s |
| 10000 | 80.99s | 0.73s |
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#247465This update corrects a bug where changing the standard price of a lot-valued product didn't correctly update the product's cost. The fix ensures that the product's cost is accurately recalculated when the standard price is modified, maintaining consistency in inventory valuation. This prevents discrepancies in product cost calculations.
Original PR description
**Problem:** change of standard price on a product valued by lot and with standard price category does not work **Steps to reproduce:** - create a storable product tracked and valued by lot - set…
**Problem:** change of standard price on a product valued by lot and with standard price category does not work **Steps to reproduce:** - create a storable product tracked and valued by lot - set category as standard price - set a cost of 10 and save - click on the quantity smart button and then "update quantity" - add a quantity of 1 in a new lot - on the product form, change the cost to 12 and save - reload the page **Current behavior:** the cost is back to 10 **Expected behavior:** it should stay 12 **Cause of the issue:** when we change the standard_price of the product, _change_standard_price() is called from the write method https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L293 Inside _change_standard_price(): step 1: a new product.value is created step 2 : we set the standard_price of the lots to be the same as the one of the product https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L319-L323 In the create method for product.value (step 1), we call _set_value() on the moves with a remaining quantity https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product_value.py#L95 At the end of set_value we call _update_standard_price() on our product https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/stock_move.py#L337 Because the product is lot_valuated we update the standard_price based on the avg_cost of the product (this is needed because for instance if the prod is avco we can not simply use _run_average_batch as it is the case for non lot valuated avco product, because then the result won't be a weighted average of each lot, whereas avg_cost does take this into account) https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L633-L634 To compute the avg_cost, inside _compute_value(), we use the total value of each lot https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L226 The lots total value is computed inside the _compute_value() method of stock.lot. In this method, because the product is valued by standard_price we use the standard price of the lot https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/stock_lot.py#L40 But this value hasn't been updated yet (it will be at the time of step 2) so it's still the old value (10 in our case). So the avg_cost of the product will also be the old value and the standard price will be udpated back the old value Then, at the end of _change_standard_price() (at the time of step 2) the standard price of the lots are set based on the standard price of the product (so it stays the old value) **fix:** Inside _update_standard_price(), if the product is valued by standard price we do nothing https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L639-L640 We apply the same logic for the lot_valued product, if it's standard_price there is nothing to update opw-5949146 Forward-Port-Of: odoo/odoo#264991
This update fixes an error in how VAT reimbursement moves are generated when unclaimed tax is carried over to the next month. The previous calculation incorrectly used data from the last tax report, leading to inaccurate reimbursement amounts. This ensures accurate VAT reporting and proper reimbursement processing.
Original PR description
When generating a VAT return with an unclaimed tax amount carried to the next month, the carryover reimbursement move amounts are computed with an incorrect ratio. Steps to reproduce: - Create and…
When generating a VAT return with an unclaimed tax amount carried to the next month, the carryover reimbursement move amounts are computed with an incorrect ratio. Steps to reproduce: - Create and post a bill in May containing a VAT amount. - Create and post a bill in June containing a VAT amount. - Create a VAT return for May to carry over the VAT amount to the next month. - Create a VAT return for June, requesting the full VAT amount to be reimbursed. - Validate and send the June VAT return. - Check the generated reimbursement move Issue: Line values does not correspond to anything real/tangible. It occurs because when computing the ratio for the move we check the last tax report entry, where we find the amount of tax from the past months and a line balancing the last month that should not be taken into account. The "Balance tax current account (receivable)" line from the tax closing entry is mistakenly picked up as a tax carried forward line, throwing off the amounts. opw-5961836 Forward-Port-Of: odoo/enterprise#117837 Forward-Port-Of: odoo/enterprise#115451
This update fixes an issue where the system only processed the first business document within a multi-bill XML file. The fix ensures that all documents within the XML file are correctly imported, aligning with Italian tax regulations regarding unique file progressives. This improves the accuracy of invoice processing.
Original PR description
### Issue before this commit: When importing an XML file containing multiple business documents (multiple bodies with a single header), the system correctly split the file into separate attachments…
### Issue before this commit: When importing an XML file containing multiple business documents (multiple bodies with a single header), the system correctly split the file into separate attachments but failed to process any document beyond the first one. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it 2. Go to Vendor -> Bills 3. Try to upload a xml with multiple bodies and one header 4. See only the first bill is correctly imported ### Cause of the issue: The splitting logic renamed subsequent attachments with numeric suffixes but then this function incorrectly checked the name of the document. https://github.com/odoo/odoo/blob/29805eec2b70144edf9441cffe7e69e39fd4ba0e/addons/l10n_it_edi/models/account_move.py#L297-L305 We can not rely only on the name of the document but we need to check also its content. Refer to the rules for the name of the attachments: https://www.fatturapa.gov.it/export/documenti/Specifiche-tecniche-relative-al-Sistema-di-Interscambio-versione-1.8.4.pdf In summary what we need in the document (page 9): > The unique progressive of the file is represented by an alphanumeric string up to 5 characters long and with allowed values. [az], [AZ], [0-9]. The unique progressive of the file has the sole purpose of differentiating the name of the files transmitted to the Interchange System by the same entity; it does not necessarily have to follow a strict progressive nature and may also present different numbering styles. ### Reason to introduce the fix: This fix ensures that the function not only checks the name but also the content to be sure that the xml or p7m file contains a valid structure to be registered. Ticket [link](https://www.odoo.com/odoo/project.task/6072258) opw-6072258 Forward-Port-Of: odoo/odoo#265079 Forward-Port-Of: odoo/odoo#259887
This update allows users to re-submit invoices that were previously rejected by the tax authorities (SPV). Previously, rejected invoices were deleted and recreated, losing important tracking information. Now, rejected invoices are preserved as a history, providing better traceability and simplifying the process for users.
Original PR description
Allow users to re-send invoices that were rejected by the SPV. Previously, EDI documents were deleted and recreated on every interaction, losing history in the process. This commit updates existing EDI documents in place instead, preserving failed documents as history for traceability. task-[5976612](https://www.odoo.com/odoo/project/967/tasks/5976612) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#254882
23 changes
Resolved issues and error corrections
This update resolves a performance issue in the ES VAT Books report where excessive journal entries caused browser crashes. By implementing a 'load more' limit of 4000, the report now handles larger datasets more efficiently, improving user experience and stability.
Original PR description
The ES VAT Books report currently does not limit the number of lines loaded in the browser. This becomes more and more problematic as the volume of journal items listed in the report increases, ultimately leading to the browser being unable to render that many elements without crashing. Inspired by how this situation is handled in other reports and localizations, we now make use of the `load_more_limit` parameter and set a new default value of 4000 for it. Ticket: opw-5962456 Forward-Port-Of: odoo/enterprise#113830
This update fixes a bug where users could still attempt to book rental services even when resources were unavailable during their chosen time periods. The change ensures that the system now correctly blocks users from adding unavailable resources to their cart, preventing booking errors and improving the user experience. This enhancement is part of a broader effort to ensure accurate rental service availability.
Original PR description
Before this commit, when the user goes to the webshop to take a rental service with rental service unavailable at a certain period, the system does not block the user when the resource is not available during 2 hours in the period chosen by the user. The reason is because the hours are not checked when website_sale_renting_stock is not installed. This commit moves the code checking the time of the rental period made in website_sale_renting_stock in website_sale_renting to be able to have that verification for rental service used with planning to make sure the system will prevent the user to add the product in his cart when the resource is unavailable. task-5123239
This update resolves an issue where clicking a dropdown on the `/r` page would cause a system crash. The fix ensures the dropdown observer only starts when the menu element is fully rendered, preventing a 'TypeError' and allowing the dropdown to function correctly. This improves the user experience on this specific page.
Original PR description
Steps to reproduce: - Go to the `/r` page. - Click a dropdown. => traceback Before this commit, `Dropdown.onOpened()` always observed `menuRef.el` as soon as the popover reported it was open. In frontend pages such as `/r`, the menu can still be rendering at that moment. The menu appears just after, but `MutationObserver.observe()` already received `undefined` and raised a `TypeError`. After this commit, `Dropdown.onOpened()` only starts the observer when the menu element exists. The dropdown can finish opening normally, so the menu is shown without traceback. Introduced by [1]. [1]: 7aed5b141f06 Forward-Port-Of: odoo/odoo#265224
This update corrects a bug where changing the standard price of a lot-valued product didn't correctly update the product's cost. The fix ensures that the product's cost is accurately recalculated when the standard price is modified, maintaining correct inventory valuation. This resolves a discrepancy in how lot-valued products are tracked.
Original PR description
**Problem:** change of standard price on a product valued by lot and with standard price category does not work **Steps to reproduce:** - create a storable product tracked and valued by lot - set…
**Problem:** change of standard price on a product valued by lot and with standard price category does not work **Steps to reproduce:** - create a storable product tracked and valued by lot - set category as standard price - set a cost of 10 and save - click on the quantity smart button and then "update quantity" - add a quantity of 1 in a new lot - on the product form, change the cost to 12 and save - reload the page **Current behavior:** the cost is back to 10 **Expected behavior:** it should stay 12 **Cause of the issue:** when we change the standard_price of the product, _change_standard_price() is called from the write method https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L293 Inside _change_standard_price(): step 1: a new product.value is created step 2 : we set the standard_price of the lots to be the same as the one of the product https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L319-L323 In the create method for product.value (step 1), we call _set_value() on the moves with a remaining quantity https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product_value.py#L95 At the end of set_value we call _update_standard_price() on our product https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/stock_move.py#L337 Because the product is lot_valuated we update the standard_price based on the avg_cost of the product (this is needed because for instance if the prod is avco we can not simply use _run_average_batch as it is the case for non lot valuated avco product, because then the result won't be a weighted average of each lot, whereas avg_cost does take this into account) https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L633-L634 To compute the avg_cost, inside _compute_value(), we use the total value of each lot https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L226 The lots total value is computed inside the _compute_value() method of stock.lot. In this method, because the product is valued by standard_price we use the standard price of the lot https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/stock_lot.py#L40 But this value hasn't been updated yet (it will be at the time of step 2) so it's still the old value (10 in our case). So the avg_cost of the product will also be the old value and the standard price will be udpated back the old value Then, at the end of _change_standard_price() (at the time of step 2) the standard price of the lots are set based on the standard price of the product (so it stays the old value) **fix:** Inside _update_standard_price(), if the product is valued by standard price we do nothing https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock_account/models/product.py#L639-L640 We apply the same logic for the lot_valued product, if it's standard_price there is nothing to update opw-5949146 Forward-Port-Of: odoo/odoo#264991
This update resolves an issue where time off requests with dual approval ('both') weren't sending notifications to the designated responsible parties. The fix ensures that notifications are properly sent to the 'Notified Time Off Officer' when this approval type is selected, improving the accuracy of time off request workflows.
Original PR description
…cer') no fallback for responsible_ids
Issue:
When ('both','By Employee's Approver and Time Off Officer') is selected on a new HR Leave Type it does not fall back to the responsible_ids or “Notify HR”.
Steps:
1) Setup a neutralized outgoing mail server
2) install hr_holidays
3) make a new hr.leave.Type (Approval) with ('both','By Employee's Approver and Time Off Officer') and select a 'Notified Time Off Officer'(responsible_ids) 4) select an emplyee with a reelated user and remove the coach, manager, and responsible 'Time Off'. 5) save
6) Sign in as the employee, make a time off request under the new Type 7) No email
Fix:
Add a conditional with the lowest priority to fall back to responsible_ids
opw-6101637
Forward-Port-Of: odoo/odoo#264332
Forward-Port-Of: odoo/odoo#261853This update fixes an issue where Italian tax data (specifically INPS and Pension Fund) wasn't being properly imported into Odoo. The fix ensures these taxes are correctly configured, allowing the system to accurately process vendor bills and comply with Italian tax regulations. This improves the reliability of tax calculations and reporting.
Original PR description
### Issue before this commit: In the previous implementation, several Italian taxes, specifically the 4% INPS and the 4% Pension Fund (F.Pens), were not correctly initialized. Although the relevant…
### Issue before this commit: In the previous implementation, several Italian taxes, specifically the 4% INPS and the 4% Pension Fund (F.Pens), were not correctly initialized. Although the relevant EDI data was present in the source CSV templates, it was missing from the actual tax records in the database. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it_edi 2. Go to Accounting -> Taxes 3. Open 4% INPS tax and 4% F.Pens and go to Advanced Options tab and see that no Pension Fund Type is associated by default ### Cause of the issue: While moving the witholding data from l10n_it_edi to l10n_it in this commit https://github.com/odoo/odoo/commit/40e09ca01242 the templates were not correcly rendered and set up. ### Reason to introduce the fix: For a tax to be correctly recognized from the XML, it is essential that we have the corresponding tax already configured in Odoo, including the specific type. We should have at least these two taxes fully configured so the system can elaborate them correctly when imported from vendor bills. opw-6093221 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#258947
This update ensures that the customer reference field from invoices is correctly included in the fa3 XML file generated for transmission to the Polish KSEF (tax office). Previously, this information was missing, which could cause processing delays. This fix ensures compliance with Polish tax regulations.
Original PR description
**STEP TO REPRODUCE** 1. Create an invoice and fill the customer reference field (other info tab). 2. send the invoice to ksef. 3. Open the generated fa3 file, and notice there is no mention of the customer reference. Ticket [link](https://www.odoo.com/odoo/project.task/6150812) opw-6150812 Forward-Port-Of: odoo/odoo#263797
This update resolves an issue where updating a manufacturing order (MO) with a multi-level BOM would only create MOs for the immediate child components, missing the next level. The fix ensures that all necessary MOs are generated during the update process, preventing incomplete manufacturing workflows. This improves the reliability of production planning.
Original PR description
When updating a mo, if the new component has a multilvl bom, it will only create a mo for the direct child and not the next Steps to reproduce: ------------------- * Create a products "Main",…
When updating a mo, if the new component has a multilvl bom, it will only create a mo for the direct child and not the next Steps to reproduce: ------------------- * Create a products "Main", "Final", "Semi", "Raw" * Create a Bom for "Final" with "Semi" as component * Create a Bom for "Semi" with "Raw as component * Add MTO on Final and Semi * Create a MO for Main with no components and confirm it * Add "Final" to the mo as component as save. -> The MO for "Final" is correctly created with "Semi" as component but there is no MO for "Semi" with "Raw" as component. Observation: ------------- When updating de MO, it will write the new SM (Final) to the production, and we will call ```_autoconfirm_production``` with ```no_procurement```: https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/mrp/models/mrp_production.py#L1051 Where we will directly confirm the sm (```_action_confirm```). From the SM ```_action_confirm``` we will create and run a procurement (manufacture in our case). From the manufacture we will create the new move line for Semi and go through ```action_confirm``` on the manufacturing order: https://github.com/odoo/odoo/blob/9ef76a4d6010191ab7ab1a0d1085972901280dda/addons/mrp/models/stock_rule.py#L116-L118 In the MO ```action_confirm```, we will confirm the move and should create new procurement for the moves that need them, but, since in our case we have ```no_procurement``` in the context, we will set ```create_proc``` to false: https://github.com/odoo/odoo/blob/9ef76a4d6010191ab7ab1a0d1085972901280dda/addons/mrp/models/mrp_production.py#L1635 Since ```create_proc``` is false we will not create a procurement for those move lines: https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/stock/models/stock_move.py#L1557-L1558 https://github.com/odoo/odoo/blob/6fb69b5640743d3bc7bb52c73cb27da428f2451c/addons/stock/models/stock_move.py#L1571-L1580 opw-6005675 Forward-Port-Of: odoo/odoo#258153
This update fixes an issue where service products weren't correctly applying user-defined default units of measure. Previously, the system would override these settings when a product was marked as a service. Now, default units are applied unless a service product is being invoiced with timesheets, ensuring accurate unit tracking for all product types.
Original PR description
A user-defined default on `product.template` Unit is not applied when the product is of type Service 1. Install Sales and Sales Timesheet 2. Go to Settings > Sales > Product Catalog and enable Units of Measure & Packagings 3. Enable debug mode 4. Go to Sales > Products, open a new product form and set unit to Days 5. In the debug menu (bug icon in the top right), select Set Default Values for Unit = Days and save 6. Reload the page 7. Set the type to Service 8. Unit changes from Days to Hours Same issue happens for `product.product` Issue: User default values are overwritten when certain conditions are met by https://github.com/odoo/odoo/blob/6955370fd2d62c83f0ea24247abf7a9e4b4ebed3/addons/sale_timesheet/models/product_template.py#L55-L57 Solution: Use the user defined default on `uom_id` except for service products that are invoiced with timesheets as they need a time unit of measure opw-6139603 Forward-Port-Of: odoo/odoo#262597
This update fixes an issue where Fedex delivery labels were missing a crucial 'REF' field, which is required by the shipping carrier. The fix ensures that all labels now correctly include this reference, preventing potential delivery delays or errors. This improves the accuracy and reliability of our shipping process.
Original PR description
Issue ----- `REF` field of Fedex labels is missing. Steps to reproduce ----- - Setup Fedex - Create a product (set weight) - Create a delivery for the product - Set carrier as Fedex - Validate…
Issue
-----
`REF` field of Fedex labels is missing.
Steps to reproduce
-----
- Setup Fedex
- Create a product (set weight)
- Create a delivery for the product
- Set carrier as Fedex
- Validate delivery
- Opend the label
> REF field is empty
Cause
-----
When filling the `CustomerReferences`, we only specify the SO
https://github.com/odoo/enterprise/blob/aae680f5b86fa87193ba6616e8431eed985b2ee7/delivery_fedex_rest/models/fedex_request.py#L309-L313
The `REF` field is populated using `CUSTOMER_REFERENCE` references, which is not present in this case.
Excerpt of the API DOC
-----
```
"CustomerReference": {
"type": "object",
"properties": {
"customerReferenceType": {
"type": "string",
"description": [...],
"example": "DEPARTMENT_NUMBER",
"enum": [
"CUSTOMER_REFERENCE",
"DEPARTMENT_NUMBER",
"INVOICE_NUMBER",
"P_O_NUMBER",
"INTRACOUNTRY_REGULATORY_REFERENCE",
"RMA_ASSOCIATION"
]
},
"value": {
"type": "string",
"description": [...],
"example": "3686"
}
}
},
```
[...] replaces long description strings, refer to API for full documentation.
Result after fix
-----
<img width="477" height="738" alt="image" src="https://github.com/user-attachments/assets/0d3a0786-5b7d-41cc-8548-2dc7b0f379ab" />
-----
Ticket:
opw-6101620
Forward-Port-Of: odoo/enterprise#116870This update resolves a memory issue that previously prevented users from importing large PDF files into the Documents App. The fix disables a resource-intensive part of the PDF processing library, ensuring smoother and more reliable PDF imports for all users. This improves the overall user experience and prevents data import failures.
Original PR description
### Description: When trying to import a large PDF file into the Documents App, it can sometimes fail because of an Out-of-Memory error (OOM). This is caused by the library `pdfminer.six` and the function `group_textboxes` that helps order the result of the indexing. This function is memory heavy and is not useful for our use case. To avoid it, we can just disable the "advanced layout analysis" by disabling `boxes_flow`. ### Reference: opw-6164752 Forward-Port-Of: odoo/odoo#264301
This update fixes an issue where vendor bills were incorrectly using Swiss tax rates when the invoice originated from a Belgian company. The change ensures that the correct tax rate, based on the invoice's fiscal localization, is applied during the import process. This prevents errors and ensures accurate tax calculations for international transactions.
Original PR description
**Steps to reproduce:** - Create a company in Belgium and set the fiscal localisation accordingly. - In the same company, create a fiscal position in Switzerland, set the foreign tax ID and then…
**Steps to reproduce:** - Create a company in Belgium and set the fiscal localisation accordingly. - In the same company, create a fiscal position in Switzerland, set the foreign tax ID and then generate the taxes for it. - Install the module account_edi_ubl_cii. - Create and invoice for a belgian customer, with one product line having a 0% tax. - Export the invoice as XML. - Go to taxes, filter by purchase, and make sure that the 0% switzerland tax has a higher sequence than the belgian 0% tax. - Import the previous invoice XML as a vendor bill. **Issue:** After importing the bill, the switzerland tax is used even though the fiscal localisation is belgian, which is wrong as it violates the constraint _validate_taxes_country **Solution:** Added a more selective domain to _import_fill_invoice_line_taxes opw-5467936 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265200 Forward-Port-Of: odoo/odoo#255848
This update optimizes how Odoo searches for records linked to binary attachments. Previously, searching for records with no attachment resulted in a slow query. Switching to a more efficient ‘NOT EXISTS’ approach dramatically speeds up this search, especially when dealing with a large number of attachments.
Original PR description
Description of the issue/feature this PR addresses: Searching for records without a binary attachment (e.g., `('binary_field', '=', False)`) previously generated a query using `NOT IN (SELECT res_id…
Description of the issue/feature this PR addresses:
Searching for records without a binary attachment (e.g., `('binary_field', '=', False)`) previously generated a query using `NOT IN (SELECT res_id FROM ir_attachment...)`. On databases with a large `ir_attachment` table, materializing this entire list of IDs causes a significant performance bottleneck.
Replacing NOT IN with a NOT EXISTS allows PostgreSQL to short-circuit the evaluation as soon as it find a matching document, drastically reducing query execution time.
Current behavior before PR:
Searching for a "false-ish" binary with attachment generates a query with a `NOT IN`, slow when `ir_attachment` is large.
```python
>>> env["ir.ui.menu"].search([("web_icon_data", "!=", False)])
2026-03-06 15:59:51,326 516177 DEBUG odoo19 odoo.sql_db: [1.076 ms] query: SELECT "ir_ui_menu"."id" FROM "ir_ui_menu" WHERE ("ir_ui_menu"."active" IS TRUE AND "ir_ui_menu"."id" IN (SELECT res_id FROM ir_attachment WHERE res_model = 'ir.ui.menu' AND res_field = 'web_icon_data')) ORDER BY "ir_ui_menu"."sequence" , "ir_ui_menu"."id"
ir.ui.menu(15, 1, 16)
>>> env["ir.ui.menu"].search([("web_icon_data", "=", False)])
2026-03-06 15:59:54,439 516177 DEBUG odoo19 odoo.sql_db: [0.665 ms] query: SELECT "ir_ui_menu"."id" FROM "ir_ui_menu" WHERE ("ir_ui_menu"."active" IS TRUE AND "ir_ui_menu"."id" NOT IN (SELECT res_id FROM ir_attachment WHERE res_model = 'ir.ui.menu' AND res_field = 'web_icon_data')) ORDER BY "ir_ui_menu"."sequence" , "ir_ui_menu"."id"
ir.ui.menu(62, 68, 3, 10, 43, 59, 4, 28, 44, 65, 6, 7, 29, 41, 45, 61, 66, 5, 18, 30, 31, 48, 49, 60, 69, 70, 9, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 33, 34, 36, 37, 38, 39, 40, 42, 46, 47, 52, 54, 56, 57, 58, 63, 71, 73, 74, 76, 78, 79, 80, 81, 50, 64, 51, 72, 75, 77, 35, 14, 13, 53, 2, 55, 67, 8)
```
Desired behavior after PR is merged:
Searching for a "false-ish" binary with attachment generates a query with a `NOT EXISTS`
```python
>>> env["ir.ui.menu"].search([("web_icon_data", "!=", False)])
2026-03-06 15:59:04,847 513555 DEBUG odoo19 odoo.sql_db: [0.945 ms] query: SELECT "ir_ui_menu"."id" FROM "ir_ui_menu" WHERE ("ir_ui_menu"."active" IS TRUE AND "ir_ui_menu"."id" IN (SELECT res_id FROM ir_attachment WHERE res_model = 'ir.ui.menu' AND res_field = 'web_icon_data')) ORDER BY "ir_ui_menu"."sequence" , "ir_ui_menu"."id"
ir.ui.menu(15, 1, 16)
>>> env["ir.ui.menu"].search([("web_icon_data", "=", False)])
2026-03-06 15:59:08,323 513555 DEBUG odoo19 odoo.sql_db: [0.628 ms] query: SELECT "ir_ui_menu"."id" FROM "ir_ui_menu" WHERE ("ir_ui_menu"."active" IS TRUE AND NOT EXISTS (SELECT 1 FROM ir_attachment WHERE res_model = 'ir.ui.menu' AND res_field = 'web_icon_data' AND res_id = "ir_ui_menu"."id")) ORDER BY "ir_ui_menu"."sequence" , "ir_ui_menu"."id"
ir.ui.menu(62, 68, 3, 10, 43, 59, 4, 28, 44, 65, 6, 7, 29, 41, 45, 61, 66, 5, 18, 30, 31, 48, 49, 60, 69, 70, 9, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 33, 34, 36, 37, 38, 39, 40, 42, 46, 47, 52, 54, 56, 57, 58, 63, 71, 73, 74, 76, 78, 79, 80, 81, 50, 64, 51, 72, 75, 77, 35, 14, 13, 53, 2, 55, 67, 8)
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#252525This update optimizes how the Point of Sale system calculates prices when dealing with large product lists. By streamlining the process, the system now responds faster, particularly when managing a significant number of products and pricing rules. This improves the overall user experience and system efficiency.
Original PR description
The getPrice function in product_template_accounting.js was a performance bottleneck when using large pricelists. This commit introduces the following optimizations: 1. Pre-index pricelist rules by product_id and product_tmpl_id at load time in ProductPricelist. 2. Replace the sort() operation with a single-pass scan to find the best matching rule (highest min_quantity that satisfies the current quantity). 3. Apply sequential rule precedence (Variant → Template → General), stopping as soon as a valid rule is found. 4. Move rule mappings from uiState to direct properties in ProductPricelist to avoid useless reactivity. 5. Centralize rule selection logic in ProductPricelist for better responsibility separation. task-id: 5965826 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#244268
This update significantly speeds up the process of finding BOMs for product records, resolving a performance bottleneck. By optimizing how BOMs are identified, the system now responds much faster, especially when dealing with large product catalogs. This change improves overall system responsiveness and efficiency.
Original PR description
Before this commit, finding a bom for a recordset of `products` involved looping over all the boms and it will loop over all the `product_variant_ids` of `bom.product_tmpl_id` if the bom's…
Before this commit, finding a bom for a recordset of `products` involved looping over all the boms and it will loop over all the `product_variant_ids` of `bom.product_tmpl_id` if the bom's `product_id` is NULL. This approach might loop over variants which we are not trying to find a bom for. In additon to that, due to the fact that multiple boms might have the same `product_tmpl_id`, this approach might consider the same variants in the inner loop redundantly even though we matched the variant with a bom in a previous itration.
Worst case, this might result in a time complexity of $O(N * M)$ where N is the number of boms and M is the number of variants.
To improve the performance, I only considered the variants given in the paramater `products` and in addition to that, I created a new dictionary mapping a `product_tmpl_id` to its bom if the bom doesn't have a variant set. By doing this, I can loop over the `products` given and if it doesn't have a bom set then it will be set to the one its template had taken from the previos loop.
In a method call with the following constraints
- **2** products the method was finding a bom for
- The 2 products had the same template and the template contained **550** active variants
- The boms were only related to the template rather than the variants themselves.
| Input Size | Before | After |
| :--- | :--- | :--- |
| 100 | 0.78s | 0.03s |
| 1000 | 8.53s | 0.11s |
| 10000 | 80.99s | 0.73s |
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#247465This update corrects a previous issue where product manufacturing quantities were incorrectly linked to planned amounts. Now, the system uses the actual quantity produced, providing more accurate inventory and costing data. This ensures better reporting and decision-making related to product availability and production efficiency.
Original PR description
* Before: the manufactured quantity on product use the planned quantity * After: Use actual produced quantity 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#265114 Forward-Port-Of: odoo/odoo#261438
This update resolves an issue where Odoo incorrectly processed only the first business document within an XML file containing multiple invoices. The fix ensures that the system now accurately imports and processes all valid business documents from a single XML file, aligning with Italian tax regulations. This improves the reliability of importing IT invoices.
Original PR description
### Issue before this commit: When importing an XML file containing multiple business documents (multiple bodies with a single header), the system correctly split the file into separate attachments…
### Issue before this commit: When importing an XML file containing multiple business documents (multiple bodies with a single header), the system correctly split the file into separate attachments but failed to process any document beyond the first one. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it 2. Go to Vendor -> Bills 3. Try to upload a xml with multiple bodies and one header 4. See only the first bill is correctly imported ### Cause of the issue: The splitting logic renamed subsequent attachments with numeric suffixes but then this function incorrectly checked the name of the document. https://github.com/odoo/odoo/blob/29805eec2b70144edf9441cffe7e69e39fd4ba0e/addons/l10n_it_edi/models/account_move.py#L297-L305 We can not rely only on the name of the document but we need to check also its content. Refer to the rules for the name of the attachments: https://www.fatturapa.gov.it/export/documenti/Specifiche-tecniche-relative-al-Sistema-di-Interscambio-versione-1.8.4.pdf In summary what we need in the document (page 9): > The unique progressive of the file is represented by an alphanumeric string up to 5 characters long and with allowed values. [az], [AZ], [0-9]. The unique progressive of the file has the sole purpose of differentiating the name of the files transmitted to the Interchange System by the same entity; it does not necessarily have to follow a strict progressive nature and may also present different numbering styles. ### Reason to introduce the fix: This fix ensures that the function not only checks the name but also the content to be sure that the xml or p7m file contains a valid structure to be registered. Ticket [link](https://www.odoo.com/odoo/project.task/6072258) opw-6072258 Forward-Port-Of: odoo/odoo#265079 Forward-Port-Of: odoo/odoo#259887
This update allows users to re-submit invoices that have been previously rejected by the tax authorities (SPV). Previously, rejected invoices were deleted and recreated, losing valuable tracking information. Now, rejected invoices are preserved as part of the history, improving traceability and simplifying the process for users.
Original PR description
Allow users to re-send invoices that were rejected by the SPV. Previously, EDI documents were deleted and recreated on every interaction, losing history in the process. This commit updates existing EDI documents in place instead, preserving failed documents as history for traceability. task-[5976612](https://www.odoo.com/odoo/project/967/tasks/5976612) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#254882
This update fixes inconsistencies in how barcode settings are applied to Manufacturing Orders. Previously, mandatory lot/serial scans weren't reliably enforced, allowing users to bypass validation. Now, the system correctly utilizes MRP operation type configurations, ensuring accurate barcode tracking during production.
Original PR description
Before this commit, the "Allow full order validation" were partially ignored in the Barcode app when used for Manufacturing Orders, and the "Mandatory scan" settings didn't work very well. For…
Before this commit, the "Allow full order validation" were partially ignored in the Barcode app when used for Manufacturing Orders, and the "Mandatory scan" settings didn't work very well. For example, setting the scan of lot/serial as mandatory didn't prevent the user to set automatically a SN on consummed component by generating a lot/serial on the produced product or by clicking on "Produce All" button. This commit adds some conditions to avoid to update barcode lines in case they should depending of the config. This commit also fixes a related issue where the MRP operation type's config wasn't used at all when a MO is created directly from the Barcode app. As the config is get from the MO's picking type and no MO exists when a new one is created from the Barcode app, there is no MO's config returned in the data send by the server. To fix that, the config is now updated clientside when the data are fetched after a save. [Task-5420762](https://www.odoo.com/odoo/project/966/tasks/4655907/project.task/5420762) [opw-5223507](https://www.odoo.com/odoo/project/49/tasks/5223507) Forward-Port-Of: odoo/enterprise#113318
This update fixes a bug that caused duplicate vendor creation during EDI import of Swiss VAT documents. The change ensures correct matching of VAT formats, preventing the system from incorrectly creating new partners when importing Peppol files with Swiss VAT numbers. This improves data accuracy and streamlines import processes.
Original PR description
### Issue: When importing EDI documents such as Peppol files, Swiss VAT numbers are often provided in a flat format (e.g., CHE530781296TVA), while existing Odoo partners usually store them in the…
### Issue: When importing EDI documents such as Peppol files, Swiss VAT numbers are often provided in a flat format (e.g., CHE530781296TVA), while existing Odoo partners usually store them in the official formatted version (e.g., CHE-530.781.296 TVA) This mismatch prevents proper partner matching and may create duplicate partners during import ### Cause: `_retrieve_partner` lacks Swiss-specific VAT normalization logic in `_import_retrieve_customer_from_vat()` As a result, the matching process fails to: - match formatted and unformatted Swiss VAT numbers - properly handle language suffixes such as `TVA`, `MWST`, or `IVA` If `base_vat` is installed, and the imported XML VAT is `CHE530781296TVA`, a new partner will be created with the structure format `CHE-530.781.296 TVA` As the match won't be made new partner will be created at each import ### Steps to reproduce: - Install `account` - Create a Vendor (Name: Test CH Vendor, Country: Switzerland, Tax ID: CHE-530.781.296 TVA) - Import the bill [CH_bill_to_import.xml](https://github.com/user-attachments/files/27202997/CH_bill_to_import.xml) from the ticket Before the fix, the existing partner is not matched and a duplicate partner is created opw-6072239 Forward-Port-Of: odoo/odoo#262011
This update resolves an error that occurred when automatically checking out employees with no defined check-out date, specifically when using the hr_attendance and hr_work_entry_attendance modules. The fix corrects a timezone calculation issue that was creating duplicate overtime entries, leading to a system error. This ensures accurate automatic check-out functionality.
Original PR description
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both…
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both installed. When setting an attendance for an employee that has a check-in date but no check-out date, and running the scheduled action `Automatically check-out employees`, an `expected singleton` error occurs. ## Reproduction Steps 1. Install hr_work_entry_attendance. 2. Create an Employee. In the Payroll tab, set a start date for the contract. In the Settings tab, make sure their timezone is set to Brussels, and set the Overtime Ruleset field to Default Ruleset. 3. In Settings, check the Automatic Check-out box. 4. Go to Attendances. Create an attendance for the employee you just created. Set a Check-in date to 8 am on April 17th, for example, and leave the check-out field empty. 5. Open Scheduled Actions. Search the action Automatically check-out employees and click Run Manually. ### Expected behavior The attendance check-out should be set at the end of April 17th. ### Unexpected behavior An error occurs: `Expected singleton: hr.attendance.overtime.line(39, 40)` ## Origin of the issue When the attendance goes over several days, we set the check-out date to: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L618 This is a Naive date. However, it will later be considered as a UTC date. Because the employee's timezone is Brussels, this time will be transformed to 2 am next day when we retrieve attendance intervals. This will result in the creation of overtime entries for both days, causing the Expected Singleton error. https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L687 https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L667-L672 In our case, `self.check_in` = April 17th at 06:00:00 and `self.check_out` = April 17th at 23:59:59. Converted, we will obtain April 17th at 08:00:00 and April 18th at 1:59:59. Because of that, at the return: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L706-L709 We will return a dict containing 2 intervals: one for 17th April and one for 18th April. We will then create overtime entries with such attendances: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L333 leading to the creation of 2 different overtimes for the same attendance. So, when we retrieve the overtime for that attendance: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L185, We get the 2. Thus when trying to access their status with: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L191 An Expected Singleton Occurs. __ opw-6036064 Forward-Port-Of: odoo/odoo#262257
This update resolves an error that occurred when automatically checking out employees with no defined check-out date, specifically when using the hr_attendance and hr_work_entry_attendance modules. The issue stemmed from incorrect timezone handling, leading to the creation of duplicate overtime entries. This fix ensures accurate automatic check-out calculations based on employee timezone settings.
Original PR description
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both…
__ ## Short functional explanation of the error While investigating for bug reported on ticket 6036064, I found this other bug. It only occurs when hr_attendance and hr_work_entry_attendance are both installed. When setting an attendance for an employee that has a check-in date but no check-out date, and running the scheduled action `Automatically check-out employees`, an `expected singleton` error occurs. ## Reproduction Steps 1. Install hr_work_entry_attendance. 2. Create an Employee. In the Payroll tab, set a start date for the contract. In the Settings tab, make sure their timezone is set to Brussels, and set the Overtime Ruleset field to Default Ruleset. 3. In Settings, check the Automatic Check-out box. 4. Go to Attendances. Create an attendance for the employee you just created. Set a Check-in date to 8 am on April 17th, for example, and leave the check-out field empty. 5. Open Scheduled Actions. Search the action Automatically check-out employees and click Run Manually. ### Expected behavior The attendance check-out should be set at the end of April 17th. ### Unexpected behavior An error occurs: `Expected singleton: hr.attendance.overtime.line(39, 40)` ## Origin of the issue When the attendance goes over several days, we set the check-out date to: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L618 This is a Naive date. However, it will later be considered as a UTC date. Because the employee's timezone is Brussels, this time will be transformed to 2 am next day when we retrieve attendance intervals. This will result in the creation of overtime entries for both days, causing the Expected Singleton error. https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L687 https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L667-L672 In our case, `self.check_in` = April 17th at 06:02:00 and `self.check_out` = April 17th at 23:59:59. Converted, we will obtain April 17th at 08:02:00 and April 18th at 1:59:59. Because of that, at the return: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L706 We will return a dict containing 2 intervals: one for 17th April and one for 18th April. We will then create overtime entries with such attendances: https://github.com/odoo/odoo/blob/b293ce50e0fc9355ffd233557f079916b514eac7/addons/hr_attendance/models/hr_attendance.py#L333 leading to the creation of 2 different overtimes for the same attendance. So, when we retrieve the overtime for that attendance: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L185, We get the 2. Thus when trying to access their status with: https://github.com/odoo/enterprise/blob/2d2056766441157dc45ebc37b677841c44e5c513/hr_work_entry_attendance/models/hr_version.py#L191 An Expected Singleton Occurs. __ opw-6036064 Forward-Port-Of: odoo/enterprise#115828
This update optimizes a key stock query that previously performed very slowly due to complex string comparisons. By replacing these comparisons with a more efficient method of checking location ancestry, the query now runs significantly faster, especially when dealing with large lists of locations. This improves overall system responsiveness.
Original PR description
### Description of the issue/feature this PR addresses: Some stock queries determine whether a location belongs to the subtree of a set of locations by checking the parent_path prefix against…
### Description of the issue/feature this PR addresses:
Some stock queries determine whether a location belongs to the subtree of a set of locations by checking the parent_path prefix against candidate parent locations. This is done using a correlated EXISTS subquery with a LIKE parent.parent_path || '%' condition.
When the list of candidate locations becomes large (for example tens or hundreds of thousands of ids), this approach causes extremely poor performance because the database must repeatedly compare hierarchical path strings for every candidate row.
This PR improves the performance of this ancestry check by replacing the string prefix comparison with a direct check on the ancestor ids contained in parent_path.
### Current behavior before PR:
The query determines whether a location belongs to the subtree of one of the provided locations using:
location.parent_path LIKE parent.parent_path || '%'
For each row, PostgreSQL must evaluate a correlated subquery against all candidate parent locations. Because this relies on string prefix comparisons on parent_path, when the location list is large, this results in extremely slow queries.
### Desired behavior after PR is merged:
Instead of performing string prefix comparisons, the query extracts the ancestor ids directly from parent_path.
The path is:
1. Trimmed to remove leading and trailing /
2. Split into an array of ancestor ids
3. Expanded using unnest
4. Checked for intersection with the provided location ids
This converts the ancestry check from repeated string comparisons into a simple integer membership check.
### Benchmarks
Comparing performance of old subquery:
```
SELECT stock_location_inner.id
FROM stock_location AS stock_location_inner
WHERE EXISTS (
SELECT 1
FROM stock_location parent
WHERE parent.id IN (long list)
AND stock_location_inner.parent_path LIKE parent.parent_path || '%%'
);
```
to new one:
```
SELECT stock_location_inner.id
FROM stock_location AS stock_location_inner
WHERE EXISTS (
SELECT 1
FROM unnest(
string_to_array(trim(both '/' FROM stock_location_inner.parent_path), '/')::int[]
) AS path_id(id)
WHERE path_id.id IN (long list)
);
```
Depending on the number of elements in 'long list'
| # of elements | Before | After |
| --- |---|---|
| 130,000 | 21min | 0.8sec |
| 10,000 | 95sec | 0.5sec |
| 1,000 | 10.5sec | 0.5sec |
In practice, on the reference ticket this causes the "Validate" button on a stock picking to go from timing out to taking 8 seconds.
### Reference
opw-5932436
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#2542456 changes
Resolved issues and error corrections
This update resolves an issue where signed PDF documents lost their original bookmarks and links. The fix ensures that signed documents remain fully navigable and consistent with the original PDF, preserving document structure and integrity for users.
Original PR description
Version - 18.0 Steps to reproduce: 1. Upload a PDF document containing bookmarks and internal/external links. 2. Sign the document and download the signed PDF. 3. Open the downloaded file and check the bookmarks and links. Issue: When a signed document was downloaded, the original PDF bookmarks And the links were not working. This broke structured navigation and affected document integrity. Fix: The PDF signing process has been updated to preserve the original bookmarks and ensure internal and external links remain functional after signing. Impact: - Signed documents remain navigable and consistent with the original PDF. - Preserves document structure and integrity. Task- 4915124 Forward-Port-Of: odoo/enterprise#117741 Forward-Port-Of: odoo/enterprise#108684
This update fixes an error that occurred when selecting shift templates for planning slots, specifically when dealing with long time differences in resource schedules. The change ensures the system gracefully falls back to a previously calculated end date if a valid working interval cannot be found, preventing the error and allowing users to correctly set up their planning.
Original PR description
Currently, an error occurs when a user selects a shift template on a planning slot. **Steps to Reproduce:** - Install the `Planning` module with demo data. - Create a `Resource Time Off` record with…
Currently, an error occurs when a user selects a shift template on a planning slot. **Steps to Reproduce:** - Install the `Planning` module with demo data. - Create a `Resource Time Off` record with `start` and `end date` separated by more than `1400 days (around 3.9 years)`, and Set the Working Hours field to Standard 40 hours/week. - Go to `Planning` > `Configuration` > `Shift Templates`, open an `existing record` or create a `new one`, and set the `Working Days` to more than 1 day. - Create a new `planning slot`, Assign the resource `Abigail Peterson`, and select the above `shift template`. `AttributeError: 'bool' object has no attribute 'replace'` This error occurs because when the user sets the shift template, the compute method runs to calculate the start and end datetimes [1]. It computes the end datetime by adding the template duration in working days from the given start datetime using the resource working calendar within a searchable range of around 1400 days [2]. During this computation, leaves and non-working days are skipped [3]. If no valid working interval is found within the searchable range, then it returns False [4], which raises the error [5]. This commit ensures that if plan_days returns False, the computation falls back to the previously calculated end date. [1]: https://github.com/odoo/enterprise/blob/6ae5d3df6e9305416e4d6f74259cd01753025f42/planning/models/planning.py#L662-L671 [2]: https://github.com/odoo/odoo/blob/a439bd305112f6efc752ce900f7782e7faaf7312/addons/resource/models/resource_calendar.py#L826-L835 [3]: https://github.com/odoo/odoo/blob/a439bd305112f6efc752ce900f7782e7faaf7312/addons/resource/models/resource_calendar.py#L533-L537 [4]: https://github.com/odoo/odoo/blob/a439bd305112f6efc752ce900f7782e7faaf7312/addons/resource/models/resource_calendar.py#L835 [5]- https://github.com/odoo/enterprise/blob/6ae5d3df6e9305416e4d6f74259cd01753025f42/planning/models/planning.py#L653-L654 sentry-7472958590 Forward-Port-Of: odoo/enterprise#117073
This update corrects a previous change that allowed branch companies to be incorrectly designated as payment providers. This restriction is necessary due to limitations in account journals and prevents potential accounting errors. The fix ensures that payment providers are only linked to their parent companies.
Original PR description
Issue: --- Branch companies can be selected as payment provider company, which should be restricted due to the limitation on account jounral. Steps to reproduce: 1- Create a branch company. 2- Add a website to the branch company. 3- Enable a payment provider in the parent company. 4- Duplicate the provider for the branch company and set branch as the company. 5- Navigate to the shop and add a product to cart. 6- Checkout and pay. In the SO, you can check that the payment provider from parent is used. Cause: --- This is introduced after https://github.com/odoo/odoo/commit/b093786714e9e8567cf75abf78ac3d954a3d89b2. That fix ensures providers from parent company to be returned as the branch compatible provider. However, that fix didn't restrict the branch companies to be selected as provider company which we shouldn't allow. #263869 opw-6013978 Forward-Port-Of: odoo/odoo#257622
This update ensures that when a food delivery order is cancelled through the aggregator (Atlas), the corresponding PoS order is also updated to reflect the cancelled status. Previously, PoS orders remained active, leading to inaccurate order tracking. This fix improves order visibility and accuracy for both internal teams and customers.
Original PR description
pos*: pos_urban_piper, pos_enterprise When a food delivery order is cancelled from the aggregator side, the PoS order remains active on the frontend instead of reflecting the cancelled state. Steps to reproduce: - Configure UrbanPiper with Atlas - Place an order via Atlas - Open the order from the notification bar - Cancel the order from Atlas Issues: - Cancelled orders continue to appear in `Draft` - Accepted/preparation orders are not cancelled on the preparation display Fix: - Synchronise the PoS order state with the delivery state on cancellation - Update preparation display orders when delivery orders are cancelled Task-6217704 Forward-Port-Of: odoo/enterprise#117758 Forward-Port-Of: odoo/enterprise#117374
This update resolves an issue where removing a general note from a restaurant order line caused the preparation display to incorrectly mark the line as cancelled and create a new one. The fix ensures that note history is recorded regardless of whether the note is confirmed, allowing the system to update existing order lines instead of creating duplicates.
Original PR description
Steps to reproduce: --------- 1. Create an order with an orderline general note. 2. Send the order to the preparation display. 3. Remove the note from orderline. 4. Resend the order Issue: --------------- Removing the note changes the preparation line key, so the preparation display marks the old line as cancelled and creates a new one instead of updating the existing line. Cause: ----------- The note history was only recorded when the note was confirmed. If the user simply removes/clears the note, no note history entry is generated, so the backend cannot match the previous key with the updated key. Fix: ---------- Record note history even when the note is discarded (not only when confirmed. This allows the backend to match the old and new keys and update the line instead of cancelling it. Task-6101501 Related PR - https://github.com/odoo/odoo/pull/258632 Forward-Port-Of: odoo/enterprise#117449 Forward-Port-Of: odoo/enterprise#113514
This update resolves an issue where the Odoo user interface became unresponsive when managing employees with fully flexible work contracts. The fix ensures that the system correctly handles contracts without a designated calendar, preventing errors and maintaining a stable user experience. It leverages a previously implemented safeguard to ensure proper functionality.
Original PR description
Steps to reproduce 1. Install hr_holidays and hr_contract. 2. Take a demo employee currently on a validated time off covering now. 3. Set the employee's running contract Working Schedule to empty…
Steps to reproduce 1. Install hr_holidays and hr_contract. 2. Take a demo employee currently on a validated time off covering now. 3. Set the employee's running contract Working Schedule to empty (fully flexible). 4. Run the "HR Contract: update state" cron (or otherwise leave the contract in state open / close, or draft + kanban Ready). 5. Open the Employees app or any view rendering that employee's chatter / follower panel. Issue A traceback "Expected singleton: resource.calendar()" is raised. If the employee's chatter is open, the failing compute is re-fired on every store refresh and the UI becomes unusable. For fully flexible contracts, hr.contract has no resource_calendar_id, so _get_calendar_periods appends period tuples with an empty calendar recordset (https://github.com/odoo/odoo/blob/c6d9fa5873eb759846e9be5b66eedb8b00c5ac11/addons/hr_contract/models/hr_employee.py#L184). _get_first_working_interval then forwarded that empty recordset to _work_intervals_batch, which calls ensure_one() and crashes. This regressed when _compute_leave_status was switched from a single calendar lookup to per-period iteration in https://github.com/odoo/odoo/commit/bf73b63eec56a822edec2d9ecfeb231a0fbfbbe8 which did not consider that a period in the chain can come from a contract with no calendar. Solution Fall back to the company's calendar when the period's calendar is empty, matching the guard already present from saas-18.4 onwards in https://github.com/odoo/odoo/commit/21f18b1a6fdbf1a01c3dda83acfa66addd01a759. opw-6168264 Forward-Port-Of: odoo/odoo#261995
13 changes
Enhancements to existing features
This update adds a direct 'Import' option to the spreadsheet file menu, eliminating the need to first upload to Documents. Users can now quickly import .osheet.json, .csv, and .xlsx files directly into their spreadsheets, with files automatically saved to 'MY' (My Drive) for easy access.
Original PR description
Current behavior before PR: - Importing a spreadsheet required uploading the file to Documents first and Then, open it in the spreadsheet view. - This flow was inconvenient for users who simply want to import a file directly while working in a spreadsheet. Desired behavior after PR is merged: - Adds an 'Import' option in the File top bar menu. It opens the OS file picker and allows importing supported files such as .osheet.json, .csv, and .xlsx directly into the spreadsheet. - Imported files are uploaded to the 'MY' (My Drive) folder, so they remain accessible later from the Documents app as well. Task: [6000071](https://www.odoo.com/odoo/project/2328/tasks/6000071)
This update adds convenient buttons to the payslip and attendance forms, streamlining access to related information. Users can now quickly view their total leave days taken and link to the corresponding leave requests, as well as directly access the linked payslip from their attendance records. This enhances usability and reduces the time spent navigating between modules.
Original PR description
On the payslip form view, added a smart button that shows the total number of leave days taken, and when clicked, it redirects to the list of leave requests. On the attendance form view, added a smart button that shows the linked payslip. And when clicked, it redirects to that payslip. task-6089721
This update simplifies the rental schedule view, making it easier for users to understand booking resources. The changes include displaying resource counts alongside product names and hiding unnecessary visual elements on initial load. This enhances usability and provides a clearer picture of rental availability.
Original PR description
Improve clarity and usability of the rental schedule view by removing the default confirmed filter, showing linked resource counts in product names when Plan Services is enabled, and hiding the collapse icon and consolidation (green lines) on initial load. task-6031386 For Documentation PR see: https://github.com/odoo/documentation/pull/17726
This update introduces a new popup that displays actual demand for products, mirroring the functionality for actual replenishment. This allows users to quickly see and address demand discrepancies, particularly for products with indirect demand as components. The popup offers options to adjust Deliveries or create MOs to meet this demand.
Original PR description
Add a popup for the Actual Demand that works the same way as the one for Actual Replenishment. It contains 2 buttons: - Deliveries - MOs (for when a product has indirect demand as a component)
This update simplifies the appearance and organization of the accounting settings within Odoo Enterprise. The changes focus on a more compact and intuitive presentation, particularly addressing confusion around customer payments and streamlining the overall user experience. This enhancement improves clarity and ease of use for accounting professionals.
Original PR description
Improve the overall presentation of the accounting settings. Initial setup: better and more compact presentation. Digitization: clearer structure. Customer payments: reduce confusion between SEPA QR codes and other QR codes. task-6076397
Resolved issues and error corrections
This update fixes an issue where project update descriptions incorrectly showed inflated budget totals after budget revisions. The fix ensures that only the active, confirmed budget revision is used, providing accurate budget information for project updates. This improves the reliability of project cost tracking.
Original PR description
**Problem:** When a project analytic budget is revised, the project update description shows an inflated total budget — the sum of both the original and the revised amounts — instead of reflecting…
**Problem:** When a project analytic budget is revised, the project update description shows an inflated total budget — the sum of both the original and the revised amounts — instead of reflecting only the active (confirmed) revision. **Steps to reproduce:** 1. Create a project with an analytic account 2. Create an analytic budget of $10,000 and confirm it 3. Create a revision of that budget for $15,000 and confirm it 4. Create a new project update 5. The update shows "$25,000" as the total budget instead of "$15,000" **Current behavior:** The project update displays the sum of all budget revisions ($25,000), regardless of their state. **Expected behavior:** Only the active confirmed budget ($15,000) should be used. **Cause of the issue:** `_compute_budget` queries all `budget.line` records matching the project's analytic account without filtering by the parent `budget.analytic` state. When a budget is revised, the original transitions to state `revised` while the new one becomes `confirmed`. Because `_compute_budget` has no state filter, it sums both, producing an inflated `total_budget_amount`. This field is then used in the project update template to compute the displayed budget total and percentage. By contrast, `_get_budget_items` — used for the detail rows — already applies `state in ['confirmed', 'done']`, so the two methods were inconsistent. **Fix:** Applying the same state filter to `_compute_budget` as already present in `_get_budget_items` ensures both methods draw from the same set of active budgets, keeping the project update totals consistent with the budget detail rows. opw-6128855 Forward-Port-Of: odoo/enterprise#117490 Forward-Port-Of: odoo/enterprise#115285
This update fixes an issue where the Point of Sale (PoS) displayed incorrect order totals due to delays in price calculations. By manually triggering the price calculation process during order validation, the system now accurately displays the total amount on the feedback screen. This ensures accurate pricing and a better user experience for PoS transactions.
Original PR description
We now call manually `setOrderPrices` on order validation to ensure `amount_total` is set on the order before displaying the feedback screen which depends on it. The issue is that requests to the FdM delay the call to this method, making the PoS display `0` as the amount is `undefined` in the meantime. We also ensure the PoS doesn't finalize the validation if an error occurs. see odoo/odoo#244298 Forward-Port-Of: odoo/enterprise#117767 Forward-Port-Of: odoo/enterprise#104468
This update ensures consistent and accurate MPF contribution eligibility for employees in Hong Kong. The changes align the age criteria for mandatory contributions and reporting, resolving a previous inconsistency that impacted contribution calculations and reporting accuracy for employees under 18. This improves payroll compliance and reporting.
Original PR description
### Before: - Mandatory MPF rules only checked the upper age bound (< 65 from period start). - Employees under 18 could still be considered eligible for EEMC/ERMC contributions. - eMPF reporting had a separate 16-year age check. - Employees younger than 16 were excluded from the eMPF report, even when they had voluntary contributions. ### After: - Mandatory MPF rules now apply a full age gate (18 to under 65) across the payslip period. - EEMC and ERMC use the same eligibility condition for consistent contribution behavior. - The eMPF reporting age check is now aligned to 18. - Employees under 18 remain excluded from eMPF reporting unless they have actual MPF contributions. - Under-18 employees with voluntary contributions are now included in the eMPF report, matching the existing over-65 voluntary contribution behavior. --- Task-6141664 Forward-Port-Of: odoo/enterprise#117205
This update fixes an issue where salary adjustments weren't being properly calculated after a pay run was temporarily set to 'draft' and then rerun. The fix automatically recomputes input lines and now displays a warning message on the payslip to indicate a salary attachment has been created, ensuring accurate payroll calculations.
Original PR description
**Steps to Reproduce**: 1. Run the pay run for a specific month 2. Validate the payslip 3. Create a salary adjustment starting within this month. 4. Set the pay run to draft 5. Rerun the pay run for this month The salary adjustment is not computed. **Fix**: Recompute input lines when payrun is set to draft. Show Warning message on payslip that salary attachment is created. **task**-6148499
This update resolves an issue where selecting multiple resources in the Planning app's resource field would cause an error. The fix ensures that the system correctly handles multiple resource selections, improving usability and preventing data entry problems. This change allows users to efficiently manage resources within the Planning module.
Original PR description
Currently, selecting multiple resources in planning causes an error. ### **Steps to reproduce:** 1) Install Planning with demo data 2) Go to the Planning app and click on `New` 3) In the Resource field, open the dropdown, click Search More, select multiple records, then click Select ### **Error:** ``` TypeError: ResourceResource.get_materials_assigned_to_human_resources() takes 1 positional argument but 18 were given ``` ### **Root Cause:** At [1], a single argument is passed to `get_materials_assigned_to_human_resources`, but the field allows selecting multiple records, which leads to the error. [1]: https://github.com/odoo/enterprise/blob/8a843b69a59bc915fb6163aab03b144c2c93ac6b/planning/static/src/views/fields/many2many_avatar_resource/many2many_avatar_resource_field.js#L46C16-L50 ### **Fix:** Handle multiple records when calling `get_materials_assigned_to_human_resources`. **opw-6192072** Forward-Port-Of: odoo/enterprise#116580
This update resolves an issue where order synchronization with Lazada was failing due to incorrect package data. The fix ensures that the system skips package synchronization when package information is missing, preventing errors and allowing orders to be processed smoothly. This improves the reliability of Lazada order imports.
Original PR description
orders can omit package data in the API payload if the package id doesn't match. When a picking still had a package_extern_id, filtering order_items by that id produced an empty list, and max() on the resulting timestamps raised ValueError and blocked order sync. Return early when no matching package lines exist so sync can continue. taskId - 6195507 Forward-Port-Of: odoo/enterprise#117194
This update corrects a problem where the ABA file generated for payroll payments was blank. The fix ensures the payslip batch is assigned before payment validation, guaranteeing the ABA file contains the correct payment information. This resolves a previous issue and improves the reliability of payroll reporting.
Original PR description
Payslip batch needs to be assgned before the payment batch is validated, otherwise the ABA file will be blank. This commit ensures that flow and the test ensure both aba flows generate the same file content. task-6123029 Forward-Port-Of: odoo/enterprise#117674 Forward-Port-Of: odoo/enterprise#114970
Code cleanup and technical improvements
This update simplifies the management of point-of-sale (POS) functionality by separating it from a previous utility. Additionally, the team addressed critical issues related to the 18.0 certification process for the EU IoT scale feature, ensuring compliance. This improves code organization and stability.
Original PR description
In order to simplify reuse of `IotScale` utility, we extract pos logic from it (move it to `ScaleScreen`). We also fix some `l10n_eu_iot_scale_cert` issues by updating the previously frozen code (for 18.0 certification).
5 changes
Enhancements to existing features
This update improves the configuration for GT Electronic Data Interchange (EDI) branches. Specifically, VAT information is no longer inherited, while key credentials for the EDI connection are now consistently managed. Additionally, configuration settings are now properly displayed for these branches, ensuring accurate setup and operation.
Original PR description
While creating branches for GT country, VAT shouldn't be inherited, while Infile credentials (l10n_gt_edi_ws_prefix, l10n_gt_edi_infile_token, l10n_gt_edi_infile_key) should. At the same time, config keys should also appear for branches on settings task-[6087168](https://www.odoo.com/odoo/project/967/tasks/6087168)
Resolved issues and error corrections
This update corrects a bug in the German Point of Sale (POS) module that was caused by recent accounting changes. Specifically, a calculation error related to change amounts was fixed to ensure accurate payment processing, particularly when the change is negative. This ensures correct cash payment type handling for remaining order amounts.
Original PR description
Since the refactoring of the accounting in the pos, the change getter on the pos is returning a value different from 0 if the change is bigger than 0. If it is smaller, it returns 0 and remainingDue should be used to know the remaining due of an order. In l10n_de_pos_cert, the change was checked in _createAmountPerPaymentTypeArray to enter an if. In javascript, a negative value in an if statement is truthy so when the change was negative, the code entered the if statement which is not the case anymore. We add an if with the remainingDue to add the remaining due as a cash payment type if there is still an amount due runbot-error: 241251
This update fixes an issue where the End Balance columns in the Romanian Trial Balance reports were displaying incorrect totals when the report hierarchy was enabled. The fix eliminates double-counting of account groups, ensuring accurate financial reporting and consistency across all trial balance reports.
Original PR description
### Issue before this commit: The total row for the End Balance columns in the Romanian 4-column and 5-column Trial Balance reports displayed incorrect values when the report hierarchy was enabled. ### Steps to reproduce the issue: 1. Downaload Accounting and l10n_ro 2. Switch to RO company 3. Go to Trial Balance report and be sure that Posted Entries, Accrual Basis are setted on Hierarchy and Subtotals 4. See that the End Blance both debit and credit is not correct ### Cause of the issue: The _custom_line_postprocessor method iterated over all report lines indiscriminately, adding account group subtotals to the running accumulator and causing duplicate counting. ### Reason to introduce the fix: To eliminate group double-counting and providing consistency with the totals in all the trial balances reports. opw-6146200
This update resolves an issue where extremely long invoice references in the general ledger report caused the PDF generation process to fail due to excessive file open operations. By limiting the display name length, we prevent the PDF from becoming overly large and ensure reports generate successfully, even with many batched invoices.
Original PR description
The display name of the account.report.line in the general ledger report has the format of: INVOICE NAME (invoice refs) In the case where a client has hundreds of sales orders batched to a single…
The display name of the account.report.line in the general ledger report has the format of: INVOICE NAME (invoice refs) In the case where a client has hundreds of sales orders batched to a single invoice, the ref can become extremely long, e.g.: INV/2026/00001 (S12123, S12152, S12159, S12140, S12165, S12161, S12162, S12110, S12099, S12124, S12145, S12128, S12114, S12131, S12097, S12185, S12154, S12133, S12190, S12118, S12116, S12102, S12155, S12153, S12158, S12150, S12100, S12142, S12121, S12122, S12111, S12187, S12172, S12177, S12095, S12117, S12144, S12137, S12092, S12138, S12186, S12182, S12112, S12148, S12183, S12101, S12178, S12119, S12169, S12115, S12146, S12093, S12126, S12160, S12163, S12129, S12098, S12151, S12096, S12174, S12120, S12130, S12147, S12180, S12191, S12164, S12141, S12105, S12136, S12139, S12109, S12106, S12104, S12103, S12175, S12179, S12188, S12113, S12173, S12167, S12171, S12134, S12094, S12184, S12166, S12170, S12125, S12135, S12143, S12176, S12189, S12156, S12181, S12107, S12157, S12132, S12149, S12127, S12108, S12168...) Because the length of the account.report.line is unchecked in account_general_ledger.py label builder, the pdf can clog to one or two account.report.lines per page, skyrocketing the pdf page length. As wkhtmltopdf processes the report from html to pdf it makes a system call openat() to the /tmp/report.footer.tmp.x.html file for EACH page of the pdf. You can see the TODO comment in the spoolTo function in wkhtmltopdf (both in Odoo and the original repo) saying that the header and footer need to be freed, on each page processing, not just null pointed. https://github.com/odoo/wkhtmltopdf/blob/2c884bd1545b8a639847de22f24754ee5a6fc44c/src/lib/pdfconverter.cc#L794 I verified that that the number of openat calls to the /tmp/report.footer.tmp.x.html file equals the exact number of pages in the pdf to be generated if the report HAD generated successfully by setting the footer input into _run_wkhtmltopdf to None, generating the report without footers, then separately running an strace on wkhtmltopdf when the report fails to generate. See related ticket linked at bottom. The linux machine used on sh instances has a ulimit -n of 1024 file descriptors. Because the footer file descriptors accumulate, once a pdf has about 1010+ pages (~a dozen fd's are allocated for other purposes), over 1024 file descriptors are opened and the system fails with: Wkhtmltopdf failed (error code: -6). Message: QEventDispatcherUNIXPrivate(): Unable to create thread pipe: Too many open files QEventDispatcherUNIXPrivate(): Can not continue without a thread pipe Since wkhtmltopdf is archived and Odoo has a replacement in development, I suggest that we limit the display_name of the account.report.line to 200 to keep the bloat minimized, preventing one account.report.line's name from taking up an entire page of the general ledger pdf. This allows many more batched invoices to be shown in the report and a much greater time range of data to be printed without hitting the fd limit. I suggest changing it at the general ledger report level rather than in the account.move.line _compute_display_name function, as we probably still want to see the full display_names at the invoice level. On runbot, the machine has different memory constraints than on sh / local, so it hits the following error before the one above: Wkhtmltopdf failed (error code: -11). Memory limit too low or maximum file number of subprocess reached. Message : 1. newdb -n test_gl -v 19.0 2. ensure ulimit is set to 1024 in shell that runs odoo instance by running ulimit -n 1024 to mimic ulimit of sh environment 3. run db with python3 odoo-bin, ensuring high enough memory constraints to simulate multi worker sh instance, i.e. --limit-memory-soft=12884901888 --limit-memory-hard=1288490188 4. install sales, accounting, stock 5. install demo data 6. create invoices with 100+ associated sales orders 7. generate the pdf 8. Increase the amount of invoices till the general ledger page count hits ~1010+, where you will hit the error. opw-ticket-6201508 closes #
This update resolves an issue where the delivered quantity for dropship products was incorrectly set to 1 in certain sales order scenarios. The fix ensures that the delivered quantity accurately reflects stock pickings and confirms the correct quantity is calculated upon purchase order confirmation. This improves the accuracy of dropship order fulfillment.
Original PR description
### Steps to reproduce: - In the settings enable dropshipping - Create a storable product P, enable the dropshipping and set a vendor - Create and confirm a sale order for a field service - Open the…
### Steps to reproduce: - In the settings enable dropshipping - Create a storable product P, enable the dropshipping and set a vendor - Create and confirm a sale order for a field service - Open the related task > Products > Add 1 unit of P - Go back to the sale order > an RFQ has been created #### > The delivered quantity of P is set to 1 ### Cause of the issue: Since 2361368acfe7fecbffde2ca26392eb89aecdc9e1 the `_inverse_fsm_quantity` method manually adapts the delivered quantity based on the fact that the `product.service_type` is `manual` rather than the `qty_delivered_method` of the line or future line is. In particular, because these lines: https://github.com/odoo/enterprise/blob/8f4fe902cb71c49bdb3caf9915f9a5abfe6f237f/industry_fsm_sale/models/product_product.py#L82-L83 provide a value of the `qty_delivered` to the created purchase order line and since the `qty_delivered_method` is a precomputed field: https://github.com/odoo/odoo/blob/fdfd9851393ff82a265997478886bcad6da357d0/addons/sale/models/sale_order_line.py#L225-L237 The fact that the purchase order line will be created with a `stock_move` `qty_delivered_method` and that the generated PO does not generate any move prior to confirmation will not trigger the dependency of the `qty_delivered` to retrigger a computation of the `delivered_qty` of the product which is suppose to be based on stock pickings: https://github.com/odoo/odoo/blob/fdfd9851393ff82a265997478886bcad6da357d0/addons/sale/models/sale_order_line.py#L871-L876 https://github.com/odoo/odoo/blob/fdfd9851393ff82a265997478886bcad6da357d0/addons/sale_stock/models/sale_order_line.py#L193-L198 Leaving the created sol with a delivered quantity of 1 prior to confirmation of the PO (which will generate move_ids related to the sol and trigger the compute). Fix: The changes of 2361368acfe7fecbffde2ca26392eb89aecdc9e1 regarding the `_inverse_fsm_quantity` appears unjustified with respect to the purpose of the fix. In addition, the `qty_delivered` and changes are already expected to be properly computed when the `qty_delivered_method` is not manual, particularly since the '`manual'` `service_type` is actually the default `service_type` corresponding to any 'consu' product and looks unrelated by any mean to the `delivered_qty` computation: https://github.com/odoo/odoo/blob/fdfd9851393ff82a265997478886bcad6da357d0/addons/sale/models/product_template.py#L165-L167 opw-6104326 Forward-Port-Of: odoo/enterprise#115760
10 changes
Resolved issues and error corrections
This update fixes an issue where Swiss payroll tax calculations were incorrect. The change removes a technical setting that was incorrectly treating taxes as 'excluded' for Swiss payslips, ensuring accurate tax reporting in accordance with Swiss regulations. This improves the reliability of payroll processing for Swiss companies.
Original PR description
Steps to reproduce: ---------------------------------------- - Install the l10N_ch localization. - Create an 8.1% purchase tax (tax included). - Add the tax created in step 2 to the credit account in…
Steps to reproduce: ---------------------------------------- - Install the l10N_ch localization. - Create an 8.1% purchase tax (tax included). - Add the tax created in step 2 to the credit account in wage type 1910. - Create an employee in the Swiss company and create a certificate type in the wage statement tabulation of the employee record. - Create a contract for the employee created in step 4. - Ensure that wage type 1910 is present in the contract created in step 5 and set the contract's status to 'Running'. - Generate a new payslip for the employee created in step 4. - Compute the sheet and create the draft entry. - The tax amount is not calculated correctly. Cause: ---------------------------------------- In Swiss payslips taxes are always computed as excluded because of [`_prepare_product_base_line_for_taxes_computation()`](https://github.com/odoo/odoo/blob/30b525062fee48a453162e4f8087000b3c7dcd24/addons/account/models/account_move.py#L1510). Solution: ---------------------------------------- Override `_prepare_product_base_line_for_taxes_computation` and remove the special mode. opw-4997536
This fix ensures that website customers correctly inherit the intended pricelist when created. Previously, the system incorrectly reverted to the global default pricelist. The update adjusts how the system determines the pricelist based on website context, resolving this issue and improving price accuracy for website users.
Original PR description
Steps to reproduce: =================== 1. Create 2 pricelists, pricelist 1 is backend-only (no website_id, not selectable), pricelists 2 have website_id set 2. Create a website form creating a…
Steps to reproduce: =================== 1. Create 2 pricelists, pricelist 1 is backend-only (no website_id, not selectable), pricelists 2 have website_id set 2. Create a website form creating a customer with a pricelist field 3. Submit the form selecting pricelist 2 (first website-available one) => Pricelist reverts to pricelist 1 (the global default) Cause: ====== When creating a partner via a website form with a specific pricelist, the inverse of `property_product_pricelist` calls `_get_country_pricelist_multi` to determine the "default" pricelist and decide whether to store the value explicitly or store False (meaning "use the default"). With `website_sale` installed, the search domain hook adds website-availability filtering during website requests. This causes the inverse to compute a different "default" pricelist than what the compute uses outside the website context. The inverse sees pricelist 2 as the "website default" (first by sequence matching the website domain) and stores False. The compute later runs without website context, finds pricelist 1 as the global default, and returns the wrong value. Solution: ========= The fix bypasses website filtering in the search domain hook when called from the inverse, ensuring the stored value is based on the context-independent default. opw-6092161 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update resolves an issue where unit prices displayed on invoices and quotations were showing excessive decimal places when using fiscal position remapping (e.g., EU intra B2B). The fix ensures prices are rounded to the correct currency precision, maintaining accurate fiscal calculations and improving data consistency. This impacts sales pricing and reporting accuracy.
Original PR description
**problem:** When taxes are configured as tax-included and a fiscal position remaps them (for example from NL 21% ST to EU intra B2B 0% EX EU G), the computed unit price is stored with excessive…
**problem:** When taxes are configured as tax-included and a fiscal position remaps them (for example from NL 21% ST to EU intra B2B 0% EX EU G), the computed unit price is stored with excessive decimal digits (e.g 82.644628099...) **steps to reproduce:** 1. Install `l10n_nl` 2. Switch to the Dutch company/ NL company 3. Ensure fiscal position `EU intra B2B` maps `21% ST` to `0% EX EU G` 4. Set tax `21% ST` as tax included 5. Create a product with sales tax `21% ST` 6. Create a quotation/invoice, apply fiscal position `EU intra B2B` 7. Add the product line (or change fiscal position on an existing line and update taxes) 8. You will see `price_unit` displays too many decimals **cause:** In both `sale.order.line._reset_price_unit` and `account.move.line._compute_price_unit` unit prices coming from tax-included remapping are written directly to price_unit. https://github.com/odoo/odoo/blob/7302b504fc03583944f4dff947cf9725fec9a75b/addons/sale/models/sale_order_line.py#L598-L602 https://github.com/odoo/odoo/blob/7302b504fc03583944f4dff947cf9725fec9a75b/addons/account/models/account_move_line.py#L871-L878 The tax remapping path uses tax detail computations with 'global' rounding to preserve fiscal accuracy during conversion, but the resulting `price_unit` was written back without currency rounding. https://github.com/odoo/odoo/blob/7302b504fc03583944f4dff947cf9725fec9a75b/addons/account/models/account_tax.py#L1303-L1310 **fix:** - Round computed `price_unit` with document currency precision before storing in both sale_order_line, account_move_line. - In `account.move.action_update_fpos_values`, recompute from untaxed base when tax include mode changes, then round with currency precision. (We do this change to ensure behavior is consistent, when changing fiscal position and clicking "update taxes" on already existent quotations/invoices" opw-6081856 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update prevents branch companies from being incorrectly designated as payment providers. Previously, a configuration issue allowed branch companies to use payment providers set up in the parent company, which could cause accounting discrepancies. This fix ensures proper account journal management and prevents potential errors during payment processing.
Original PR description
Issue: --- Branch companies can be selected as payment provider company, which should be restricted due to the limitation on account jounral. Steps to reproduce: 1- Create a branch company. 2- Add a website to the branch company. 3- Enable a payment provider in the parent company. 4- Duplicate the provider for the branch company and set branch as the company. 5- Navigate to the shop and add a product to cart. 6- Checkout and pay. In the SO, you can check that the payment provider from parent is used. Cause: --- This is introduced after https://github.com/odoo/odoo/commit/b093786714e9e8567cf75abf78ac3d954a3d89b2. That fix ensures providers from parent company to be returned as the branch compatible provider. However, that fix didn't restrict the branch companies to be selected as provider company which we shouldn't allow. #263869 opw-6013978 Forward-Port-Of: odoo/odoo#257622
This update fixes an issue where fixed taxes weren't correctly excluded from global discounts in the POS system. Previously, applying a discount reduced the total amount, which is now corrected to accurately reflect the tax structure. This ensures accurate order totals and improved the POS discount functionality.
Original PR description
When applying a global discount, the amount of fixed taxe was reduced by that disocunt. This is not correct for fixed amount taxes. Steps to reproduce: ------------------- * Enable global discount * Configure a fixed-amount tax and a regular percentage tax (e.g. VAT) on the same product. * In POS, add this product to an order. * Apply a global discount > Observation: Total is not correct. Why the fix: ------------ Only taxes that accountTaxHelpers.can_be_discounted allows (mirroring account.tax._can_be_discounted, i.e. not fixed or code) are linked on the global discount line. The discount product line is excluded from lines considered for the global discount base. opw-6138507
This update resolves a technical issue preventing Viva payments in the POS kiosk. The Viva payment system required a unique 'cashRegisterId' in the payment request, which was previously missing. The fix ensures this ID is automatically generated from the cashier's name, guaranteeing successful payment processing with Viva.
Original PR description
When validating a payment in POS Kiosk with Viva payment method we get a Viva.com error Viva’s card-terminal API validates the JSON body with Pydantic and requires a non-empty ``cashRegisterId``. Steps to reproduce: ------------------- * Open POS in kiosk * Make an order and pay with Viva > Observation: Viva returns a validation error: ``cashRegisterId`` is missing or required in the request body (Pydantic ``missing`` on ``body.cashRegisterId``). Why the fix: ------------ Compute ``cashRegisterId`` in the POS client as cashier name, then ``pos.config.name`` so the value is always a non-empty string sent to ``viva_wallet_send_payment_request``. opw-6091223
This update optimizes the process of exporting large datasets (like invoices or sales records) to XLSX or CSV files. Previously, the system loaded all records at once, leading to memory issues. Now, data is processed in batches, reducing memory usage and improving export speeds.
Original PR description
When exporting a number N of records as XLSX or CSV file, we call the export_data() method for the N records at the same time. This method prefetches the selected fields for all the records which can lead to memory limit errors when N is too large. We propose to batch this call and invalidate the recordsets between batches. Benchmarks ----------- Execution time: | No records | Before PR | After PR | |------------|-----------|----------| | 70 260 | 3.82 s | 3.94 s | | 228 116 | 18.71 s | 19.36 s | | 394 381 | 31.02 s | 32.67 s | Memory usage: | No records | Before PR | After PR | |------------|-----------|----------| | 70 260 | 316.0 MB | 273.5 MB | | 228 116 | 796.9 MB | 620.8 MB | | 394 381 | 1.3 GB | 947.7 MB | opw-5881026 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes an issue where by-products weren't being correctly tracked during Manufacturing Order validation. Previously, the system reset by-product quantities to their original values, leading to inaccurate production records. This change ensures by-products are accurately reflected in the MO's output.
Original PR description
Backport of:
- https://github.com/odoo/odoo/commit/1dac720a74547e7120d14733c7abda81e959fb3c
- https://github.com/odoo/odoo/commit/7e21cb9befae0e9ce1eabafc2d5366de5097547c
Steps to reproduce:
- Create a product P1 with the Follwing BoM:
- 1 component C1 (10 units)
- 1 by-product BP1 (10 units)
- Create a Manufacturing Order for 1 unit of P1 and confirm it
- Set quantity to 5 units for C1 and 5 units for BP1
- Set Consumed = True for C1 and Produced = True for BP1
- Validate the MO
Problem:
C1 is correctly validated with 5 units, but BP1 is reset to 10 units
_onchange_quantity only checks raw_material_production_id to set `manual_consumption = True`, so by-products (which use production_id) never get `manual_consumption` set. As a result, `_set_qty_producing` does not skip the by-product move and resets its quantity to the product_uom_qty on validation.
opw-6221482This update allows users to re-submit invoices that were previously rejected by the Romanian tax authority (SPV). Previously, rejected invoices were deleted and recreated, losing important tracking information. Now, rejected invoices are preserved as a history, improving traceability and simplifying the process of resolving issues with the SPV.
Original PR description
Allow users to re-send invoices that were rejected by the SPV. Previously, EDI documents were deleted and recreated on every interaction, losing history in the process. This commit updates existing EDI documents in place instead, preserving failed documents as history for traceability. task-[5976612](https://www.odoo.com/odoo/project/967/tasks/5976612) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes an issue where extra prices on combo products weren't correctly converted to the sale order's currency, leading to inaccurate totals. The change ensures that extra prices are properly converted, resulting in accurate pricing calculations for sales orders using different currencies. This improves the reliability of sales order pricing.
Original PR description
The total of a sale order containing a combo product that has an extra price is not correclty converted to the sale order's pricelist currency Steps to reproduce: 1. Install Sales 2. Go to Invoicing…
The total of a sale order containing a combo product that has an extra price is not correclty converted to the sale order's pricelist currency Steps to reproduce: 1. Install Sales 2. Go to Invoicing > Configuration > Accounting > Currencies and activate currency MXN 3. Go to Sales > Products > Pricelists and create a new pricelist for currency MXN 4. Go to Sales > Products and create a new combo product "test" 5. Create a combo choice "combo" with options "Large Cabinet" and extra price 10000$ 6. Go to Sales and create a new quotation for customer Acme Corporation with product "test" (total is $10,001) 7. Change the pricelist to MXN and update prices 8. The total is ~MX$10,018 (it should be ~MX$186,682) Issue: The extra price of a combo product is not converted to the sale order's pricelist currency, so we end up adding the price of the product in the order's currency with the extra price not converted Solution: Convert the extra price of the combo product to the sale order's pricelist currency opw-6192935