Daily updates from Odoo
Navigate
Branch
Tuesday, May 26, 2026
294 changes
38 changes
Enhancements to existing features
This update adds a new test to ensure the structure of payment data sent to our payment processor, Odoofin, remains consistent. This helps prevent unexpected changes on Odoofin's side and ensures that any necessary updates are made in both our system and theirs. It's a preventative measure to maintain reliable payment processing.
Original PR description
Add a test asserting the payment payload structure sent to Odoofin. The goal is to safeguard against unintended payload changes that are not handled on Odoofin's side by making such changes explicit during testing, and reminding developers that corresponding updates may also be required there. No task ID Forward-Port-Of: odoo/enterprise#118182 Forward-Port-Of: odoo/enterprise#117260
Resolved issues and error corrections
This update restricts the AI button's functionality within the website builder to only 'website.page' records. Previously, it was available across all website pages, leading to potential misuse. This change improves the website builder's usability and ensures AI features are applied appropriately.
Original PR description
Previously, the AI button was enabled across all pages in the website builder, including contexts where its usage is not applicable. This PR introduces the following changes: 1. Disable the AI button for pages not linked to "website.page" records with a tooltip explaining the restriction. 2. Hides the AI button when the sidebar is open in translation mode. task-6148588
This update resolves an issue where downloading signed documents through the Sign app would occasionally fail due to a compatibility problem with the pypdf library. The fix moves the document compression step to the correct object, ensuring compatibility with newer versions of pypdf and preventing errors. This improves the reliability of document downloads.
Original PR description
This [related PR] introduced a compression pass after calls to mergePage(). However in newer versions of pypdf (>=3.5.2), compress_content_streams() can only be called on pages of PdfWriter. An error would be raised when called on pages of a PdfReader. Steps to reproduce ----- 1. Run Odoo with pypdf>=3.5.2 2. Sign and download a document in the Sign app 3. Traceback occurs Fix ---- This commit moves the compression to the writer object, after the merged page has been added. Related pr: https://github.com/odoo/odoo/pull/261879 runbot-937761 Forward-Port-Of: odoo/odoo#266223 Forward-Port-Of: odoo/odoo#265304
A recent update to Odoo's document signing process caused errors when downloading signed documents. This fix corrects a problem with how PDF compression was handled, specifically related to newer versions of the pypdf library. The change ensures documents download correctly, improving the user experience within the Sign app.
Original PR description
This [related PR] introduced a compression pass after calls to mergePage(). However in newer versions of pypdf (>=3.5.2), compress_content_streams() can only be called on pages of PdfWriter. An error would be raised when called on pages of a PdfReader. Steps to reproduce ----- 1. Run Odoo with pypdf>=3.5.2 2. Sign and download a document in the Sign app 3. Traceback occurs Fix ---- This commit moves the compression to the writer object, after the merged page has been added. Related pr: https://github.com/odoo/odoo/pull/261879 runbot-937761 Forward-Port-Of: odoo/enterprise#118271 Forward-Port-Of: odoo/enterprise#117756
This update simplifies the process of inserting dynamic fields within Odoo's Powerbox editor. It adds a familiar keyword, 'dynamic placeholder,' allowing users accustomed to the older method to easily locate and utilize the Dynamic Field command. This enhances usability and reduces potential confusion.
Original PR description
This PR adds a search keyword so users who were used to dynamic placeholder to insert the Dynamic Field command can still find it in powerbox. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#266021
This update ensures that WhatsApp channel avatars in the sidebar accurately reflect the members who are part of the channel. Previously, adding a member would display a default avatar instead. This fix corrects a bug where the system wasn't correctly identifying the WhatsApp member for channels, improving the user experience.
Original PR description
WhatsApp sidebar avatars should be resolved from the channel's whatsapp member, not from an arbitrary non-self member. Before this fix, adding a member to a WhatsApp channel caused the default Discuss avatar to be displayed instead of the actual WhatsApp member's avatar. This happened because the correspondent was not correctly computed for channels of type whatsapp. task-[5879840](https://www.odoo.com/odoo/project/1519/tasks/5879840) Forward-Port-Of: odoo/enterprise#118012 Forward-Port-Of: odoo/enterprise#115745
This update fixes an issue where empty cells within styled tables weren't properly recognized during selection using the HTML editor's move handle. Now, all table cells, even those with placeholder content, are correctly identified and selectable, ensuring consistent and reliable table manipulation.
Original PR description
#### Description of the issue this PR addresses: - Empty `.o_table` cells containing only placeholder ZWS content were not considered visible - Full table selection via move handle failed to apply `o_selected_td` on styled empty cells #### Desired behavior after PR is merged: - Consider `.o_table` table cells visible Steps to reproduce: - Insert a table - Select it via move handle - Apply any color - Click the move handle again to select the table All table cells should have class `o_selected_td` task-6208949 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#263836
This update corrects a bug where re-invoiced expenses on sales orders incorrectly displayed the total expense amount as the unit price. The fix ensures that the quantity of the expense is properly reflected on the sales order line, resolving a pricing discrepancy. This improves the accuracy of sales order reporting.
Original PR description
Currently, when re-invoicing an expense paid by company, the line added to the sale order will show a price unit equal to the whole expense amount. Steps to reproduce: - Create a new Expense Category with Re-Invoice Costs set to 'At cost' - Create a new Expense, set the new category, and set Paid By to 'Company' - Set Quantity to greater than 1, and Customer to Re-Invoice to any Sales Order - Confirm and Submit Journal Entry on the Expense record Issue: - On the linked Sales Order you will see the total of the expense is used as the unit price This occurs because we don't pass the quantity to the move line creation vals, which then default to 1. In turn, when the sale order line is added, the unit price will be based on the move line vals but the quantity will match the expense. opw-5883290 Forward-Port-Of: odoo/odoo#246816
This update resolves an issue where PDFs with multiple XML attachments (using the /Kids structure) weren't being correctly extracted. Now, all XML attachments within these PDFs will be processed, ensuring bills and reports are complete. This improvement addresses a data accuracy problem.
Original PR description
Steps to reproduce: - From the accounting dashboard, upload a PDF containing intermediate /Kids nodes representing separate xml attachments Issue: No xml will be extracted, as result the bill will be empty. However, in the chatter pdf preview, the js pdf toolkit correctly show the xml attachemnts. Analysis: The PDF spec defines two ways to organize embedded files under /EmbeddedFiles in the document's name dictionary: - /Names: a flat array of pairs located directly under /EmbeddedFiles - /Kids: an array of child nodes, each of which carries its own /Names array. The extractor currently only handled the /Names case, not detecting embedded attachments in case of PDF using a /Kids tree. This change add lookup for both structures. opw-5929274 Forward-Port-Of: odoo/odoo#255798 Forward-Port-Of: odoo/odoo#252523
This update fixes a technical error that prevented users from correctly applying the 'Ship Later' option in the Point of Sale system. The issue stemmed from how the system handled date formatting, and the fix removes unnecessary conversions and adds validation to ensure correct date handling. This ensures the 'Ship Later' feature functions reliably.
Original PR description
Steps: = - Enable Allow Ship Later in POS configuration. - Open POS and add any product. - Proceed to the Payment screen. - Click Ship Later, clear the date field, and confirm Issue: = - A traceback occurs: `TypeError: this.state.shippingDate.toISODate is not a function` Reason: = - Here, shippingDate is a Luxon DateTime object when provided. when cleared, it becomes null, so converting it to ISO format is casung the error. Fix: = - Removed unnecessary conversion using `.toISODate()`. - Removed unnecessary hoot test. - Added validation on shippingDate to prevent selecting a past date. task-5406969 Forward-Port-Of: odoo/odoo#265822 Forward-Port-Of: odoo/odoo#239827
This update fixes an issue where Time Off requests with hour durations were incorrectly displaying 12:00 AM instead of calculated hours. The fix ensures that 'request_hour_from' and 'request_hour_to' accurately reflect the requested time off duration, particularly when a default hour-based Time Off type is selected. This improves the accuracy of Time Off requests.
Original PR description
…to hours ## Issue: 'request_hour_from' and 'request_hour_to' should be computed using the default calendar attendance values, but instead they display 12:00 AM, meaning their values remain 0.0. ##…
…to hours ## Issue: 'request_hour_from' and 'request_hour_to' should be computed using the default calendar attendance values, but instead they display 12:00 AM, meaning their values remain 0.0. ## Steps to Reproduce: - Open the Time Off app. - Configure a Time Off Type with the Duration Type (request_unit) set to Hours. - Set this Time Off Type as the default one while creating a new Time Off. - Create a new Time Off request. - Observe that 'request_hour_from' and 'request_hour_to' are not computed and display 12:00 AM (0.0). ## Root Cause: While fixing the issue related to preserving leave hours when changing Time Off Types, a regression was introduced. Related PR: https://github.com/odoo/odoo/pull/227235 During the creation of a new Time Off with the duration type set to Hours by default, the field 'request_unit_hours' is already True. This prevents the computation of 'request_hour_from' and 'request_hour_to', resulting in both values remaining 0.0. ## Solution: Compute 'request_hour_from' and 'request_hour_to' when their values are still 0.0 (initial Time Off creation case), and skip recomputation only when switching between Time Off Types in order to preserve manually entered hours. Steps to reproduce : [Video](https://drive.google.com/file/d/1P2MFIj8ZxFtFxv2FlX4Zdq6P-5veTxUb/view?usp=sharing) OPW: 6209992 Forward-Port-Of: odoo/odoo#266104 Forward-Port-Of: odoo/odoo#264707
This update resolves an issue where cancelled food delivery orders continued to show as 'Draft' in the POS interface. The fix synchronizes the POS order state with the delivery state upon cancellation, ensuring that preparation displays are also updated correctly. This improves the accuracy of order status and prevents confusion for staff.
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#118288 Forward-Port-Of: odoo/enterprise#117374
This update resolves an issue where importing company data would incorrectly trigger the installation of language-specific (L10N) modules, leading to errors and data corruption. The fix ensures that L10N modules are only installed when explicitly requested, improving import stability and data integrity.
Original PR description
# How to reproduce - Start from a fresh database - Install the account module - Import companies with a data file. These companies need to have a country set and the data file needs to contain some…
# How to reproduce - Start from a fresh database - Install the account module - Import companies with a data file. These companies need to have a country set and the data file needs to contain some bad data - Click on the Test button # The problem An Odoo Server Error is displayed saying : "savepoint xxx does not exist", which prevents the import or hides other potential error. More importantly, the date is imported even though it was a test run. # Cause Importing companies with a country will import their respective l10n modules using `button_immediate_install()` : https://github.com/odoo/odoo/blob/6de867f1c92bacedc0574b63e9e6a2a57fe805dd/odoo/addons/base/models/res_company.py#L319-L322 https://github.com/odoo/odoo/blob/661ddbb7f12e32394a3c11b5a4cd2f38a9e156f5/odoo/addons/base/models/res_company.py#L237 This import calls `cr.commit` : https://github.com/odoo/odoo/blob/661ddbb7f12e32394a3c11b5a4cd2f38a9e156f5/odoo/addons/base/models/ir_module.py#L632-L634 The issue is that when importing a data file, we create savepoints : https://github.com/odoo/odoo/blob/661ddbb7f12e32394a3c11b5a4cd2f38a9e156f5/odoo/orm/models.py#L971-L974 And if an error arise during our import, we rollback to the appropriate save point. Sadly, commiting erases any existing save point, so a savepoint error is rased and the data is not rolled back. The problem stems from the fact that importing module is simply not transactionnal and `button_immediate_install()` is not expected to be called with a savepoint. This was already partly adressed by : https://github.com/odoo/odoo/commit/66dcee9aa70dc72a332fde64dbc802266bbe4a5a But it did not cover the file importing case opw-6174983 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265188
This update significantly speeds up the generation of Point of Sale reports by optimizing a key database query. Previously, the system searched through millions of account moves, which was slow. Now, the query is more efficient by targeting only account moves linked to specific payment journals, resulting in a much faster response time.
Original PR description
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal…
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal to the search criteria, which allows us to benefit from the index on the journal_id field. Here is an example of the before after on a database with 39 million account_move records. Meanwhile only 10-20K account_move are linked to specific journals used in POS payment methods. All measures are performed with a warmed up cache [Explain Before](https://explain.dalibo.com/plan/h8edf56c09d7dfd7) ### Benchmark: <table> <thead> <tr> <th># of am</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>38982635</td> <td>~17s</td> <td>~22ms</td> </tr> </tbody> </table> [Explain After](https://explain.dalibo.com/plan/be2397f176a6b29d) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#262148
This update resolves a bug that caused errors when confirming rental orders in versions 17 and 18, and a subsequent division-by-zero error in newer versions. The fix ensures that the system correctly handles rental orders with kits, preventing errors and improving order processing reliability.
Original PR description
**Steps to produce:** - Install `sale_mrp_renting`. - Enable `Rental Transfers` from settings. - Create a rental product. - Create two variants of the product. - Create a BoM for one variant and set…
**Steps to produce:** - Install `sale_mrp_renting`. - Enable `Rental Transfers` from settings. - Create a rental product. - Create two variants of the product. - Create a BoM for one variant and set its type to `Kit`. - Create a rental order using the other variant. - Try to confirm the order. **Issue:** In versions 17 and 18, a UserError is raised- ``` The unit of measure Units defined on the order line doesn't belong to the same category as the unit of measure False defined on the product. Please correct the unit of measure defined on the order line or on the product, they should belong to the same category. ``` From version 18.2 onward, a different error occurs ``` ZeroDivisionError: float division by zero ``` **Root cause:** In versions 17 and 18: At [1], since the BoM is created for a different variant , no BoM is found for the selected variant. As a result, when `_compute_quantity` is called at [2], the `bom.product_uom_id` is empty, which leads to the `UserError` from `_compute_quantity` method. In version 18.2+: At [1], as the BoM is empty. Then at [3], `_compute_kit_quantities` is called with an empty BoM, and at [4], this results in a division by zero error. **Solution:** Skip the computation when no BoM is found and directly return the quantity to avoid both the `UserError` and the `ZeroDivisionError`. [1]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L13 [2]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L20 [3]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L21 [4] https://github.com/odoo/odoo/blob/91b09dbea5c8a306b5e9d2120466777f0248b360/addons/mrp/models/stock_move.py#L676 **opw-6082434** Forward-Port-Of: odoo/enterprise#118207 Forward-Port-Of: odoo/enterprise#114176
This update fixes a critical issue where canceled orders in the Point of Sale (POS) system weren't immediately reflected on the frontend. The change ensures that cancellations made in the backend are accurately displayed in the POS interface, improving order accuracy and reducing potential customer confusion. This update was triggered by a bug fix.
Original PR description
Step: --------- - Install point_of_sale. - Open a POS session with presets configured. - Add an order line and select the takeout order preset. - Cancel the order from the backend. Issue: --------- - The cancelled order is not reflected in the frontend. Cause: --------- - The frontend is not notified when the order is cancelled from the backend. Fix: --------- - Notify the frontend when a backend order is cancelled. Task-5406984 Forward-Port-Of: odoo/odoo#264791 Forward-Port-Of: odoo/odoo#240725
This update fixes a visual issue in the website builder where color options were missing for images with shapes. The fix ensures that users can now customize the colors of images with shapes when using the 's_cta_mockups' or 's_closer_look' snippets, enhancing the design flexibility.
Original PR description
Steps to reproduce: 1. Go to the website and enter edit mode. 2. Drop `s_cta_mockups` or `s_closer_look` snippet. 3. Click on any image that has a shape. Issue: The color picker option is missing for images with shapes in these snippets. Reason: These snippet templates do not include the `shapeColors` dataset on the image elements. task-5880905 Forward-Port-Of: odoo/odoo#265465 Forward-Port-Of: odoo/odoo#246249
This update fixes an error that occurred when the automated payroll update process ran after a customer contact was deleted. Specifically, the system was unable to find a reference to the deleted contact in a key data file. This prevented the payroll update from completing successfully, and this fix ensures the process continues to function correctly.
Original PR description
Currently, a traceback occurs when the cron "Payroll: Update data" runs after a referenced partner record has been deleted. Steps to reproduce the error: - Install ``l10n_us_hr_payroll`` module with…
Currently, a traceback occurs when the cron "Payroll: Update data" runs after a referenced partner record has been deleted. Steps to reproduce the error: - Install ``l10n_us_hr_payroll`` module with demo data - Switch to ``My US Company`` - Go to Contacts > Delete ``Internal Revenue Service (IRS)`` contact - Run the cron ``Payroll: Update data`` Traceback: ```py ValueError: External ID not found in the system: l10n_us_hr_payroll.res_partner_irs ``` ```py ParseError: while parsing /home/odoo/src/enterprise/ saas-19.3/l10n_us_hr_payroll/data/hr_salary_rule_data.xml:322, somewhere inside ``` https://github.com/odoo/enterprise/blob/21477b333f7a33cb582cd806236e4f9f8346d022/l10n_us_hr_payroll/models/hr_payslip.py#L12-L21 The issue occurs because the cron ``Payroll: Update data`` calls ``_get_data_files_to_update`` method, which loads the ``data/hr_salary_rule_data.xml`` file containing a reference to the deleted partner record at [1]. Since the external ID no longer exists, loading the XML file raises the traceback. [1]: https://github.com/odoo/enterprise/blob/21477b333f7a33cb582cd806236e4f9f8346d022/l10n_us_hr_payroll/data/hr_salary_rule_data.xml#L484 sentry-7496380516
This update corrects a restriction in the Hong Kong payroll module that was preventing employers from using multiple MPF account numbers under the same registration number. The change allows for valid multi-account configurations by validating duplicates based on the combination of registration number and employer account number. This ensures accurate tracking of employer MPF contributions.
Original PR description
An employer can legitimately hold multiple employer account numbers under the same MPF registration number. The previous constraint rejected any two MPF schemes sharing the same registration number, blocking valid multi-account configurations. Fix the validation to only restrict the duplicate based on the combination of registration number and employer account number. task-6232561 Forward-Port-Of: odoo/enterprise#118109
This update ensures that when a Cashdro payment line is cancelled, it's also fully deleted from the system, as expected. Previously, cancelled payments remained in a 'retry' state without being removed. This change improves data accuracy and simplifies Cashdro payment management.
Original PR description
Before this commit, if you tried to cancel and delete a Cashdro payment line by clicking the x, the payment would be cancelled but the line would not be deleted, just left in the 'retry' state. After this commit, the payment line is deleted after being cancelled as expected. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265772
This update resolves an issue where the undo function wouldn't work correctly after inserting a table of contents in the HTML editor. The fix prevents unnecessary history steps from being added, ensuring that users can reliably undo actions like inserting a table of contents without impacting other editing functions.
Original PR description
Problem: Undo does not work correctly after inserting a table of content when no paragraph follows it. Cause: `SelectionPlaceholderPlugin.onSelectionChange` clears attributes from the next base…
Problem: Undo does not work correctly after inserting a table of content when no paragraph follows it. Cause: `SelectionPlaceholderPlugin.onSelectionChange` clears attributes from the next base container and adds a history step whenever the selection changes. In the table of content case, this creates a loop: - Attributes are cleared and a history step is added. - Undo restores only the cleared attributes. - The selection falls back into the empty paragraph after the table of content. - `SelectionPlaceholderPlugin.onSelectionChange` runs again and adds another history step. As a result, undo never reaches the previous user action. Solution: Avoid adding a history step in `SelectionPlaceholderPlugin.onSelectionChange` when the current step is not modified by any user interaction. Steps to reproduce: - Write some text. - Insert a table of content using `/toc`. - Press Ctrl + Z. - Observe that nothing happens and the previously typed text cannot be undone. task-6216910 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264743
This update fixes an issue where the picking origin document incorrectly referenced the previous MO name after a manufacturing operation type was changed before confirmation. The fix ensures that the picking document accurately reflects the new MO name, improving inventory accuracy and preventing potential order fulfillment errors. This was triggered by a multi-step manufacturing route.
Original PR description
**Issue**: When the name of a MO changes before confirmation, the picking origin may remain incorrect after confirmation. **Steps to reproduce**: - Make sure that multi-step route is enabled in the…
**Issue**: When the name of a MO changes before confirmation, the picking origin may remain incorrect after confirmation. **Steps to reproduce**: - Make sure that multi-step route is enabled in the settings - Configure the manufacturing route as 2-step - Go to Inventory > Configuration > Warehouse Management > Operations Types - Clone the "Manufacturing" operation type and assign a different Sequence Prefix - Create and save a MO, without confirming it - Change and save the operation type to the cloned one (the MO name changes) - Confirm the MO -> The picking source document uses the previous MO name instead of the new one **Cause**: The source document of the picking (`origin`) comes from its move: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1526 The move origin comes from the procurement values: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1575C13-L1575C56 Which relies on `self.reference_ids[0].name`: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1639 which is never updated, causing the origin to keep the previous MO name. opw-5979778 Forward-Port-Of: odoo/odoo#255874
This update ensures that forced full packaging reservations are correctly applied, even when large quantities of stock are available. Previously, the system was incorrectly calculating reservations based on multiples of packaging units, leading to inaccurate stock levels. This fix now accurately reflects the intended behavior of reserving only full packaging units.
Original PR description
Issue ----- Forced full packaging reservation setting is ignored when there is a big quant in stock. Steps to reproduce ----- - Enable packagings - Create a product category "Super Category" -…
Issue
-----
Forced full packaging reservation setting is ignored when there is a big quant in stock.
Steps to reproduce
-----
- Enable packagings
- Create a product category "Super Category"
- Reserve Packagings: Reserve Only Full Packagings
- Create a stored product "AAA"
- Product Category: Super Category
- 50 units on hand
- Packaging: 6-Pack (6 units)
- Create a delivery for 15 units of AAA
> Reservation is made for 15 units
Cause
-----
The rounding to a multiple of the packaging quantity takes the stock quant into account. For our example case, we have 8 full 6-Packs on hand, so the `available_quantity` gets set to 48 when doing
https://github.com/odoo/odoo/blob/5e458236ca2ff2ab92c4893495e7a721be902c40/addons/stock/models/stock_quant.py#L923-L925
This leads to the reservation quantity being min(15, 48) = 15
https://github.com/odoo/odoo/blob/5e458236ca2ff2ab92c4893495e7a721be902c40/addons/stock/models/stock_quant.py#L927
-----
Ticket:
opw-5974333
Forward-Port-Of: odoo/odoo#263934
Forward-Port-Of: odoo/odoo#257342This update fixes inaccuracies in how the Mexican employment subsidy was calculated, specifically addressing issues with threshold prorating and cumulative monthly caps. The changes ensure employees receive the correct subsidy amounts based on updated government regulations, improving payroll accuracy and compliance.
Original PR description
The employment subsidy calculation was incorrect in two main scenarios: ### 1. Incorrect threshold prorating: The system was comparing the salary against the full monthly limit even for partial…
The employment subsidy calculation was incorrect in two main scenarios:
### 1. Incorrect threshold prorating:
The system was comparing the salary against the full monthly limit even for partial periods (weekly or bi-weekly). This resulted in employees wrongly receiving the subsidy when their proportional salary actually exceeded the limit.
Example: In 2026, the 14-day threshold should be 5,292.67 (11,492.66 / 30.4 * 14). Currently, an employee earning 10,000.00 in those 14 days still gets the subsidy because it's being compared against the full 11,492.66.
### 2. Cumulative monthly cap:
When multiple payslips occur in the same month, the total subsidy sometimes exceeds the statutory monthly maximum (536.22 for 2026) because the cap wasn't enforced across all slips.
Example: The 2026 maximum monthly subsidy is 536.22. In a month with three partial payslips:
- Mar 1st - Mar 14th: The system grants 246.68.
- Mar 15th - Mar 28th: The system grants 246.68.
- Mar 29th - Apr 11th: For the 3 days belonging to March, the system grants an additional 52.86.
Total subsidy for March reaches 546.22, exceeding the legal cap.
### Changes included in this PR:
- Updated `l10n_mx_rule_parameter_uma` to include monthly and annual values. This prevents rounding discrepancies.
Example: the 2026 annual UMA published is 42,794.64. In a rule the calculation is: l10n_mx_uma * 30.4 * 12 = 117.31 * 30.4 * 12 = 42,794.68 resulting in a ~0.04 difference.
- Create a new rule parameter `l10n_mx_rule_parameter_subsidy_salary_limit` to have the subsidy eligible threshold. Starting in 2026, the government's rounding changed from zero decimals(e.g., 9,081.00 in 2024, 10,171.00 in 2025) to two decimals (11,492.66). Storing these as explicit parameters avoids the precision errors.
- Added comprehensive unit tests covering:
- Complete periods: validates standard payslips aligned with the month calendar (bi-monthly, monthly, bi-weekly).
- Overlapping periods: validates split-month scenarios (14-day, 10-day, weekly) where periods cross month boundaries:
Example of self._overlapping_period("weekly", 7, 2646.33, (35.24, 88.10), (3, 123.34), (77.53, 35.24))
This test covers 5 weekly payslips with the following subsidy
distribution:
- Tuple `first_payslip` => (35.24, 88.10) means that:
First payslip (Apr 29 - May 5), the subsidy is 35.24 for April and 88.10 for May.
- Tuple `mid_payslips` => (3, 123.34) means that:
For the next 3 payslips fully in May, the subsidy is 123.34 each.
Payslip 2 (May 6 - May 12): Subsidy for May = 123.34
Payslip 3 (May 13 - May 19): Subsidy for May = 123.34
Payslip 4 (May 20 - May 26): Subsidy for May = 123.34
- Tuple `last_payslip` => (77.53, 35.24) means that:
Last payslip (May 27 - June 2), the subsidy is 77.53 for May and 35.24 for June.
- Across years: subsidy amounts and limits are updated annually.
Therefore, if a period overlaps two years, a salary amount might be eligible for a subsidy in January but not in the previous December, and the paid subsidy is increased in January due to the new limits.
- Cleaned up redundant tests (test_regular_payslip_subsidy) and adjusted decimal precision.
- For split-month `schedule_pay` periods, the first payslip might generate a subsidy. However, in subsequent payslips, due to commissions or a wage increase, the employee may exceed the monthly subsidy salary limit.
In those payslips, a warning is shown to notify the user that a manual adjustment is required.
Created tests to validate these cases.
target: 19.0
task-5419659
Forward-Port-Of: odoo/enterprise#116779
Forward-Port-Of: odoo/enterprise#107601A previous test in our meeting functionality was intermittently failing due to a timing issue. This update ensures the initial 'mark as read' action completes before subsequent steps, making the test reliable and preventing potential disruptions to the meeting workflow. This improves the overall stability of our messaging system.
Original PR description
The `test_04_meeting_view_tour` test sometimes fails. A race condition occurs between the initial mark as unread action, which may or may not be triggered depending on whether the thread composer has time to gain focus before the meeting view is opened, and the later mark as unread action triggered during the test. This commit ensures the initial mark as read action is completed before proceeding to the mark as unread steps, thus resolving the issue. runbot-239936 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#264662
This update fixes an issue where packaging unit information was hidden on delivery slips after a transfer was validated for products tracked by serial/lot. The change ensures that the correct packaging unit and quantity are consistently displayed, providing more accurate reporting for inventory movements. This improves visibility and accuracy in stock management.
Original PR description
Issue before this commit: ========================= For products tracked by serial/lot with packaging units, the delivery slip correctly shows the packaging unit and quantity before validating the…
Issue before this commit: ========================= For products tracked by serial/lot with packaging units, the delivery slip correctly shows the packaging unit and quantity before validating the transfer. However, after validating the transfer, the packaging unit and its corresponding quantity are no longer displayed in the delivery slip report. Steps to Reproduce: ========================= 1. Install stock and sale_management modules. 2. Enable Units of Measure & Packagings and Display Lots & Serial Numbers on Delivery Slips from settings. 3. Create a product with tracking by lot/serial number and configure a packaging unit. 4. Create a SO using this product with a packaging unit and confirm it. 5. Open the related transfer and print the delivery slip before and after validation. Cause of the Issue: ========================= The delivery slip report template (stock_report_delivery_has_serial_move_line) does not display packaging unit information after validation for move lines when the packaging unit differs from the product unit of measure. With This Commit: ========================= This commit ensures that packaging units and their corresponding quantities are displayed on the delivery slip after validation when the packaging unit differs from the product unit of measure. Steps To Reporduce: [Video Link](https://drive.google.com/file/d/10DmFKW1Y_Tm-AyKzPrqtFMY8orBkKbIm/view?usp=sharing) opw-6142052 Forward-Port-Of: odoo/odoo#266028 Forward-Port-Of: odoo/odoo#265206
This update fixes an issue where pension fund taxes weren't being correctly applied when importing Italian electronic vendor bills. The change ensures that the system now accurately processes invoices generated by third-party software, even if they don't include all the expected XML tags, guaranteeing accurate tax calculations for Italian businesses.
Original PR description
### Issue before this commit: When importing an Italian electronic vendor bill using the AssoSoftware standard, pension fund taxes (Cassa Previdenziale) are not applied to the invoice lines. ###…
### Issue before this commit: When importing an Italian electronic vendor bill using the AssoSoftware standard, pension fund taxes (Cassa Previdenziale) are not applied to the invoice lines. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it_edi_witholding 2. Change VAT number of IT company with the one in the xml 3. Go to Taxes > 4%F.Pens. > Advanced Options and change Pension Fund Type with TC02 4. Import xml of the ticket in vendor bills 5. P.Fund tax is not assigned ### Cause of the issue: The issue is caused by the following line: https://github.com/odoo/odoo/blob/669b9b84f4d5c8765dc4b451d5da6a95dbb9ded8/addons/l10n_it_edi_withholding/models/account_move.py#L247 Currently, the parser strictly expects the optional <RiferimentoTesto> tag alongside <TipoDato>AswCassPre</TipoDato>. However, several third-party software providers generate valid XML files containing only the AswCassPre block without any optional child tags. ### Reason to introduce the fix: Ensure that the pension fund tax mapped to the line's VAT rate is correctly applied whenever the AswCassPre data type is present, even if the optional reference tags are omitted. opw-6189225 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265914 Forward-Port-Of: odoo/odoo#264083
This update resolves an issue where the VIES validation process was incorrectly triggered during tax return creation, leading to errors. The fix ensures that VIES validation only occurs for tax returns associated with partners requiring VAT, improving the accuracy of financial reporting. This prevents unnecessary errors and ensures compliance.
Original PR description
Vies validation should only occurs with moves having fiscal position with vat required Steps: - With base_vat, and european l10n like BE installed - Make a bill for a partner with no vat or invalid vat - Create a tax return - Open the return -> the 'check_partner_vies' fails opw-6200246 Forward-Port-Of: odoo/enterprise#117913
This update resolves an issue where the 'Caption' button within the HTML editor was not properly translated, preventing international users from accessing captions. This fix ensures all text within the editor is localized, improving the user experience for global customers.
Original PR description
Currently the "Caption" button in the HTML editor is not translatable. This commit fixes that. Forward-Port-Of: odoo/odoo#266002
This update resolves an issue where stock transfer widgets incorrectly displayed 'No package' tags for certain transfer types. The fix ensures accurate package identification, particularly after recent database upgrades, by providing a fallback mechanism when package history is unavailable.
Original PR description
# The bug When accessing a done transfer with two lines where one line has a result package ID and the other does not, the computed field `has_lines_without_result_package` returns `True`. This field…
# The bug When accessing a done transfer with two lines where one line has a result package ID and the other does not, the computed field `has_lines_without_result_package` returns `True`. This field is used in the `stock_package_m2m` widget to append a `No package` tag when a move has this field set. https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock/models/stock_move.py#L266-L269 https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock/static/src/widgets/stock_package_m2m.js#L9-L24 This works fine when package history exists, as it accesses the `package_ids` field to generate the tags. However, for recently upgraded databases, no package history is available. When the `_compute_package_ids` method runs, it attempts to access data from an undefined history record, triggering a traceback. https://github.com/odoo/odoo/blob/eaa6c4352aec2be8519360c282f3f6504a2f263c/addons/stock/models/stock_move.py#L271-L278 # The fix The fix is straightfoward: in `_compute_package_ids`, if a move is in the `done` or `cancel` state and has no package history, we fallback and populate `package_ids` using the same logic applied to states other than `done` or `cancel`. This behavior specifically targets and fixes issue for databases recently upgraded to v19. task: 6070541 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265032
This update corrects a bug where the Gantt view incorrectly displayed working hours for flexible employees on public holidays. The fix ensures that unavailable time is accurately reflected, preventing employees from scheduling work during holiday periods. The issue stemmed from timezone discrepancies during the calculation of employee availability.
Original PR description
[FIX] hr_attendance_gantt: fix gantt view with public holidays Bug reproduction: 1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026 2 -…
[FIX] hr_attendance_gantt: fix gantt view with public holidays
Bug reproduction:
1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026
2 - Create a new public holiday on 01/01/2026 (from 00.00 to 23.59 or 23.55 (depends on version, it does not matter))
3 - in attendance app the cell from 00.00 to 01.00 seems white for that day and for selected employee (this cell seems like not holiday and employee can work)
Bug cause:
1 - After a long traceback, _gantt_unavailability in hr_attendance_gantt/HrAttendance, if an employee is flexible then unavailable_intervals is calculated with the Brussel time zone
2 - All other unavailable intervals are converted to the UTC in the function of _gantt_unavailability except in the final lines of the function.
3 - When the employee is flexible and since the conversion is not done in the final lines, it remains 1 hour more (UTC+1), it is from 1 am to 1 am of next day instead of 0 am to 23.59.
Bug solution:
1 - I converted the timezone to UTC to solve the problem.
task - 6067070
Forward-Port-Of: odoo/enterprise#112493This update fixes an issue preventing users from importing emissions data within the ESG module. The change allows the 'import' action to appear in the COG menu, even with the 'create' attribute disabled in the list view. This ensures users can easily access and manage their emissions data.
Original PR description
Before this commit, the "import" action of emissions in the ESG module was not visible in the COG menu. It is because the "create" attribute of the list view is disabled, which prevents the menu item from being displayed. With this commit, we override the standard behavior in this particular action, by allowing the import action to show up in the COG menu, even if the "create" attribute is disabled. version-19.1 Forward-Port-Of: odoo/enterprise#118004
This update corrects a bug where portal users could inadvertently delete documents they didn't own. The fix ensures that portal users can only delete documents they own, preventing unintended data loss during the standard cron archiving process. The change simplifies the code and improves stability.
Original PR description
Reproduce: with rpc call as portal user, you can archive documents you have access to. This is not desired as this may lead to records being deleted when the cron collects the trash, but we only wanted to support portal users deleting only records they own. What we did when calling toggle_active should be done for all calls to `write` with `active`. It also removes the need for `_raise_if_unauthorized_archive` and `_unlink_except_unauthorized`. Task-6205627 Forward-Port-Of: odoo/enterprise#118055 Forward-Port-Of: odoo/enterprise#116886
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 and reduces potential delays in stock management operations.
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#255399
Forward-Port-Of: odoo/odoo#254245This update fixes an issue where employees with time off were incorrectly checked out after their scheduled work hours. The change ensures that the system accurately calculates expected attendance based on employee contracts and time off, preventing over-reporting of hours worked. This improves the accuracy of time tracking and payroll.
Original PR description
# Steps to reproduce 1. Set the Working schedule 40h/week 2. Employee takes 2 hours off from 15:00 to 17:00 and enable automatic check-out 3. Odoo will automatically checks out at 17:06 (scheduled end + tolerance) # Issue - This leads to 2h06 of extra hours being incorrectly recorded. # Fix - Use employee._get_expected_attendances instead, so contract-aware calendar resolution, leaves, and break time handling stay centralized in HR. task-5052044 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235442
This update resolves an issue where Odoo branches were incorrectly inheriting VAT settings from their parent companies, leading to manual VAT adjustments. The change now defaults branches to no VAT, ensuring the parent company remains the key provider and simplifies branch operations. Key settings are also restricted to the base group for improved security.
Original PR description
Branches copied the parent's VAT, which made them their own signing entity and forced users to clear the VAT so the branch would reuse the parent's keys. Default branches to no VAT so the parent remains the key provider. Setting a VAT on a branch still exposes the key settings for the rare case separate keys are needed. Also restrict the key settings to base.group_system task_id - 6087168 Forward-Port-Of: odoo/enterprise#117986
This update resolves an issue where constant fields within signing documents were failing to populate correctly, leading to signing errors. The fix ensures that empty values from auto-field calculations are preserved, preventing the 'Some required items are not filled' error and improving the signing process. This ensures documents are properly populated during the signing workflow.
Original PR description
Version: - saas-18.4 Steps to reproduce: - Create sign template. - Add a sign item with read only true and linked model and auto_value field set. - Send document for signing. - Try to sign the document. Issue: - Signing fails with "Some required items are not filled". - Constant readonly fields become empty during signing flow. Cause: - In `_populate_constant_items()`, the default field value was always replaced by `_get_auto_field_value()`. - When no reference document was set, `_get_auto_field_value() `returned an empty string. - This caused an empty value to be stored in `sign.request.item.value`. Solution: - Keep the default field value when auto-field resolution returns an empty string. - Only replace the value when a valid auto-field value is found. task-6229776 Forward-Port-Of: odoo/enterprise#118298 Forward-Port-Of: odoo/enterprise#117880
This update resolves an error occurring when sending purchase bills with agricultural tax (ClaveRegimenIvaOpTrascendencia) through the TicketBAI system in Spain. The issue stemmed from an incorrect value being submitted, preventing proper invoice processing. This fix ensures accurate transmission of tax information.
Original PR description
…hase bills **STEP TO REPRODUCE** 1. Create a bill with a invoice line with a regimen agricultura tax. 2. send the bill using TicketBAI. 3. You will get the following error: Error:cvc-enumeration-valid: Value '19' is not facet-valid with respect to enumeration '[01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13]'. It must be a value from the enumeration. opw-6200686 Forward-Port-Of: odoo/odoo#265785 Forward-Port-Of: odoo/odoo#264037
15 changes
Resolved issues and error corrections
This update optimizes a key query used in Point of Sale reporting, resulting in a significant speed increase. By adding the journal to the search criteria, the system now efficiently utilizes database indexes, dramatically reducing the time it takes to retrieve account move information. This translates to faster report generation and a better user experience.
Original PR description
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal…
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal to the search criteria, which allows us to benefit from the index on the journal_id field. Here is an example of the before after on a database with 39 million account_move records. Meanwhile only 10-20K account_move are linked to specific journals used in POS payment methods. All measures are performed with a warmed up cache [Explain Before](https://explain.dalibo.com/plan/h8edf56c09d7dfd7) ### Benchmark: <table> <thead> <tr> <th># of am</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>38982635</td> <td>~17s</td> <td>~22ms</td> </tr> </tbody> </table> [Explain After](https://explain.dalibo.com/plan/be2397f176a6b29d) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#262148
This update resolves an issue where constant fields within signing documents would become empty during the signing process, leading to signing failures. The fix ensures that default field values are retained when auto-field calculations result in empty strings, guaranteeing required fields are populated and the signing flow completes successfully.
Original PR description
Version: - saas-18.4 Steps to reproduce: - Create sign template. - Add a sign item with read only true and linked model and auto_value field set. - Send document for signing. - Try to sign the document. Issue: - Signing fails with "Some required items are not filled". - Constant readonly fields become empty during signing flow. Cause: - In `_populate_constant_items()`, the default field value was always replaced by `_get_auto_field_value()`. - When no reference document was set, `_get_auto_field_value() `returned an empty string. - This caused an empty value to be stored in `sign.request.item.value`. Solution: - Keep the default field value when auto-field resolution returns an empty string. - Only replace the value when a valid auto-field value is found. task-6229776 Forward-Port-Of: odoo/enterprise#118240 Forward-Port-Of: odoo/enterprise#117880
This update resolves an error that prevented rental orders from being confirmed in older versions of Odoo Enterprise. The fix avoids a division-by-zero error that occurred when calculating quantities, ensuring rental orders can be processed correctly. This improves the reliability of the rental order functionality.
Original PR description
**Steps to produce:** - Install `sale_mrp_renting`. - Enable `Rental Transfers` from settings. - Create a rental product. - Create two variants of the product. - Create a BoM for one variant and set…
**Steps to produce:** - Install `sale_mrp_renting`. - Enable `Rental Transfers` from settings. - Create a rental product. - Create two variants of the product. - Create a BoM for one variant and set its type to `Kit`. - Create a rental order using the other variant. - Try to confirm the order. **Issue:** In versions 17 and 18, a UserError is raised- ``` The unit of measure Units defined on the order line doesn't belong to the same category as the unit of measure False defined on the product. Please correct the unit of measure defined on the order line or on the product, they should belong to the same category. ``` From version 18.2 onward, a different error occurs ``` ZeroDivisionError: float division by zero ``` **Root cause:** In versions 17 and 18: At [1], since the BoM is created for a different variant , no BoM is found for the selected variant. As a result, when `_compute_quantity` is called at [2], the `bom.product_uom_id` is empty, which leads to the `UserError` from `_compute_quantity` method. In version 18.2+: At [1], as the BoM is empty. Then at [3], `_compute_kit_quantities` is called with an empty BoM, and at [4], this results in a division by zero error. **Solution:** Skip the computation when no BoM is found and directly return the quantity to avoid both the `UserError` and the `ZeroDivisionError`. [1]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L13 [2]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L20 [3]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L21 [4] https://github.com/odoo/odoo/blob/91b09dbea5c8a306b5e9d2120466777f0248b360/addons/mrp/models/stock_move.py#L676 **opw-6082434** Forward-Port-Of: odoo/enterprise#118207 Forward-Port-Of: odoo/enterprise#114176
This update fixes a visual issue in the website builder where color options were missing when customizing images with shapes. The change ensures that images with shapes now correctly display color pickers, allowing for more flexible design options. This improves the user experience and design capabilities within the website builder.
Original PR description
Steps to reproduce: 1. Go to the website and enter edit mode. 2. Drop `s_cta_mockups` or `s_closer_look` snippet. 3. Click on any image that has a shape. Issue: The color picker option is missing for images with shapes in these snippets. Reason: These snippet templates do not include the `shapeColors` dataset on the image elements. task-5880905 Forward-Port-Of: odoo/odoo#265465 Forward-Port-Of: odoo/odoo#246249
This update resolves an issue preventing employers from correctly managing multiple MPF account numbers under a single registration. The change relaxes a previous restriction, allowing valid multi-account configurations while still ensuring uniqueness based on the combination of registration and account numbers. This improves data accuracy for Hong Kong payroll processing.
Original PR description
An employer can legitimately hold multiple employer account numbers under the same MPF registration number. The previous constraint rejected any two MPF schemes sharing the same registration number, blocking valid multi-account configurations. Fix the validation to only restrict the duplicate based on the combination of registration number and employer account number. task-6232561 Forward-Port-Of: odoo/enterprise#118109
This update resolves a visual bug in email templates where banner padding would disappear after saving and reloading. The fix replaces shorthand padding styles with explicit longhand styles to ensure consistent rendering across different email clients. This improves the appearance and alignment of email banners.
Original PR description
Problem: In email templates, adding a banner/info block and saving then reloading causes the horizontal padding to be lost and the icon to become misaligned. Cause: During save, `convert_inline`…
Problem: In email templates, adding a banner/info block and saving then reloading causes the horizontal padding to be lost and the icon to become misaligned. Cause: During save, `convert_inline` processes the content via `_normalizeStyle`, which iterates over `CSSStyleDeclaration` using index-based iteration. This only yields longhand properties (e.g. `padding-left`, `padding-top`), never shorthands like `padding`. When the shorthand contains `var()` references (e.g. `padding: var(--y) var(--x)`), the browser cannot resolve the longhands and leaves them empty, so they are silently dropped during style extraction. Adding shorthand support to the iterator was not viable, as the rest of the pipeline expects longhand-only styles, and safely converting `padding: var(--y) var(--x)` to longhands is not possible without first resolving the variables. Solution: Replace the `padding` shorthand in the banner template with explicit longhand properties (`padding-top`, `padding-bottom`, `padding-left`, `padding-right`). Steps to reproduce: 1. Open an email template 2. Add a banner/info block 3. Save the template 4. Reload the page 5. Observe horizontal padding is lost and icon is misaligned task-6230530 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265756
This update ensures that when a Cashdro payment line is cancelled, it's also completely deleted, as expected. Previously, the line would remain in a 'retry' state. This change improves data accuracy and simplifies Cashdro payment management.
Original PR description
Before this commit, if you tried to cancel and delete a Cashdro payment line by clicking the x, the payment would be cancelled but the line would not be deleted, just left in the 'retry' state. After this commit, the payment line is deleted after being cancelled as expected. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265772
This update resolves an issue where the undo function wouldn't work correctly after inserting a table of contents, specifically when no text followed it. The fix prevents unnecessary history steps from being added, ensuring the undo operation functions as expected and allows users to revert changes accurately.
Original PR description
Problem: Undo does not work correctly after inserting a table of content when no paragraph follows it. Cause: `SelectionPlaceholderPlugin.onSelectionChange` clears attributes from the next base…
Problem: Undo does not work correctly after inserting a table of content when no paragraph follows it. Cause: `SelectionPlaceholderPlugin.onSelectionChange` clears attributes from the next base container and adds a history step whenever the selection changes. In the table of content case, this creates a loop: - Attributes are cleared and a history step is added. - Undo restores only the cleared attributes. - The selection falls back into the empty paragraph after the table of content. - `SelectionPlaceholderPlugin.onSelectionChange` runs again and adds another history step. As a result, undo never reaches the previous user action. Solution: Avoid adding a history step in `SelectionPlaceholderPlugin.onSelectionChange` when the current step is not modified by any user interaction. Steps to reproduce: - Write some text. - Insert a table of content using `/toc`. - Press Ctrl + Z. - Observe that nothing happens and the previously typed text cannot be undone. task-6216910 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264743
This update fixes a visual issue in the termination fees report for the Belgian payroll module. The report layout was misaligned when termination slips were generated with fewer lines of information. The fix dynamically adjusts the layout to ensure proper alignment and formatting, improving the report's appearance.
Original PR description
**Steps to Reproduce:** 1. Generate a termination slip for an employee 2. The generated payslip pdf layout looks clumsy and misaligned. **Bug Cause:** 1. The notice duration has rowspan="3" expecting 3 lines. When there are less than 3 lines, the following rows are affected and misaligned. 2. The border is missing. **Solution:** Added dynamic sizing for notice duration instead of static rowspan="3". Used index instead of line_count for both notice duration and banks to stay consistent and simple. Added table-bordered class as borders are not automatically applied like in previous versions. **Task:** 6193558 Forward-Port-Of: odoo/enterprise#116627
This update fixes an issue where the picking origin document incorrectly referenced the old MO name after a manufacturing operation type was changed before confirmation. The fix ensures that the picking origin now accurately reflects the updated MO name, improving inventory accuracy and reducing potential order fulfillment errors. This was triggered by a multi-step manufacturing route.
Original PR description
**Issue**: When the name of a MO changes before confirmation, the picking origin may remain incorrect after confirmation. **Steps to reproduce**: - Make sure that multi-step route is enabled in the…
**Issue**: When the name of a MO changes before confirmation, the picking origin may remain incorrect after confirmation. **Steps to reproduce**: - Make sure that multi-step route is enabled in the settings - Configure the manufacturing route as 2-step - Go to Inventory > Configuration > Warehouse Management > Operations Types - Clone the "Manufacturing" operation type and assign a different Sequence Prefix - Create and save a MO, without confirming it - Change and save the operation type to the cloned one (the MO name changes) - Confirm the MO -> The picking source document uses the previous MO name instead of the new one **Cause**: The source document of the picking (`origin`) comes from its move: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1526 The move origin comes from the procurement values: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1575C13-L1575C56 Which relies on `self.reference_ids[0].name`: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1639 which is never updated, causing the origin to keep the previous MO name. opw-5979778 Forward-Port-Of: odoo/odoo#255874
This update corrects a display error in the employee attendance Gantt view, specifically when public holidays are created. The issue occurred when employees with flexible schedules were assigned contracts before a certain date, leading to incorrect holiday representation. The fix converts all timezones to UTC to ensure accurate holiday scheduling.
Original PR description
[FIX] hr_attendance_gantt: fix gantt view with public holidays Bug reproduction: 1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026 2 -…
[FIX] hr_attendance_gantt: fix gantt view with public holidays
Bug reproduction:
1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026
2 - Create a new public holiday on 01/01/2026 (from 00.00 to 23.59 or 23.55 (depends on version, it does not matter))
3 - in attendance app the cell from 00.00 to 01.00 seems white for that day and for selected employee (this cell seems like not holiday and employee can work)
Bug cause:
1 - After a long traceback, _gantt_unavailability in hr_attendance_gantt/HrAttendance, if an employee is flexible then unavailable_intervals is calculated with the Brussel time zone
2 - All other unavailable intervals are converted to the UTC in the function of _gantt_unavailability except in the final lines of the function.
3 - When the employee is flexible and since the conversion is not done in the final lines, it remains 1 hour more (UTC+1), it is from 1 am to 1 am of next day instead of 0 am to 23.59.
Bug solution:
1 - I converted the timezone to UTC to solve the problem.
task - 6067070
Forward-Port-Of: odoo/enterprise#112493This update fixes an error in the project dashboard that was miscalculating revenue figures for yearly subscriptions. The previous system incorrectly applied monthly recurring charges, leading to inaccurate displayed amounts. This change ensures revenue is accurately reflected based on the correct subscription type.
Original PR description
__ ## Short functional explanation of the error When checking the dashboard on a project we created with a yearly subscription, the values shown are incorrect. ## Reproduction Steps 1. Create a new…
__ ## Short functional explanation of the error When checking the dashboard on a project we created with a yearly subscription, the values shown are incorrect. ## Reproduction Steps 1. Create a new product. Check the Subscription field and set the Product type as Service. On the Create on Order field, set Project & Task. Then, in the Recurring Price tab, add a Monthly plan with price 50 and yearly plan with price 40. 2. Create a new Quotation. Set a customer and add the product you just created in an Order line. Set the Quantity to 100 and set the recurring plan as Yearly. You'll see the amount be at 4000, and the total amount at 4600 with taxes. Click on Confirm. 3. Create an invoice and confirm it. 4. Click on the Project smart button. Then, on the top right, click on the view menu > Top Menu. Select Dashboard and click on it. ### Expected behavior On the dashboard, we should see the Revenues under Profitability at 4000. To invoice should be left at 0 and Invoiced should be at 4000. Expected should be at 4000. ### Unexpected behavior On the dashboard, To Invoice is at 333, and Expected is at 4333. This corresponds to our invoice + 4000/12 -> monthly recurring plan, with the price of the yearly plan! ## Origin of the issue We always add the `recurring_monthly` value when showing the profitability, no matter the recurring plan: https://github.com/odoo/enterprise/blob/cdc0d5d57f6b27a6bb5e451d48bdbef4e3dde5cb/project_sale_subscription/models/project_project.py#L86 We should only add the `recurring_monthly` value for as many monthly subscriptions we have, not for *all* the subscriptions. __ opw-5916688 Forward-Port-Of: odoo/enterprise#117818 Forward-Port-Of: odoo/enterprise#113918
This update resolves an issue where users on Android 14 couldn't access their device's camera when uploading images through the Odoo web interface. The fix adds support for camera access, ensuring users can select photos directly from their device. This improves usability for Android users.
Original PR description
Since Android 14 we don't have option to take a photo on clicking on file input in Chrome.
This for example will allow only images but no option "Camera"
```html
<input type="file" accept="image/*/>
```
A workaround is to use a dummy mimetype (`*/*`), example `dummy/allowAndroidCamera` The fix will be applied on image widget in addition to the original `acceptedFileExtensions` to not override the existing `accept` attribute
You can test the different behaviour here: https://jsfiddle.net/n0vs6h3b/
Linked url
https://blog.addpipe.com/html-file-input-accept-video-camera-option-is-missing-android-14-15/ https://stackoverflow.com/questions/77876374/html-input-type-file-not-working-to-pull-up-camera-for-pixel-android-14-comb/79163998#79163998 https://issues.chromium.org/issues/40937303
opw-6040375
Forward-Port-Of: odoo/odoo#265944
Forward-Port-Of: odoo/odoo#265750This update fixes an issue where pension fund taxes weren't being correctly applied when importing Italian electronic vendor bills. The change ensures that the system accurately processes invoices generated by third-party software, even if they don't include all the expected XML tags, guaranteeing accurate tax calculations for Italian businesses.
Original PR description
### Issue before this commit: When importing an Italian electronic vendor bill using the AssoSoftware standard, pension fund taxes (Cassa Previdenziale) are not applied to the invoice lines. ###…
### Issue before this commit: When importing an Italian electronic vendor bill using the AssoSoftware standard, pension fund taxes (Cassa Previdenziale) are not applied to the invoice lines. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it_edi_witholding 2. Change VAT number of IT company with the one in the xml 3. Go to Taxes > 4%F.Pens. > Advanced Options and change Pension Fund Type with TC02 4. Import xml of the ticket in vendor bills 5. P.Fund tax is not assigned ### Cause of the issue: The issue is caused by the following line: https://github.com/odoo/odoo/blob/669b9b84f4d5c8765dc4b451d5da6a95dbb9ded8/addons/l10n_it_edi_withholding/models/account_move.py#L247 Currently, the parser strictly expects the optional <RiferimentoTesto> tag alongside <TipoDato>AswCassPre</TipoDato>. However, several third-party software providers generate valid XML files containing only the AswCassPre block without any optional child tags. ### Reason to introduce the fix: Ensure that the pension fund tax mapped to the line's VAT rate is correctly applied whenever the AswCassPre data type is present, even if the optional reference tags are omitted. opw-6189225 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265914 Forward-Port-Of: odoo/odoo#264083
Features or functions removed from Odoo
This commit removes a plugin that was no longer needed for translating the website's table of contents. The underlying functionality is now handled automatically, improving website performance. This change ensures a cleaner codebase and reduces potential maintenance overhead.
Original PR description
The plugin `TranslateTableOfContentOptionPlugin` is not needed anymore, the replication between the headers in the content of the `s_table_of_content` and its navbar is now completely handled by the `FieldChangeReplicationPlugin` plugin since a5f1af347b55da8662d6d6802b57e14aab574d78. The test is removed because it is not representative of real edition situation (the nodes it changes are not inside `contenteditable=true` or `o_savable`), and the test added in a5f1af347b55da8662d6d6802b57e14aab574d78 covers this usecase. task-5892636 Forward-Port-Of: odoo/odoo#265951 Forward-Port-Of: odoo/odoo#264325
20 changes
Resolved issues and error corrections
This update optimizes a key database query used in Point of Sale reporting, resulting in a significant speed improvement. By adding the journal to the search criteria, the system now efficiently utilizes an existing database index, dramatically reducing the time it takes to retrieve necessary data. This translates to faster reporting and a better user experience.
Original PR description
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal…
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal to the search criteria, which allows us to benefit from the index on the journal_id field. Here is an example of the before after on a database with 39 million account_move records. Meanwhile only 10-20K account_move are linked to specific journals used in POS payment methods. All measures are performed with a warmed up cache [Explain Before](https://explain.dalibo.com/plan/h8edf56c09d7dfd7) ### Benchmark: <table> <thead> <tr> <th># of am</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>38982635</td> <td>~17s</td> <td>~22ms</td> </tr> </tbody> </table> [Explain After](https://explain.dalibo.com/plan/be2397f176a6b29d) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#262148
This update resolves a bug in the HTML Editor that caused a crash when a user removed a table while resizing. The fix restricts resizing to the primary mouse button and prevents the editor from attempting to resize when there's no table to resize, improving stability and user experience.
Original PR description
#### Description of the issue this PR addresses: - Table resize listeners are not cleaned when the table is removed while resizing - Next mousemove runs resize logic with a null target and throws traceback #### Desired behavior after PR is merged: - Restrict resize start to primary mouse button only - Prevent resize logic execution on null targets #### Steps to reproduce: - Open the todo app - Insert a table and select whole table - Move cursor on a table cell border to see resize cursor - Right click and choose Cut from browser context menu - Move the mouse again - Resize logic crashes with null target traceback task-6212279 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264065
This update fixes a visual issue in the website builder where users couldn't change the color of images with shapes. The fix adds the necessary configuration to allow users to select colors for these images, enhancing the design flexibility within the builder. This ensures consistent and visually appealing website designs.
Original PR description
Steps to reproduce: 1. Go to the website and enter edit mode. 2. Drop `s_cta_mockups` or `s_closer_look` snippet. 3. Click on any image that has a shape. Issue: The color picker option is missing for images with shapes in these snippets. Reason: These snippet templates do not include the `shapeColors` dataset on the image elements. task-5880905 Forward-Port-Of: odoo/odoo#265465 Forward-Port-Of: odoo/odoo#246249
This update fixes an issue preventing employers from correctly managing multiple MPF account numbers under the same registration. The change allows for valid multi-account configurations by validating duplicates based on the combination of registration and employer account numbers, ensuring accurate payroll processing for Hong Kong businesses.
Original PR description
An employer can legitimately hold multiple employer account numbers under the same MPF registration number. The previous constraint rejected any two MPF schemes sharing the same registration number, blocking valid multi-account configurations. Fix the validation to only restrict the duplicate based on the combination of registration number and employer account number. task-6232561 Forward-Port-Of: odoo/enterprise#118109
This update resolves a visual bug where horizontal padding was lost in email banners after saving and reloading. The issue stemmed from how the system processed CSS styles, specifically when using variable references for padding. By replacing shorthand padding with explicit longhand properties, the banner now displays correctly across email templates.
Original PR description
Problem: In email templates, adding a banner/info block and saving then reloading causes the horizontal padding to be lost and the icon to become misaligned. Cause: During save, `convert_inline`…
Problem: In email templates, adding a banner/info block and saving then reloading causes the horizontal padding to be lost and the icon to become misaligned. Cause: During save, `convert_inline` processes the content via `_normalizeStyle`, which iterates over `CSSStyleDeclaration` using index-based iteration. This only yields longhand properties (e.g. `padding-left`, `padding-top`), never shorthands like `padding`. When the shorthand contains `var()` references (e.g. `padding: var(--y) var(--x)`), the browser cannot resolve the longhands and leaves them empty, so they are silently dropped during style extraction. Adding shorthand support to the iterator was not viable, as the rest of the pipeline expects longhand-only styles, and safely converting `padding: var(--y) var(--x)` to longhands is not possible without first resolving the variables. Solution: Replace the `padding` shorthand in the banner template with explicit longhand properties (`padding-top`, `padding-bottom`, `padding-left`, `padding-right`). Steps to reproduce: 1. Open an email template 2. Add a banner/info block 3. Save the template 4. Reload the page 5. Observe horizontal padding is lost and icon is misaligned task-6230530 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265756
This update corrects a migration issue that occurred when certain tax IDs were missing for Maltese companies. The fix prevents a crash caused by attempting to combine a recordset with a missing tax record, ensuring the migration process completes successfully. This improves the reliability of tax data updates for Odoo users in Malta.
Original PR description
### Issue: During migration of Malta taxes, the script can fail when certain tax XML IDs are missing for a company. If the XML ID does not exist, `env.ref(..., raise_if_not_found=False)` returns…
### Issue:
During migration of Malta taxes, the script can fail when certain tax XML IDs are missing for a company. If the XML ID does not exist, `env.ref(..., raise_if_not_found=False)` returns None. Trying to combine a recordset with None causes the migration to fail. Due to recent [commit]
### Traceback:
```py
tax_7 |= env.ref(f'account.{company.id}_VAT_S_IN_MT_7_G', raise_if_not_found=False)
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 6589, in __or__
return self.union(other)
File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 6603, in union
raise TypeError(f"unsupported operand types in: {self} | {arg!r}")
TypeError: unsupported operand types in: account.tax() | None
```
###
Solution:
Use a guard check with the walrus operator (:=) to assign and validate the tax record before union.
This ensures that only existing tax records are added to the recordset, preventing the crash.
Ticket [link1](https://www.odoo.com/odoo/project.task/6159300) [link2](https://www.odoo.com/odoo/project.task/6149387)
opw-6159300
opw-6149387
Forward-Port-Of: odoo/odoo#264327This update corrects an issue where delivery quantities weren't updating correctly after creating multiple production orders (MOs) using a multi-step route with batch sizes. The fix ensures that all MOs created during this process are properly linked to the delivery, guaranteeing accurate inventory updates upon validation. This resolves a discrepancy in how move destination IDs are handled during MO splitting.
Original PR description
### Steps to reproduce: - In the settings enable: Multi-steps routes - Inventory > Configuration > Warehouse Management > Routes - Unarchive MTO - Create a storable product P with a bom using the MTO…
### Steps to reproduce: - In the settings enable: Multi-steps routes - Inventory > Configuration > Warehouse Management > Routes - Unarchive MTO - Create a storable product P with a bom using the MTO Route - In the Miscellaneous tab of the bom tick Batch Size and set it to 2 - Create and confirm a sale order for 6 units of P #### > Three MO's are created but only the last one will update the quantities of the delivery at validation of the production. ### Cause of the issue: The `move_dest_ids` of the `move_finished_ids` is only set on the last of the three productions. That is only the last MO is properly chained to the delivery via an MTO chain. This happens because the `move_dest_ids` field of the `mrp.production` model is a `One2Many` field: https://github.com/odoo/odoo/blob/a2f072fe99a03aaf521bba1965e7f29a1c99e325/addons/mrp/models/mrp_production.py#L223-L224 Which implies that each move can be linked to at most one mrp.production via the `created_production_id` field. However, if you have set a batch size on your bom, it is expected for a single move to create multiple mo's. While the `move_dest_ids` of each of these MO is appropriately set in the create vals to be the mto `stock.move` of the delivery, due to the nature of the `created_production_id` field only the *last* mo will created with a set `move_dest_ids` as this is the only record that will be set as `created_production_id`. However, after the creation of these MO's, the related `move_finished_ids` will be recomputed: https://github.com/odoo/odoo/blob/a2f072fe99a03aaf521bba1965e7f29a1c99e325/addons/mrp/models/mrp_production.py#L1089-L1093 However, the `move_dest_ids` of the created moves will be set to be either the `move_dest_ids` of their production (which is unset for all but the last one) or these of the first production of the same `production_group` that is these generated by a common production split: https://github.com/odoo/odoo/blob/a2f072fe99a03aaf521bba1965e7f29a1c99e325/addons/mrp/models/mrp_production.py#L1263-L1267 Now, since neither are set in our use case, the `move_dest_ids` will not be set on the `move_finished_ids` which implies in particular that the mto link between our productions (but the last one) and the delivery is lost. Fix: Since we can not change the nature of the `move_dest_ids` and `created_production_id` in stable to become Many2Many fields, we need to find a way to propagate the `move_dest_ids` on moves without relying on the probably inaccurate value provided by the production. And, since the compute of the `move_finished_ids` could be launched at many other points than during a create process (because of the many dependencies), we can not solely rely on the creation context but rather new to provide a way to recreate the link from relations at any given point. We therefore rely on the `stock.reference`'s similar to what was done prior to 19.0 via the `procurement_group_ids`: https://github.com/odoo/odoo/blob/132f042ca14012877f608783b57a0ca9c4e565f3/addons/mrp/models/mrp_production.py#L1198-L1202 opw-6188069 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264951
This update resolves an issue where inserting a prompt banner using the `/prompt` command prevented users from undoing the action. The fix ensures that history commands function correctly even when a prompt banner is present, improving usability and preventing data inconsistencies.
Original PR description
Problem: After inserting a prompt banner, undo does not remove it. Cause: History commands were ignored when the selection was inside the prompt banner, preventing undo from handling banner insertion. Solution: Handle history commands even when the selection is inside the prompt banner. Steps to reproduce: - Insert a prompt banner using `/prompt` + Enter. - Press Ctrl + Z. - Observe that the banner is not removed. task-6230530 Forward-Port-Of: odoo/enterprise#117845
This update ensures that deleting a Cashdro payment line now correctly removes it from the system after cancellation. Previously, canceled payments remained in a 'retry' state. This change improves data accuracy and simplifies Cashdro payment management.
Original PR description
Before this commit, if you tried to cancel and delete a Cashdro payment line by clicking the x, the payment would be cancelled but the line would not be deleted, just left in the 'retry' state. After this commit, the payment line is deleted after being cancelled as expected. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265772
This update resolves an issue where the undo function wouldn't work correctly after inserting a table of contents. The fix prevents unnecessary history steps from being added, ensuring that users can reliably undo actions like inserting a table of contents without impacting other text editing features.
Original PR description
Problem: Undo does not work correctly after inserting a table of content when no paragraph follows it. Cause: `SelectionPlaceholderPlugin.onSelectionChange` clears attributes from the next base…
Problem: Undo does not work correctly after inserting a table of content when no paragraph follows it. Cause: `SelectionPlaceholderPlugin.onSelectionChange` clears attributes from the next base container and adds a history step whenever the selection changes. In the table of content case, this creates a loop: - Attributes are cleared and a history step is added. - Undo restores only the cleared attributes. - The selection falls back into the empty paragraph after the table of content. - `SelectionPlaceholderPlugin.onSelectionChange` runs again and adds another history step. As a result, undo never reaches the previous user action. Solution: Avoid adding a history step in `SelectionPlaceholderPlugin.onSelectionChange` when the current step is not modified by any user interaction. Steps to reproduce: - Write some text. - Insert a table of content using `/toc`. - Press Ctrl + Z. - Observe that nothing happens and the previously typed text cannot be undone. task-6216910 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264743
This update fixes an issue where the picking origin document incorrectly referenced the previous MO name after a manufacturing operation type was changed before confirmation. The fix ensures that the picking origin now accurately reflects the updated MO name, preventing data discrepancies in inventory management. This improves the reliability of stock movements.
Original PR description
**Issue**: When the name of a MO changes before confirmation, the picking origin may remain incorrect after confirmation. **Steps to reproduce**: - Make sure that multi-step route is enabled in the…
**Issue**: When the name of a MO changes before confirmation, the picking origin may remain incorrect after confirmation. **Steps to reproduce**: - Make sure that multi-step route is enabled in the settings - Configure the manufacturing route as 2-step - Go to Inventory > Configuration > Warehouse Management > Operations Types - Clone the "Manufacturing" operation type and assign a different Sequence Prefix - Create and save a MO, without confirming it - Change and save the operation type to the cloned one (the MO name changes) - Confirm the MO -> The picking source document uses the previous MO name instead of the new one **Cause**: The source document of the picking (`origin`) comes from its move: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1526 The move origin comes from the procurement values: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1575C13-L1575C56 Which relies on `self.reference_ids[0].name`: https://github.com/odoo/odoo/blob/95c73aa4dd7433f394799fdaaad57a84d750ec5a/addons/stock/models/stock_move.py#L1639 which is never updated, causing the origin to keep the previous MO name. opw-5979778 Forward-Port-Of: odoo/odoo#255874
This update fixes an issue where replenishment order quantities weren't being rounded correctly when using the same unit of measure as the product. Previously, orders would sometimes request an incorrect quantity. Now, replenishment quantities will always be rounded to the nearest whole unit, ensuring accurate stock levels and order fulfillment.
Original PR description
**Issue** Replenishment quantity is not rounded when the replenishment UoM is the same as the product UoM. **Steps to reproduce**: - Enable "Units of Measure & Packagings" setting - Create a tracked…
**Issue** Replenishment quantity is not rounded when the replenishment UoM is the same as the product UoM. **Steps to reproduce**: - Enable "Units of Measure & Packagings" setting - Create a tracked product and add a vendor using the same uom (ex: Unit) - Create a replenishment order rule: - min = 0 - max = 10 - multiple: Unit - Create a sale order for that product with 1.11 units -> It tries to replenish 11.11 units instead of 12 **Cause**: While computing `qty_to_order`, it rounds using the given multiple via `_get_multiple_rounded_qty`: https://github.com/odoo/odoo/blob/995629db3231de944710751c3184bf1b8b1355c7/addons/stock/models/stock_orderpoint.py#L471-L475 However, `_get_multiple_rounded_qty` skips rounding when the replenishment UoM matches the product UoM: https://github.com/odoo/odoo/blob/995629db3231de944710751c3184bf1b8b1355c7/addons/stock/models/stock_orderpoint.py#L802-L809 opw-[6015189](https://www.odoo.com/web#id=6015189&view_type=form&model=project.task) Forward-Port-Of: odoo/odoo#256006
This update resolves a bug where the Gantt view incorrectly displayed working hours for flexible employees during public holidays. The fix converts all time zone calculations to UTC, ensuring accurate representation of unavailable time slots. This prevents employees from being incorrectly scheduled to work during holiday periods.
Original PR description
[FIX] hr_attendance_gantt: fix gantt view with public holidays Bug reproduction: 1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026 2 -…
[FIX] hr_attendance_gantt: fix gantt view with public holidays
Bug reproduction:
1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026
2 - Create a new public holiday on 01/01/2026 (from 00.00 to 23.59 or 23.55 (depends on version, it does not matter))
3 - in attendance app the cell from 00.00 to 01.00 seems white for that day and for selected employee (this cell seems like not holiday and employee can work)
Bug cause:
1 - After a long traceback, _gantt_unavailability in hr_attendance_gantt/HrAttendance, if an employee is flexible then unavailable_intervals is calculated with the Brussel time zone
2 - All other unavailable intervals are converted to the UTC in the function of _gantt_unavailability except in the final lines of the function.
3 - When the employee is flexible and since the conversion is not done in the final lines, it remains 1 hour more (UTC+1), it is from 1 am to 1 am of next day instead of 0 am to 23.59.
Bug solution:
1 - I converted the timezone to UTC to solve the problem.
task - 6067070
Forward-Port-Of: odoo/enterprise#112493This update resolves an issue preventing users from correctly unreconciling SePA CT batch payments with a 'pending' online status. Previously, the system blocked this process, causing delays in bank statement reconciliation. The fix allows the internal unreconciliation flow to bypass validation, enabling accurate bank statement matching.
Original PR description
**Issue:** The account_online_payment module overrides `action_draft` to raise a UserError for sepa_ct payments belonging to a batch with a `payment_online_status` = 'pending' or 'accepted'. This…
**Issue:** The account_online_payment module overrides `action_draft` to raise a UserError for sepa_ct payments belonging to a batch with a `payment_online_status` = 'pending' or 'accepted'. This blocks the bank statement unreconciliation process. When `delete_reconciled_line` is called, it tries to set payments to draft and re-post them, despite it being an internal process not a manual user modification. **Steps to reproduce:** - Setup a 'sepa_ct' payment method on a bank journal. - Create a bill with a vendor with a trusted bank account. - Create a payment for that bill with a 'sepa_ct' payment method. - Add the payment to a batch. - Manually set the `payment_online_status` = 'pending'. - Create a bank transaction and reconcile it with the batch. - Try to unreconcile the lines on the transaction - Result: UserError 'You cannot modify a payment that has already been sent to the bank.' **Fix:** Pass a context flag to `action_draft` during the unreconciliation flow so that the validation is skipped when the call originates from the internal unreconcile flow. OPW-6080464 Forward-Port-Of: odoo/enterprise#117921
This update fixes an issue where Italian electronic vendor bills weren't correctly applying pension fund taxes (Cassa Previdenziale) during import. The change ensures that the system accurately processes invoices generated by third-party software, regardless of the presence of optional XML tags, guaranteeing correct tax calculations for Italian businesses.
Original PR description
### Issue before this commit: When importing an Italian electronic vendor bill using the AssoSoftware standard, pension fund taxes (Cassa Previdenziale) are not applied to the invoice lines. ###…
### Issue before this commit: When importing an Italian electronic vendor bill using the AssoSoftware standard, pension fund taxes (Cassa Previdenziale) are not applied to the invoice lines. ### Steps to reproduce the issue: 1. Download Accounting and l10n_it_edi_witholding 2. Change VAT number of IT company with the one in the xml 3. Go to Taxes > 4%F.Pens. > Advanced Options and change Pension Fund Type with TC02 4. Import xml of the ticket in vendor bills 5. P.Fund tax is not assigned ### Cause of the issue: The issue is caused by the following line: https://github.com/odoo/odoo/blob/669b9b84f4d5c8765dc4b451d5da6a95dbb9ded8/addons/l10n_it_edi_withholding/models/account_move.py#L247 Currently, the parser strictly expects the optional <RiferimentoTesto> tag alongside <TipoDato>AswCassPre</TipoDato>. However, several third-party software providers generate valid XML files containing only the AswCassPre block without any optional child tags. ### Reason to introduce the fix: Ensure that the pension fund tax mapped to the line's VAT rate is correctly applied whenever the AswCassPre data type is present, even if the optional reference tags are omitted. opw-6189225 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#265914 Forward-Port-Of: odoo/odoo#264083
This update resolves an issue where the VIES validation process was incorrectly triggered during tax return creation, leading to errors. The fix ensures that VIES validation only occurs for tax returns associated with invoices that require a VAT number. This improves the accuracy of tax reporting and prevents unnecessary errors.
Original PR description
Vies validation should only occurs with moves having fiscal position with vat required Steps: - With base_vat, and european l10n like BE installed - Make a bill for a partner with no vat or invalid vat - Create a tax return - Open the return -> the 'check_partner_vies' fails opw-6200246 Forward-Port-Of: odoo/enterprise#117913
This update resolves a problem where invoices with year-range invoice numbers (e.g., INV/2025-2026/00001) were failing to send to MyInvois. The fix corrects a technical error in how the system processes these invoice numbers, ensuring accurate transmission of invoices.
Original PR description
Currently, an error is produced when sending invoices to MyInvois if the invoice number uses a year-range sequence. **Steps to Reproduce:(v-19.0)** 1. Install the `accountant` and `l10n_my_edi`…
Currently, an error is produced when sending invoices to MyInvois if the invoice number uses a year-range sequence. **Steps to Reproduce:(v-19.0)** 1. Install the `accountant` and `l10n_my_edi` modules (with demo data). 2. Switch to "MY Company"(Malaysian company). 3. Enable "_Quick Encoding_" for Customer Invoices in Settings. 4. Create a customer invoice with customer "_MY Company_", set a Malaysian classification code and taxes on the invoice line, and confirm the invoice. 5. Set the invoice back to Draft and modify the invoice number with a year-range sequence (e.g., INV/2025-2026/00001), then confirm it again. 6. Open the invoice list view and click **"Send to MyInvois"**. **Error:** `ValueError: not enough values to unpack (expected 4, got 2)` The `_get_sequence_date_range()` method on `myinvois.document` overrides the method from `sequence.mixin` and returns only two values from `date_utils.get_fiscal_year()`. However, it expects the method to return four values at [1]. [1] - https://github.com/odoo/odoo/blob/57b6b8d63b038ede32dfcc833c30e93d0cf4166c/addons/account/models/sequence_mixin.py#L146 Ref: https://github.com/odoo/odoo/blob/1ce06257f877711bd5de5487364909d72b476318/addons/account/models/account_move.py#L4263 sentry-7320998540 Forward-Port-Of: odoo/odoo#266221 Forward-Port-Of: odoo/odoo#253237
A recent test failed because the system wasn't correctly assigning user permissions for displaying production lot information. This change ensures that the necessary user group (`stock.group_production_lot`) is automatically included in test environments, preventing similar errors and improving test reliability. This primarily impacts the MRP module.
Original PR description
Versions -------- - 18.0+ Steps ----- 1. Run `test_reservation_method_for_outgoing` without demo data. Issue ----- > AssertionError: 'lot_id' was not found in the view Cause ----- The `lot_id` field is only rendered if the current user has the `stock.group_production_lot` group. This is only default when demo data is installed. Solution -------- Add the group to the current user in `setUpClass`. runbot-243588 Forward-Port-Of: odoo/odoo#266164 Forward-Port-Of: odoo/odoo#266052
This update resolves an issue where the 'Caption' button within the HTML editor was not properly localized for different languages. This ensures consistent and accurate translations across all Odoo SaaS environments, improving the user experience for international users.
Original PR description
Currently the "Caption" button in the HTML editor is not translatable. This commit fixes that. Forward-Port-Of: odoo/odoo#266002
This update resolves an error occurring when generating invoices with agricultural tax (ClaveRegimenIvaOpTrascendencia) using the TicketBAI system. The issue stemmed from an incorrect value being submitted, preventing proper invoice processing. This fix ensures accurate invoice generation for clients utilizing this tax regime.
Original PR description
…hase bills **STEP TO REPRODUCE** 1. Create a bill with a invoice line with a regimen agricultura tax. 2. send the bill using TicketBAI. 3. You will get the following error: Error:cvc-enumeration-valid: Value '19' is not facet-valid with respect to enumeration '[01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13]'. It must be a value from the enumeration. opw-6200686 Forward-Port-Of: odoo/odoo#265785 Forward-Port-Of: odoo/odoo#264037
12 changes
Resolved issues and error corrections
This update optimizes a key query used in Point of Sale reporting, significantly speeding up the process. By adding the journal to the search criteria, the system now leverages an existing database index, dramatically reducing the time it takes to retrieve account move information. This results in faster and more responsive POS reporting.
Original PR description
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal…
Currently the query to get the closing difference account move is done by searching for the reference of the move, which is not very efficient. This commit optimizes this query by adding the journal to the search criteria, which allows us to benefit from the index on the journal_id field. Here is an example of the before after on a database with 39 million account_move records. Meanwhile only 10-20K account_move are linked to specific journals used in POS payment methods. All measures are performed with a warmed up cache [Explain Before](https://explain.dalibo.com/plan/h8edf56c09d7dfd7) ### Benchmark: <table> <thead> <tr> <th># of am</th> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td>38982635</td> <td>~17s</td> <td>~22ms</td> </tr> </tbody> </table> [Explain After](https://explain.dalibo.com/plan/be2397f176a6b29d) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#262148
This update resolves an issue where resizing the HTML editor's table would cause a crash when a table was removed. The fix restricts resizing to the primary mouse button and prevents the editor from running resize logic when there's no valid target, ensuring a more stable and reliable table editing experience.
Original PR description
#### Description of the issue this PR addresses: - Table resize listeners are not cleaned when the table is removed while resizing - Next mousemove runs resize logic with a null target and throws traceback #### Desired behavior after PR is merged: - Restrict resize start to primary mouse button only - Prevent resize logic execution on null targets #### Steps to reproduce: - Open the todo app - Insert a table and select whole table - Move cursor on a table cell border to see resize cursor - Right click and choose Cut from browser context menu - Move the mouse again - Resize logic crashes with null target traceback task-6212279 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264065
This update corrects a display issue where placeholder text in website translations was incorrectly rendered as HTML spans. The fix ensures that placeholder text is displayed as plain text, regardless of the language being used, improving the user experience for multilingual website content. This resolves a visual inconsistency and ensures accurate content presentation.
Original PR description
Since placeholder attribute is translated, for non-form elements placeholder attributes that contain a translation <span/> need to be unwrapped to restore the plain text value. Steps to reproduce the issue: - Have website and website_blog installed - Add a second language - Open a blog post in your second lanuage - Start translating - Remove the blog title => Shown placeholder text is <span ...> task-5190459 Forward-Port-Of: odoo/odoo#265575 Forward-Port-Of: odoo/odoo#263320
This update ensures that work entry data exported to the Acerta payroll system adheres to their specific formatting requirements. Specifically, the external reference number and work entry type code are now padded correctly, resolving potential data discrepancies and ensuring accurate payroll processing. This change improves data integrity and compliance with Acerta's system.
Original PR description
We want to adhere to the correct format for the export of work entries to Acerta. There, the number of external reference is padded to 17, not 20, and is followed by 3 spaces, before the date. Also, the code of the work entry type is padded to 4 and followed by 2 spaces. Task: 6168106 Forward-Port-Of: odoo/enterprise#118124
This update fixes an issue where employees with time off were incorrectly recorded as working extra hours during automatic check-out. The change ensures that employee schedules, including time off and breaks, are accurately reflected when calculating attendance, leading to more precise overtime tracking.
Original PR description
# Steps to reproduce 1. Set the Working schedule 40h/week 2. Employee takes 2 hours off from 15:00 to 17:00 and enable automatic check-out 3. Odoo will automatically checks out at 17:06 (scheduled end + tolerance) # Issue - This leads to 2h06 of extra hours being incorrectly recorded. # Fix - Use employee._get_expected_attendances instead, so contract-aware calendar resolution, leaves, and break time handling stay centralized in HR. task-5052044 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235442
This update resolves a bug where the Gantt view incorrectly displayed employee availability during public holidays for flexible schedules. The fix converts all time zone calculations to UTC, ensuring accurate representation of unavailable hours and preventing employees from being marked as available during holiday periods. This improves the accuracy of employee scheduling and time tracking.
Original PR description
[FIX] hr_attendance_gantt: fix gantt view with public holidays Bug reproduction: 1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026 2 -…
[FIX] hr_attendance_gantt: fix gantt view with public holidays
Bug reproduction:
1 - Select flex schedule employee (or change its schedule to 40h flex one) and make its contract before 01/01/2026
2 - Create a new public holiday on 01/01/2026 (from 00.00 to 23.59 or 23.55 (depends on version, it does not matter))
3 - in attendance app the cell from 00.00 to 01.00 seems white for that day and for selected employee (this cell seems like not holiday and employee can work)
Bug cause:
1 - After a long traceback, _gantt_unavailability in hr_attendance_gantt/HrAttendance, if an employee is flexible then unavailable_intervals is calculated with the Brussel time zone
2 - All other unavailable intervals are converted to the UTC in the function of _gantt_unavailability except in the final lines of the function.
3 - When the employee is flexible and since the conversion is not done in the final lines, it remains 1 hour more (UTC+1), it is from 1 am to 1 am of next day instead of 0 am to 23.59.
Bug solution:
1 - I converted the timezone to UTC to solve the problem.
task - 6067070
Forward-Port-Of: odoo/enterprise#112493This update resolves an error that occurred when creating bank accounts using the 'l10n_br' module. Specifically, the system was failing when a user entered a blank value for the 'Proxy Type' field. This change ensures the bank account creation process functions correctly, preventing data entry issues.
Original PR description
Creating a bank account with a falsy proxy value generates a traceback. Steps to reproduce the error: - Install ``l10n_br`` module with demo data - Switch to BR Company - Go to Contacts >…
Creating a bank account with a falsy proxy value generates a traceback. Steps to reproduce the error: - Install ``l10n_br`` module with demo data - Switch to BR Company - Go to Contacts > Configuration > Bank Accounts > Create a new bank account > Add any value as Account Number > Account Holder: BR Company > Proxy Type: CPF/CNPJ(BR) or Random Key (BR) > Save Traceback: ```py InvalidFormat: The number has an invalid format. ``` ```py TypeError: 'bool' object is not iterable ``` https://github.com/odoo/odoo/blob/132f042ca14012877f608783b57a0ca9c4e565f3/addons/l10n_br/models/res_partner_bank.py#L38-L45 For ``CPF/CNPJ`` validation, calling ``check_vat_br`` with a falsy proxy value raises a traceback. https://github.com/odoo/odoo/blob/132f042ca14012877f608783b57a0ca9c4e565f3/addons/l10n_br/models/res_partner_bank.py#L56-L61 For ``Random Key`` validation, ``re.fullmatch`` expects a string value, but receives ``False``, leading to a traceback. sentry-7488238698 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#264995
This update resolves an issue where UBL imports with taxes set to 'price_include' were failing to correctly calculate and apply taxes, particularly for invoices with multiple items. The fix ensures accurate tax calculations and adjustments, regardless of the quantity of items on the invoice. This improves the reliability of UBL import processes.
Original PR description
**PROBLEMS** 1. On a company with taxes with price_include = True, we fail to retrieve a tax when importing a ubl. 2. The price_unit adjustement for when importing price-included taxes doesn't account for quantity. **STEP TO REPRODUCE** 1. Have a setup where the tax are only price_include. 2. Import a ubl, the taxes will not be retrieved. 3. Run odoo only with the fix for problem 1, and import the same ubl with some invoice quantity != 1 4. Notice the price unit are messed up for lines with quantity != 1 (odoo tries to correct the untaxed amount with a line, but this doesn't fixes the tax). opw-6159394 Forward-Port-Of: odoo/odoo#265347 Forward-Port-Of: odoo/odoo#262686
This update resolves an error occurring when generating purchase invoices with agricultural tax (Regimen Agricultura) using the TicketBAI system. The issue stemmed from an incorrect value being submitted, preventing proper invoice processing. This fix ensures accurate invoice generation and compliance with Spanish tax regulations.
Original PR description
…hase bills **STEP TO REPRODUCE** 1. Create a bill with a invoice line with a regimen agricultura tax. 2. send the bill using TicketBAI. 3. You will get the following error: Error:cvc-enumeration-valid: Value '19' is not facet-valid with respect to enumeration '[01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13]'. It must be a value from the enumeration. opw-6200686 Forward-Port-Of: odoo/odoo#265785 Forward-Port-Of: odoo/odoo#264037
A recent test failed because the user account wasn't properly configured to display information about production lots. This change ensures that the necessary group (`stock.group_production_lot`) is added to the test user, allowing the test to run correctly and accurately reflect the system's behavior. This resolves a technical issue that could have impacted future test results.
Original PR description
Versions -------- - 18.0+ Steps ----- 1. Run `test_reservation_method_for_outgoing` without demo data. Issue ----- > AssertionError: 'lot_id' was not found in the view Cause ----- The `lot_id` field is only rendered if the current user has the `stock.group_production_lot` group. This is only default when demo data is installed. Solution -------- Add the group to the current user in `setUpClass`. runbot-243588 Forward-Port-Of: odoo/odoo#266164 Forward-Port-Of: odoo/odoo#266052
This update corrects a bug in how Odoo searches for records using property fields. Previously, a filter on a property field sometimes returned incorrect results due to an issue with how boolean values were being interpreted during the search process. This fix ensures that property filters work as expected, accurately returning only the intended records.
Original PR description
# How to reproduce - Go to the Form view of a model to which you can Add Properties (e.g. Project > Tasks) - Click on the gear icon > Add Properties - Create a property field with : - Name : X -…
# How to reproduce
- Go to the Form view of a model to which you can Add Properties
(e.g. Project > Tasks)
- Click on the gear icon > Add Properties
- Create a property field with :
- Name : X
- Field Type : Decimal
- Create two records for that model and set the value of the property to 1 & 2
- Go back and Add a custom filter with ('Properties.X', '=', 1)
# The problem
We see both records even tho we should only see one
# Cause of the issue
When doing the search, we transform the domain into the where clause of a
query. This transformation is done with the `condition_to_sql()`
function of the concerned field (`fields_properties` in our case):
https://github.com/odoo/odoo/blob/ba9e18688cc9c6e0d4da5ab60acf08d4c49b99d7/odoo/orm/fields_properties.py#L589
In this function, we manipulate a bit the condition depending on the value,
notably if the value is/contains True. To check it does, we do this :
https://github.com/odoo/odoo/blob/ba9e18688cc9c6e0d4da5ab60acf08d4c49b99d7/odoo/orm/fields_properties.py#L601
The issue is that in python, True in [1] and evaluates to True
because bool is a subset of int. This changes the condition and replaces it in
our case with ('Properties.X', '!=', 'False'), which is obviously not what
was initially asked for.
opw-6224811
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#265835This update resolves a potential issue that caused Out of Memory errors during the installation of the `sale_subscription` module on databases with extensive sales order data. The change ensures that newly added fields are correctly initialized to 'null' during installation, preventing performance bottlenecks and improving the overall installation process.
Original PR description
### Description: Installing `sale_subscription` on databases with a large number of `sale.order` and `sale.order.line` can cause Out of Memory (OOM) errors. The issue comes from two stored compute fields, `last_invoiced_date` and `plan_id`. Since these depend on newly added fields, they should default to `null` during installation. ### Reference: opw-6201267 Forward-Port-Of: odoo/enterprise#118008
1 change
Resolved issues and error corrections
This update ensures that work entry data exported to the Acerta payroll system adheres to their specific formatting requirements. The export now correctly pads the external reference number to 17 digits with spaces and formats the work entry type code to 4 digits with spaces, resolving potential data discrepancies and ensuring accurate payroll processing.
Original PR description
We want to adhere to the correct format for the export of work entries to Acerta. There, the number of external reference is padded to 17, not 20, and is followed by 3 spaces, before the date. Also, the code of the work entry type is padded to 4 and followed by 2 spaces. Task: 6168106 Forward-Port-Of: odoo/enterprise#118124
8 changes
Resolved issues and error corrections
This update fixes a technical issue in the Gantt view that prevented users from correctly filtering work orders when grouping by work centers. The fix ensures consistent functionality and prevents errors related to incorrect data interpretation, improving the overall planning process.
Original PR description
Before this commit: ------------------------- - When planning work orders in the Gantt view, applying a Group By on Work Center and then adding another grouping (e.g., Manufacturing Order or Status)…
Before this commit: ------------------------- - When planning work orders in the Gantt view, applying a Group By on Work Center and then adding another grouping (e.g., Manufacturing Order or Status) caused a traceback when clicking grouped rows in the panel. Steps to reproduce: ------------------------- 1. Install the `mrp_workorder` module. 2. Create and plan a Manufacturing Order. 3. Open the Planning Gantt view 4. Apply Group By → Work Center. 5. Add another group by (e.g., Manufacturing Order or Status) 6. Click on one of the groups (MO or Status) in the side panel. Cause of the issue: ------------------------- - Rows grouped by Work Center -> Manufacturing Order attempted to access a Work Center record that does not exist, leading to the error: `TypeError: Cannot read properties of undefined (reading 'display_name')` - Rows grouped by Work Center -> Status incorrectly treated the status value as a Work Center ID, leading to the error: `psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer` After this commit: ----------------------- - Rows created directly from the Work Center grouping are now correctly linked using their corresponding `workcenterIds` and remain clickable. - Rows created by additional groupings after Work Center (e.g., Manufacturing Order or Status) are no longer clickable. - This ensures a consistent interaction flow in the Gantt view and prevents the previous errors during filtering. Task ID: 6132396 Forward-Port-Of: odoo/enterprise#114565
This change improves performance by avoiding redundant queries when matching account statements to partners. Specifically, it eliminates unnecessary queries based on partner name and statement line data, reducing overall query execution time and improving responsiveness. This optimization enhances the user experience when viewing account statements and related partner information.
Original PR description
Various improvements related to performance for `<account.bank.statement.line>._retrieve_partner` Forward-Port-Of: odoo/enterprise#118267 Forward-Port-Of: odoo/enterprise#117738
This update fixes an issue where WhatsApp channel avatars were incorrectly displaying the default Discuss avatar after a member was added. Now, avatars are correctly pulled from the channel's WhatsApp member, ensuring accurate representation and a better user experience for WhatsApp channel communication. This improves the visual consistency and reliability of the WhatsApp sidebar.
Original PR description
WhatsApp sidebar avatars should be resolved from the channel's whatsapp member, not from an arbitrary non-self member. Before this fix, adding a member to a WhatsApp channel caused the default Discuss avatar to be displayed instead of the actual WhatsApp member's avatar. This happened because the correspondent was not correctly computed for channels of type whatsapp. task-[5879840](https://www.odoo.com/odoo/project/1519/tasks/5879840) Forward-Port-Of: odoo/enterprise#118012 Forward-Port-Of: odoo/enterprise#115745
This update fixes an issue where users could still add rental services to their cart even when resources were unavailable during their chosen time periods. The change moves critical time-checking code to ensure the system prevents users from adding unavailable products to their cart, improving the rental booking experience. This ensures accurate availability information is displayed to customers.
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 Forward-Port-Of: odoo/enterprise#118039 Forward-Port-Of: odoo/enterprise#114285
This update resolves an error that prevented rental orders from being confirmed in versions 17 and 18, and a subsequent division-by-zero error in newer versions. The fix skips unnecessary calculations when a Bill of Materials (BoM) isn't found, ensuring rental orders can be successfully confirmed.
Original PR description
**Steps to produce:** - Install `sale_mrp_renting`. - Enable `Rental Transfers` from settings. - Create a rental product. - Create two variants of the product. - Create a BoM for one variant and set…
**Steps to produce:** - Install `sale_mrp_renting`. - Enable `Rental Transfers` from settings. - Create a rental product. - Create two variants of the product. - Create a BoM for one variant and set its type to `Kit`. - Create a rental order using the other variant. - Try to confirm the order. **Issue:** In versions 17 and 18, a UserError is raised- ``` The unit of measure Units defined on the order line doesn't belong to the same category as the unit of measure False defined on the product. Please correct the unit of measure defined on the order line or on the product, they should belong to the same category. ``` From version 18.2 onward, a different error occurs ``` ZeroDivisionError: float division by zero ``` **Root cause:** In versions 17 and 18: At [1], since the BoM is created for a different variant , no BoM is found for the selected variant. As a result, when `_compute_quantity` is called at [2], the `bom.product_uom_id` is empty, which leads to the `UserError` from `_compute_quantity` method. In version 18.2+: At [1], as the BoM is empty. Then at [3], `_compute_kit_quantities` is called with an empty BoM, and at [4], this results in a division by zero error. **Solution:** Skip the computation when no BoM is found and directly return the quantity to avoid both the `UserError` and the `ZeroDivisionError`. [1]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L13 [2]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L20 [3]https://github.com/odoo/enterprise/blob/eaa70dcab2b49eadca1cf36008dd80cfccbb8e4e/sale_mrp_renting/models/sale_order_line.py#L21 [4] https://github.com/odoo/odoo/blob/91b09dbea5c8a306b5e9d2120466777f0248b360/addons/mrp/models/stock_move.py#L676 **opw-6082434** Forward-Port-Of: odoo/enterprise#118207 Forward-Port-Of: odoo/enterprise#114176
Internal agents were unable to access menu information due to a permissions error. This update restores necessary permissions, allowing agents to correctly retrieve menu details and resolve a previous access restriction. This ensures agents can function properly.
Original PR description
Purpose: -------- Currently an internal user can't use an agent that requires the list of available menus or get the details of any menu: an access error is raised stating that the user can't access ir.actions.client records. The issue for the get_available_menus was introduced by commit 15df7f50f67 in which the sudo was dropped when calling the tool. The sudo has been moved inside it when fetching the actions of the available menus. Task-6240831 Forward-Port-Of: odoo/enterprise#118153
This update incorporates the final migration of Owl3 to the Point of Sale (POS) module within Odoo Enterprise. This improves the POS system's performance and stability, ensuring a smoother experience for our retail partners. The migration also addresses technical debt related to the JesC framework.
A test was failing related to employee departures within the ESG HR module. This change corrected the test by ensuring that departures are only processed for employees with active contracts, aligning with business requirements. This resolves a technical issue preventing accurate reporting.
Original PR description
This test was failing due to the new changes at https://github.com/odoo/odoo/pull/264906 Departures can not be on an employee without a contract, hence the change from employee 3 (without a contract) to employee 1 (with a contract) in the test. task-6223154
3 changes
Resolved issues and error corrections
This update corrects a reporting issue in the GSTR-3B form by ensuring it only displays inward supplies, as required by tax regulations. Previously, both inward and outward supplies were incorrectly shown, leading to potential reporting inaccuracies. This change improves the accuracy of tax reporting.
Original PR description
Previously, both inward and outward composition supplies were appearing in table 5 of GSTR-3B, even though table 5 is meant only for inward supplies. This commit adds a `move_type` condition to ensure only inward supplies are considered in the report line. task-6239870
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 preserve the original document structure and integrity, improving usability and data consistency.
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#117881 Forward-Port-Of: odoo/enterprise#108684
This update resolves an issue where the 'Info & Tags' chatter wasn't visible in the mobile Documents app's Kanban view. The fix adjusts CSS styling to ensure the chatter element is always accessible and scrollable, improving usability on mobile devices. This ensures users can easily access important document information.
Original PR description
**Steps to reproduce:** - Go to Documents app in mobile - Go to the kanban view - Add some files and select one - Click on `Info & Tags` button in the control panel - Reload the page - Chatter is not…
**Steps to reproduce:** - Go to Documents app in mobile - Go to the kanban view - Add some files and select one - Click on `Info & Tags` button in the control panel - Reload the page - Chatter is not displayed but the button is still enabled - Switching to the list view properly shows it **Issue:** We have two conflicting css styling on mobile: - `overflow-hidden` was added for mobile to avoid multiple scroll bars - `min-height: 100%` which is due to the default `o_kanban_ungrouped` in the controller css This means that the element is present at the bottom of the page, but we can't get to it manually. When re-enabling the action we are properly moved to the existing chatter (but we can't go back to the top). Also the documents panel should have a single scrollbar to display all the records, but we still need a way to scroll the messages of the chatter. **Fix:** Set `min-height: 0;` for documents kanban to ensure the chatter is still visible and accessible on mobile by default. This makes the chatter take the full available height when displayed. original overflow fix: https://github.com/odoo/enterprise/commit/945b9e2b1c6752bd905695aa40b0babcf38c50cd opw-6061993 Forward-Port-Of: odoo/enterprise#113168
2 changes
Resolved issues and error corrections
This update fixes an issue where imported Peppol invoices with tax-included prices were incorrectly inflating unit prices when multiple quantities were imported. The fix ensures accurate tax calculations and correct unit pricing, preventing overcharging and improving data integrity during invoice imports. This impacts how tax is handled on imported invoices.
Original PR description
When importing a Peppol invoice with tax-included prices, the importer was incorrectly adding the total line tax to the per-unit price, which caused the price_unit to be inflated for quantities greater than 1. This fix computes the per-unit tax by dividing the total tax by quantity and restores the correct formula price_unit * (1 + rate). Step to reproduce: - Configure a company with "Tax-Included" Prices. - Receive a Peppo invoice from supplier A with a line named TEST, with quantity 1 and a tax. - Import the same invoice but with quantity 2. Expected behavior: The price_unit of the line TEST should be the same in both cases, and the total tax should be correctly computed as price_unit * quantity * tax_rate. Actual behavior: The price_unit of the line TEST with quantity 2 is inflated opw-6177504
This update resolves an issue where account consolidation reports would exclude accounts without a defined code on the selected company. Now, the system intelligently uses account codes from other companies within the consolidation to ensure accurate reporting and financial figures. This improves the reliability of consolidated reports.
Original PR description
When having an horizontal group with domain including two companies that
share the same account codes, report lines with account codes engine
don't display the two companies values when both are selected in the
company selector.
Steps to reproduce:
- Install l10n_ch and create two CH companies (CH1 and CH2)
- Create an horizontal group with the field 'Company' and domain '["|",
("name", "=", "CH Company"), ("name", "=", "CH 2")]"
- Apply the Horizontal group to CH balance sheet report
- Select both companies in the company selector
- Open CH BS report and activate the horizontal group
-> Only the column of one company is filled
Fix:
https://github.com/odoo/enterprise/commit/9b775ed9d8b2a18e708219c72e95652571f3936a
was introduced in 19.0 to fix the same issue, we fix by backporting it
but we also need to backport this perf commit https://github.com/odoo/enterprise/commit/7da3123dc4487a7092deef8503a9791ceffddcfb
that refactored the code before in a first place
opw-62046011 change
Resolved issues and error corrections
This update resolves an issue where upsell quantities were incorrectly added to the original subscription order line. The fix utilizes a 'sequence' field to ensure accurate matching between parent and upsell lines, guaranteeing correct quantity updates and preventing incorrect order calculations. This improves the reliability of subscription order management.
Original PR description
Steps to reproduce: ----------------------------------- 1. Install Subscription module 2. Create and Confirm Subscription Order as follows: * Create 2 SOL with the same product with different…
Steps to reproduce: ----------------------------------- 1. Install Subscription module 2. Create and Confirm Subscription Order as follows: * Create 2 SOL with the same product with different quantities 3. Create and Confirm the Invoice of the Sale Order 4. Create an Upsell of the SO 5. Change the First line's quantity to any value (e.g, 3) 6. Confirm the Upsell Order 7. Go back to the original order Observation: ----------------------------------- The quantity added in Upsell is added to the quantity of the Second line of the Original Order. Issue: ----------------------------------- The `_compute_parent_line_id` method matches upsell lines to their parent lines based on product attributes (product_id, price_unit, product_uom_id, currency_id, plan_id). When multiple parent lines have identical attributes, the matching becomes ambiguous. The algorithm processes upsell lines sequentially and removes each matched parent from the pool. https://github.com/odoo/enterprise/blob/4c9682e9cf84a0e4e69b5b650833cbccc77b063e/sale_subscription/models/sale_order_line.py#L336-L337 Without a stable identifier like a sequence, the algorithm takes the LAST matching line arbitrarily, causing incorrect parent-child mappings. Solution: ----------------------------------- Using 'sequence' as the matching criteria in `_compute_parent_line_id`, Sequence provides a stable, predictable identifier that preserves line order. Lines with the same product attributes but different sequences will now match correctly based on their position in the order. Added 'sequence' to line_values in `_get_renew_upsell_values` because the `parent_line_id` field is a COMPUTED field (with `store=True`). When creating upsell lines, even though we set `'parent_line_id': line.id` in the values, Odoo will recompute it using `_compute_parent_line_id`. If we don't preserve the sequence from the parent line, the newly created upsell line will get a default/auto-incremented sequence that doesn't match its parent's sequence. This breaks the sequence-based matching we just added. opw-6083153