Daily updates from Odoo
Navigate
Branch
Friday, July 4, 2025
64 changes
36 changes
Enhancements to existing features
This update adds foundational automated boot tests for several Point of Sale extensions, helping verify that their data models load and behave correctly. It reduces the risk of future regressions in appointment, IoT, restaurant appointment, payment terminal, and food delivery integrations without changing day-to-day user workflows.
Original PR description
*: pos_appointment, pos_iot, pos_restaurant_appointment, pos_tyro, pos_urban_piper, pos_urban_piper_enhancements Add a base for running boot tests in PoS. All models available in the PoS have been added via the `models.ServerModel` tool so that they are available in the `MockServer` In this way, we can simulate the generation of the model definitions required for the related model, JS classes and data service. We can now instantiate the related models and call all the methods specific to each model. Forward-Port-Of: odoo/enterprise#88898
This update adds several state-specific payroll tax rates used in US salary calculations, including Alabama, Colorado, and Washington. It helps payroll teams calculate employee pay and employer obligations more accurately based on current state requirements.
Original PR description
Added salary rules for state: - US: Alabama ESA rate - US: Colorado Support Surcharge rate - US: Colorado Solvency Surcharge rate - US: Washington EAF Rate task-4814709 Forward-Port-Of: odoo/enterprise#89344 Forward-Port-Of: odoo/enterprise#87708
This update improves how internal references are handled in several reporting and configuration screens, reducing the chance of fragile or confusing setup behavior. It affects data cleaning, sales commissions, and subscription areas without introducing visible workflow changes for most users.
Payroll users can now click payslip line list headers without accidentally changing the order of the entries. This keeps payslip information displayed in its intended sequence and reduces confusion during payroll review.
Original PR description
In this PR, we disabled the payslip line ordering when clicking on the list header but introducing a custom js which overrides the onClickSortColumn to not sort the list when the current className inside the archInfo includes 'disable_sort'. Task: 4793653.
The Belgian payroll Eco-Vouchers wizard now keeps each national identification number on its own line. This helps payroll teams correctly handle employees whose NISS changed during the relevant period, reducing reporting confusion and improving voucher file accuracy.
Original PR description
In the Eco-Vouchers wizard, we should have only 1 NISS per line so if an employee changed NISS, it may need multiple lines. Task: 4866687
Uruguayan electronic invoices now send the invoice line name consistently as the mandatory item name, while placing overflow text, product descriptions, and addenda in the optional description field. This prevents duplicated product names on generated reports and keeps invoice XML aligned with DGI length requirements.
Original PR description
This PR aims to improve the way we create NomItem and DscItem lines on the XML files we send to DGI in order to generate the PDF report. We have two fields to inform to DGI in an electronic invoice,…
This PR aims to improve the way we create NomItem and DscItem lines on the XML files we send to DGI in order to generate the PDF report. We have two fields to inform to DGI in an electronic invoice, NomItem which is mandatory an has a maximum of 80 characters to send, and DscItem that is optional an has a limit of 1000 chars. So we ensure NomItem is always sent, and the description will be filled like this: First, if the product name is longer than 80 chars, DscItem field will contain the characters that didn't fit in the NomItem field (characters from the 80th) Then it will contain the description of the product and the addenda content if it exists. Plus, I refactor the method _l10n_uy_edi_cfe_D_global_discount so it is also aligned with what I mentioned before. Another reason for this improvement is that, as the description of a product contains the product name at the beginning, we faced some issues when a user added a description on the fly in the line of the product, and then confirmed and printed the report. In this case, the name of the product was duplicated in the report. With this change, the description will only contain the the part of the product name that exceeds the 80th character. Example:  Forward-Port-Of: odoo/enterprise#80993
The Mexican reports test suite was updated to reflect newly added accounts. This helps ensure financial reporting checks remain accurate and reduces the risk of false test failures after account changes.
Original PR description
This adapts the tests to the newly added accounts in l10n_mx. Old PR: #87674 opw-4799052
The marketing automation test suite was updated to use a newer testing approach. This improves maintainability and helps ensure future changes can be validated more reliably, without changing day-to-day user functionality.
Original PR description
task-4028356
PDF exports for accounting reports now generate report content progressively instead of holding all report pages in memory at once. This reduces memory usage during large exports and uses a cleaner internal mechanism for PDF rendering.
Original PR description
When generating the pdf export, we first generate all the bodies of the reports to export in HTML, then add them to a stream, and finally use it to generate the pdf => doing that, we'll use twice the memory: once for all the html, once for the copy in the stream. We can do better by yielding report by report the HTML it generates :) Use self.allow_pdf_render intead of directly patching wkhtml, since allow_pdf_render is cleaner. task-4823834
Shop floor users can now adjust routing directly from a work order, including adding the next operation or moving work to another work center. This reduces back-and-forth with manufacturing order overview screens and gives teams more flexibility while work is already in progress.
Original PR description
**Desired behavior after PR is merged:**
- Add modify routing button in shopfloor workorders with the ability to create another workorder or move work centers
- Allow moving to another work center while the workorder is still in progress
Task:4850003Odoo AI can now use system-managed agents that stay hidden from regular users and cannot be edited or deleted through the interface. These agents can provide direct AI responses without opening chat channels, enabling smoother background automation and simpler user experiences.
Original PR description
## Purpose - Introduced a new is_system_agent flag to distinguish system agents from user-created agents. System agents are hidden from the UI and are not editable by users. - Added a new method get_direct_response() to allow system agents to generate direct responses without creating chat channels.
Users can now turn off the journal-specific filter directly from the bank statements view. This makes it faster to switch from a focused journal view to all bank statements without returning to the dashboard.
Original PR description
This improves the UX by allowing users to quickly switch off the filter and see all bank statements, rather than having to go back to the dashboard and reselect the journal. Task ID: 4797334
This update modernizes how accounting-related modules define filtering logic across reports, payments, transfers, payroll, helpdesk, ESG, and localization features. The change is mostly internal, helping keep financial features consistent and easier to maintain without altering day-to-day business workflows.
Original PR description
odoo/odoo#206960
When registering payments with SEPA Direct Debit, users now see a clear banner listing any partners without a valid SEPA mandate. This helps teams quickly identify who needs mandate setup before payments can be processed.
Original PR description
When users try to register one or multiple payments with 'SEPA Direct Debit' method, and one or more partners don't have a valid SEPA mandate, a banner alerts the user and mention the names of the concerned partners. This makes it easier for the user because he directly sees the partners for which he has to set a SEPA mandate. task-4575537 runbot : https://runbot.odoo.com/runbot/bundle/18-0-sepa-missing-links-roto-353391 Forward-Port-Of: odoo/enterprise#81019
Resolved issues and error corrections
The Mexican electronic invoicing flow now saves the invoice sending time before contacting the external certification provider. This helps prevent duplicate CFDI documents with slightly different timestamps when a connection is interrupted and Odoo retries the send.
Original PR description
### Background In https://github.com/odoo/enterprise/pull/85026 we changed the behaviour of `l10n_mx_edi_post_time` so that it gets set during the CFDI sending process, rather than when the invoice…
### Background In https://github.com/odoo/enterprise/pull/85026 we changed the behaviour of `l10n_mx_edi_post_time` so that it gets set during the CFDI sending process, rather than when the invoice is posted. This was needed to ensure that the post time both reflects the sending time and is re-used if the invoice needs to be re-sent. ### Bug description Since then, several Mexican customers have reported that some CFDIs are sent duplicated, with a difference of a few seconds in the CFDI's Fecha. ### Analysis A disconnection might occur during sending of the CFDI. In that case, the PAC will process the CFDI, but in Odoo the transaction will be rolled back, and the `l10n_mx_edi_post_time` will be lost. When Odoo re-sends the CFDI, it will take a new `l10n_mx_edi_post_time`. ### Solution Commit before performing the API call so that the `l10n_mx_edi_post_time` gets committed to DB. opw-4780096 Forward-Port-Of: odoo/enterprise#89263 Forward-Port-Of: odoo/enterprise#89117
The bank reconciliation report now shows transaction amounts with the correct currency when journal entries come from journals using a different currency than the company currency. This prevents misleading balances where an amount was calculated in one currency but displayed with another currency symbol.
Original PR description
…eport Currently in bank reconciliation report we expect all the entries to have the balance encoded in journal currency However it may not be the case if an entry is posted in a misc journal set in another currency Steps to reproduce: - Create a new journal in another currency (€) than the company's ($) - Create a new journal entry using the journal main account - Go to the account dashboard > click on the 3 dots of the journal - Open the Reconciliation report Issue: The journal entry amount is in company curreny (balance), but with the journal currency symbol (€) opw-4701349 Forward-Port-Of: odoo/enterprise#89321 Forward-Port-Of: odoo/enterprise#87313
Cancelling a drag-and-drop action in Documents now properly removes the temporary preview card. This prevents duplicate-looking cards from lingering on screen and keeps the Documents view visually clean and reliable.
Original PR description
Before this commit, when aborting a drag & drop sequence in documents views, the temporary card "ghost" was not removed from the DOM, and stayed in place. This was most noticable in tests, where multiple cards would pile up on the screen. This commit, adds a cleanup for each added card, to ensure that they are properly disposed of. Forward-Port-Of: odoo/enterprise#89418
Odoo Studio now removes extra spaces from the end of selection values before saving them. This prevents confusing duplicate-looking options and makes reused values more reliable across customizations.
Original PR description
Before this commit it was possible to create selection values with trailing spaces. This could be very misleading when reusing these values somewhere else. After this commit, such values are trimmed before saving. opw-4877276 Forward-Port-Of: odoo/enterprise#89311 Forward-Port-Of: odoo/enterprise#88255
This fix ensures that when an invoice is reset to draft, any related posted deferred entries are cancelled as expected. It helps keep accounting records consistent and prevents old deferred entries from remaining active after an invoice is reversed.
Original PR description
When resetting an invoice to draft, its posted deferred entries should be cancelled. This is adding a test to the linked fix. Linked community PR: https://github.com/odoo/odoo/pull/216628 opw-4891975 Forward-Port-Of: odoo/enterprise#89392 Forward-Port-Of: odoo/enterprise#88992
This fix prevents the invoice OCR process from creating duplicate supplier records when multiple documents from the same supplier are processed at the same time. It improves data quality and reduces manual cleanup for accounting teams using automated invoice extraction.
Original PR description
When the OCR parses documents from the same supplier concurrently, it can happen that it creates duplicated `res.partner` entry for it. This typically happen when the update of the documents is done…
When the OCR parses documents from the same supplier concurrently, it can happen that it creates duplicated `res.partner` entry for it. This typically happen when the update of the documents is done through the webhook. In that case, the different SQL transactions overlap each other and can't "see" the partner created by another request. In order to prevent this, a new field `is_created_by_ocr` and a unique index are introduced to be able to detect duplicated partners created by the OCR. This solution is quite costly as it requires introducing a new field and an index on `res.partner`... Other alternatives were considered: - Updating the documents through a cron instead -> introduces latency, especially on the SaaS where we can't force a cron to run immediately, even with a cron trigger. - Introducing a new model on which we could add the uniqueness model -> also costly, requires a new model just to fix the issue, and we need a way to frequently clean the records, so probably a cron on top of it (or using autovacuum, but its frequency might be too low). - Adding random delay on OCR side before calling the webhook -> introduces latency and no guarantee, it only reduces the chances of duplicated partners. - Using explicit SQL locks -> no guarantee, we only know what should be locked late in the SQL transaction (after fetching the results from the OCR), it wouldn't be very effective. Locking the whole `res_partner` table from the start of the transaction would be too restrictive and equivalent to serializing the transactions. An attempt was made in #88830, but it was deemed too complicated. task-[4904333](https://www.odoo.com/odoo/project/2068/tasks/4904333)
The Knowledge article comment composer now shows only the intended Log button instead of also showing a duplicate paper-plane send button. This reduces confusion for users when adding comments to article text.
Original PR description
Steps to reproduce =============== 1. Go to knowledge. 2. Open any article with write access. 2. Open the comment composer for any text of article. --> Two buttons are shown to post a comment. (Paper-plane and `Log` button) From [Commit], the condition to show the paper plane was modified, which will be always evaluated to `true` for the knowledge comment composer. After this commit, we will explicitly make that condition false for knowledge comment composer. Task-4866473 [Commit]: https://github.com/odoo/odoo/commit/9ba04f2a28f4d2b1adeb04628383d4730b5e72b6 Forward-Port-Of: odoo/enterprise#88225
Fixes an issue where GSTR-2B JSON files were attached to messages but not properly linked to newly created vendor bills. Bookkeepers can now open these attachments without seeing a 404 error, improving reliability during GSTR-2B matching.
Original PR description
**Before this PR:** - The GSTR-2B JSON was attached to the message but not linked to the newly created bills (`res_id` was not set). - As a result, when a Bookkeeper user created a new GSTR-2B bill and tried to open the attachment, it raised a 404 error: `"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."` **After this PR:** - The issue is resolved. - During GSTR-2B matching, unattached message attachments are now properly linked to the newly created bills by updating their res_model and res_id fields. Task ID : 4831758 Forward-Port-Of: odoo/enterprise#89250 Forward-Port-Of: odoo/enterprise#86785
This fixes which ticket form is opened when working with Helpdesk timesheets, ensuring users see the version that respects team restrictions. It reduces the chance of agents landing on the wrong ticket layout or missing the expected controls when recording time.
Original PR description
- Replaced `form_view_ref` from `helpdesk_timesheet.helpdesk_ticket_view_form_inherit_helpdesk_timesheet` to `helpdesk_timesheet.helpdesk_ticket_view_form_inherit_helpdesk_timesheet_restrict_teams`. - Add primary mode - use lambda for team_id default Forward-Port-Of: odoo/enterprise#88975
This fixes inconsistent data loading between the standard Point of Sale and self-ordering flows. Businesses should see fewer errors when shared POS information is needed, including receipt printing in self-ordering scenarios where session data may not always be available.
Original PR description
*: l10n_br_edi_pos, l10n_cl_edi_pos, l10n_ec_edi_pos, l10n_ke_edi_oscu_pos, l10n_mx_edi_pos, l10n_pe_edi_pos, pos_blackbox_be, pos_iot, pos_mobile, pos_preparation_display, pos_restaurant_appointment, pos_self_order_iot, pos_settle_due Before this commit, the loading data behavior between self-ordering and PoS was merged but not consistent. This led to issues when we try to add some data to load for both self-ordering and PoS. At the moment, we need to create two separate method to handle both cases. Now with this commit, we have consistent methods which will load data for both self-ordering and PoS. This will allow us to have a more consistent behavior and avoid issues when adding data to load. An explicit example is about `_server_version` object which is added to the `pos.session` model and used when printing the receipt. Since the session isn't always available in self-ordering, sometimes that object isn't available, leading to issues when printing the receipt.
This fixes a visual issue in spreadsheets where the icon for a selection filter was not shown in the side panel. Users can now more easily recognize and work with this type of filter, reducing confusion when configuring spreadsheet filters.
Code cleanup and technical improvements
The mail prompt feature now uses Odoo's default AI assistant instead of an older external endpoint. This makes AI-generated mail responses more consistent and easier to maintain, with updated tests to protect the behavior.
Original PR description
- This drops the use of the olg iap endpoint in the mail prompt feature. - We also refactor the `_generate_response` method to ensure the system messages are at the beginning of the full set of conversation.
The date and time service used by several Odoo screens has been simplified so its internal responsibilities are clearer and easier to maintain. This is mainly an internal cleanup that should reduce future maintenance effort without changing day-to-day user workflows.
Original PR description
This commit is a rework of the DateTime service & hook modules in web. The API of the 'datetime_service' was too convoluted, bloated with exported members that were only used by the hook. Now, most of the logic is handled by the service, and the hook simply gives it a flag to tell the service to handle Owl lifecycle hooks. This effectively allows to only send the few members (methods & variables) that are used by callers of the service externally. Community: https://github.com/odoo/odoo/pull/217179 Task [3495251](https://www.odoo.com/odoo/project/133/tasks/3495251)
The website editor assets are reorganized into a dedicated bundle used by website-related apps. This helps keep future email marketing assets separate from the full website builder, reducing unnecessary loading and making maintenance cleaner.
Original PR description
Community PR: https://github.com/odoo/odoo/pull/215218 ------ [[REF] website, *: add website.website_builder_assets bundle](https://github.com/odoo/enterprise/pull/88346/commits/0bdf7a526888b3c9f8a45fb31fe74e416b6341e1) *: website_appointment, website_helpdesk, website_knowledge, website_sale_renting, website_studio This commit adds the `website.website_builder_assets` bundle which includes `html_builder.assets` and is used by the website builder editor. This will allow mass_mailing to have its own bundle too, without the need to load everything from the website builder. Forward-Port-Of: odoo/enterprise#88346
This update cleans up how several web interface components build page content, reducing security warnings from automated checks. It is an internal code quality change that helps keep the interface safer and easier to maintain without changing business workflows.
Original PR description
Use markup template and html functions to make the code cleaner and safer while no longer triggering ci/security flag.
The document PDF manager’s automated tests were moved to a newer testing framework. This helps maintain test reliability and makes future changes easier, with no expected change for users.
The accounting reports module’s automated tests were converted to a newer testing framework. This is an internal maintenance change that helps keep quality checks reliable without changing day-to-day product behavior.
The social testing module updates its automated checks to use a newer internal test framework. This helps keep the module easier to maintain without changing business features or user workflows.
The sales planning scheduling view was updated to use safer, cleaner methods for displaying formatted text. This reduces internal security-check noise and helps keep the feature easier to maintain without changing the user experience.
Original PR description
Use markup template and html functions to make the code cleaner and safer while no longer triggering ci/security flag.
Miscellaneous changes
Before this PR: - Fields `l10n_in_exception`, `l10n_in_gst_return_period_id`, and `l10n_in_gstr2b_reconciliation_status` were copied when duplicating records. - The field label for GSTR-2B status was shown as just "Status", which could be ambiguous. After this PR: - Added `copy=False` to all three fields to prevent unintended data duplication. - Updated the label "Status" to "GSTR-2B Status" in `l10n_in.gst.return.period` to make the purpose clear. OPW: 4882698 Forward-Port-Of: odoo/e
Original PR description
Before this PR: - Fields `l10n_in_exception`, `l10n_in_gst_return_period_id`, and `l10n_in_gstr2b_reconciliation_status` were copied when duplicating records. - The field label for GSTR-2B status was shown as just "Status", which could be ambiguous. After this PR: - Added `copy=False` to all three fields to prevent unintended data duplication. - Updated the label "Status" to "GSTR-2B Status" in `l10n_in.gst.return.period` to make the purpose clear. OPW: 4882698 Forward-Port-Of: odoo/enterprise#88420 Forward-Port-Of: odoo/enterprise#88110
Steps to reproduce - install `industry_fsm_sale_subscription` - go to settings -> enable `recurring task` - create product with following configs : * enable `subscription` * product type : `service` * create on order `task` * project `Field service`  - create a SO with this product - go to `Tasks` smart button - select the task and mark it done - ope
Original PR description
Steps to reproduce
- install `industry_fsm_sale_subscription`
- go to settings -> enable `recurring task`
- create product with following configs :
* enable `subscription`
* product type : `service`
* create on order `task`
* project `Field service`

- create a SO with this product
- go to `Tasks` smart button
- select the task and mark it done
- open the second task, from "recurring tasks" smart button
Obervation: in newly created task `Sales Order Item` is not linked
Issue:
- after this commit odoo/enterprise@be201cd ,sale fields are not copied for fsm task. while this is true for simple tasks, we would require such fields to be copied for recurrence tasks
Fix:
- allow sale fields to be copied for recurring tasks
opw-4875830
Forward-Port-Of: odoo/enterprise#88108This PR introduces new product-level codes for l10n_pe, in accordance with the latest updates from SUNAT: ### Withholding codes (detracciones): - Code `044`: Servicio de beneficio de minerales metálicos gravado con el IGV - Code `045`: Minerales de oro y sus concentrados gravados con el IGV These were added to the `l10n_pe_edi` module. ### Tariff fractions: 39 new values were added based on the SUNAT's updated list of tariff fractions for delivery guides. These were added to t
Original PR description
This PR introduces new product-level codes for l10n_pe, in accordance with the latest updates from SUNAT: ### Withholding codes (detracciones): - Code `044`: Servicio de beneficio de minerales metálicos gravado con el IGV - Code `045`: Minerales de oro y sus concentrados gravados con el IGV These were added to the `l10n_pe_edi` module. ### Tariff fractions: 39 new values were added based on the SUNAT's updated list of tariff fractions for delivery guides. These were added to the `l10n_pe_edi_stock` module. **Source:** https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20250421.xlsx Forward-Port-Of: odoo/enterprise#87138
28 changes
New functionality added to Odoo
Adds a new Türkiye localization module that creates XML files for individual stock transfers. Businesses can upload these files to Nilvera to create e-Dispatch records, helping Turkish operations handle dispatch documentation more efficiently.
Original PR description
This PR adds a new module for Türkiye e-Dispatch. It generates an XML file for individual stock transfer which can be uploaded to Nilvera to create e-Dispatch records. TaskID:4270304 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194384
Adds support for India GSTR-1 Table 13 document summaries, allowing businesses to generate or manually update document summary lines for each return period. The data is included in GST JSON submissions and spreadsheet exports, improving compliance reporting and audit checks.
Original PR description
- Introduced a new module l10n_in_reports_gstr_document_summary to handle Table 13 (Document Summary) in GSTR-1 reporting. - Enables both automatic generation and manual updation of document summary lines for each return period. - Automatic generation currently supports three document types: invoices (out_invoice) , debit notes (debit_origin_id) and credit notes (out_refund). - Integrates directly with GSTR-1 JSON by appending the doc_issue structure as per the official GST schema. - Also extends the GSTR-1 spreadsheet export to include document summary data for verification and auditability. taskId-4765771
Enhancements to existing features
In the French accounting localization, delivery dates are no longer automatically copied from the invoice date. This ensures delivery dates are entered only when users explicitly provide them, improving accuracy for business records.
Original PR description
This commit prevents the delivery date from being set to invoice date by default in French localization. We need the delivery date to be only set by the users. task-4900043 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Grouped customer invoice payments now use a PAY/XXXXX memo instead of BATCH/XXX. This avoids confusion with the separate Batch Payment feature and makes payment references clearer for accounting users.
Original PR description
Purpose ------- This improves clarity in group payment memos: the previous BATCH/XXX prefix could be misleading as it resembled the Batch Payment feature, while the generated payment was unrelated to it. Changes ------- Replaced BATCH/XXX prefix with the more generic and consistent PAY/XXXXX format. Aligns with the syntax introduced in v18 for payments without entries. How to test ------- Go to Accounting > Customers > Invoices. Select multiple posted customer invoices. Click "Action" > "Register Payment". Tick the "Group Payments" checkbox. Validate the payment. The generated memo should now use the PAY/XXXXX format instead of BATCH/XXX. Confirm that batch payment features are not affected.
This change adds checks to make sure customer phone numbers, email addresses, and website links are properly formatted before they are saved. It helps keep contact records cleaner and reduces problems caused by incorrect customer information.
Original PR description
Added validation for phone, email, and website fields on res.partner Added validation logic to ensure only properly formatted phone numbers, emails, and website URLs are accepted when creating or updating a customer/contact. Description of the issue/feature this PR addresses: Customers could be created with invalid phone, email, or website values. Current behavior before PR: No validation exists for the format of phone, email, or website fields on res.partner. Desired behavior after PR is merged: Validation is enforced for phone, email, and website fields, preventing the creation or update of a customer/contact with invalid values. I confirm I have signed the CLA and read the PR guidelines at [www.odoo.com/submit-pr]
Saudi e-invoicing journal onboarding now creates unique identifiers using each journal's code, name, company, and internal ID. This reduces duplicate setup issues and alerts existing users to re-onboard affected journals where prior identifiers may not have been unique.
Original PR description
… common name to be unique per journal Previously, the company name was used as the common name when onboarding the journal. However, the common name has to be unique. The fix changes the common name to use the journal's short code, journal name, and company name to ensure uniquness. Additionally, an improvement is applied to the serial number on journals. Previously, users inputted this field manually. Now, the system uses the journal's id as the serial number to ensure uniqueness. A post-migration script was added to notify users that they need to re-onboard their journals. This is done in case users previously onboarded journals with non-unique serial numbers. task-4797124 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#216135 Forward-Port-Of: odoo/odoo#215012
Resolved issues and error corrections
Mobile self-ordering no longer fails when customers order items priced at zero. The fix preserves the original order details so free orders can be completed without errors or lost tracking information.
Original PR description
Issue: When [currentOrder](https://github.com/odoo/odoo/blob/a43ef8e15f4e0ee28bdb1975a8a359d3373e8d2c/addons/pos_self_order/static/src/app/self_order_service.js#L377) evaluates orders, it returns an…
Issue: When [currentOrder](https://github.com/odoo/odoo/blob/a43ef8e15f4e0ee28bdb1975a8a359d3373e8d2c/addons/pos_self_order/static/src/app/self_order_service.js#L377) evaluates orders, it returns an order only if it's in 'draft' state or 'paid' with zero amount in kiosk mode. https://github.com/odoo/odoo/blob/a43ef8e15f4e0ee28bdb1975a8a359d3373e8d2c/addons/pos_self_order/static/src/app/self_order_service.js#L377-L386 If self_ordering_mode is not 'kiosk' (e.g., 'mobile'), such orders do not match the filter. (Note: 0 priced orders are considered as 'paid') if order is not found (because it didn't pass the filter), a new order is created and returned https://github.com/odoo/odoo/blob/a43ef8e15f4e0ee28bdb1975a8a359d3373e8d2c/addons/pos_self_order/static/src/app/self_order_service.js#L393-L412 and the original order context— like access_token and tracking_number—is lost in new order, raising a traceback. Steps to reproduce: - Enable the self-ordering for a POS Restaurant - change the price of a product available for self-ordering to 0 - open the self-ordering and just order the product FIx: As this is a corner case, concerning, 0 priced orders from `mobile` mode, we return the original order in this case, else return the current order Note: - A [fix](https://github.com/odoo/odoo/commit/9f1441cc43c951356dc1a48555621c326a5be8f2 ) was applied for this exact issue, but it gradully got removed later in other PRs. [here](https://github.com/odoo/odoo/pull/192874/files#diff-0c985bf4d5fc0f1d25c9014209f090dd09727488ec15ca71897986119d49d5bfL366) and [here](https://github.com/odoo/odoo/pull/197569/files#diff-0c985bf4d5fc0f1d25c9014209f090dd09727488ec15ca71897986119d49d5bfL706-R640) - issue only in 18.0 opw-4677724 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Printing a delivery for a kit product no longer fails when the selected packaging uses different units than its components. This prevents an error during sales and delivery processing, helping users complete quotations and delivery documents smoothly.
Original PR description
…ating **Steps to reproduce:** - Inside Settings/Sales activate the "Product Packagings" setting - Create a new product (the final product) - Inside the inventory tab add a packaging line for a pack…
…ating **Steps to reproduce:** - Inside Settings/Sales activate the "Product Packagings" setting - Create a new product (the final product) - Inside the inventory tab add a packaging line for a pack of 9 units - Create a new product (the comp product) - In the general information tab, set a unit of mesure of g - In the inventory tab add a packaging line for a pack of 0.9 g - Set an on hand quantity for the comp product - Create a new BOM for the final product - Add a a line with the comp product for a quantity of 0.1 g - Select kit - Create a new quotation and select your kit product - Select your packaging > Confirm - Click on the delivery smart button - print without validating **Current behavior:** traceback with error message : "The unit of measure g defined on the order line doesn't belong to the same category as the unit of measure Units defined on the product." **Cause of the issue:** https://github.com/odoo/odoo/blob/57282becdeab5cdd7f581e149dede683fc352abe/addons/stock/models/stock_move_line.py#L136 line.move_id.product_packaging_id is the packaging of the final product whose uom is unit. ine.product_uom_id is grams so _compute_quantity will fail **fix** the fix is a backport of https://github.com/odoo/odoo/pull/201580 with an adaptation of the filtering so that the lines where the packaging was changed on the line to a packaging of the component are sent to super (it otherwise results in a wrong quantity computation) related to opw-4781180 Forward-Port-Of: odoo/odoo#214814
Tax reports now show the correct net amount when invoice lines use the same tax but different analytic distributions. This prevents overstated taxable bases in grouped tax reports, improving accuracy for accounting and reporting.
Original PR description
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales…
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales (eg 10%) - Make sure the option "Analytic Accounting" is ticked in the settings - Create an invoice with two lines (eg both at $100), add the tax on both - Change the analytic distribution on both lines to different values - Confirm the invoice - Go to the tax report - Select the report "Group By: Account > Tax" - On the report the "Net" amount is doubled ($400), the tax amount is correct ($20) ### Cause: On the invoice we can see in "Journal Items" that two tax lines are created instead of one (one for each analytic distribution). The "Group By" reports are generated by [this query](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L92). At the [creation of the second subtable](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L164-L198) the move lines are linked together based among other things on the tax id. The [filter on analytic distribution](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L187-L191) does not apply here as `tax.analytic = False`. The result is that each tax line is linked with both base lines. The second subtable have 4 lines in this case, with each base line doubled. The result of the query have the base amount doubled. ### Solution: We cannot fix the query as there is no link to find the tax line origin among the base lines. The method `_read_generic_tax_report_amounts` in `account_reports` is made to fix the base values in report in case of duplicate. Until now, it did not include the duplication caused by analytic distribution but duplication because of repartition lines for example. The fix is to use this method also for analytic distribution. So we add `tdr.analytic_distribution` in the `GROUP BY`. This value must be returned by the query in `account` so we add it. opw-4753676 Forward-Port-Of: odoo/odoo#213751
Fixed an issue where sending invoices to customers with different languages in the same batch could show the email action button in the wrong language. Each invoice email now uses the correct customer language, improving clarity for international customers.
Original PR description
**Issue**: When multiple invoices with different customer languages are sent and printed together, the invoice email button may appear with an incorrect translation for some of them. **Steps to…
**Issue**: When multiple invoices with different customer languages are sent and printed together, the invoice email button may appear with an incorrect translation for some of them. **Steps to reproduce**: - Open the Accounting app - Go to Customers > invoices - Create a new invoice with a customer with its language set to German - Create a new invoice with a customer with its language set to English - Go back to Customers > invoices - Select the two invoices just created and click on action > Sent & Print and then click on the Sent & Print button - Go to Settings > Technical > Email > Emails and check the two last emails. One of them should have the invoice email button wrongly translated **Cause**: Before sending an email, it retrieve the `type_name` using the lang of the customer https://github.com/odoo/odoo/blob/28c3b9cf10488536dce5a4927fdbe8fcd6e5a839/addons/account/wizard/account_move_send.py#L596C1-L605C14 This will trigger that compute method https://github.com/odoo/odoo/blob/a6368e8a5787f3067d09d79516a2924b3f1207f0/addons/account/models/account_move.py#L841C1-L850C67 which set the `type_name` of all the records. Since the compute method only depends on move_type, it does not recompute type_name per record. As a result, all records may share the same type_name, regardless of language context. Please notice that `type_name` is used to display the invoice email button in the right language. **Solution**: Make the compute method `_compute_type_name` depending to the lang parameter, thus it will use the right `type_name` for each email to send. opw-4748741 Forward-Port-Of: odoo/odoo#216811
This fixes confusing display issues when users select property fields or group records by a property. Separators are no longer shown where they should be hidden, and grouped list views keep column names clear instead of adding the parent name.
Original PR description
Bug 1 ===== When inserting properties in a domain, or in the server action form view, the property separator should not be visible. Don't show separator in group by. Bug 2 ===== Name change in list view after grouping by a property 1. Add a property in the list view 2. Group by a property => The name of the parent is added in the column. Task-4896271
Fixes an accounting issue where imported invoice, payment, and exchange difference entries in a foreign currency could fail to reconcile completely. This helps keep journal items balanced after currency rate changes and reduces manual correction work for accounting teams.
Original PR description
# How to reproduce the issue - Create an invoice with price 1000 in a non-company currency (e.g., CHF). - Modify the currency rate after the invoice date, then generate the payment for this invoice.…
# How to reproduce the issue - Create an invoice with price 1000 in a non-company currency (e.g., CHF). - Modify the currency rate after the invoice date, then generate the payment for this invoice. - This will generate three journal entries (invoice, payment, and currency exchange difference). - Export those journal entries and include in the export the `matching_number`, `currency`, and `amount_currency` fields. - Import those three entries with the matching number and post them. - In the Journal Items, the line corresponding to the currency exchange difference is not matched with the lines from the invoice and the payment, leading to an unbalanced credit and debit. # Cause In `_prepare_reconciliation_single_partial` within `account_move_line`, the reconciliation is stopped by checking whether the debit/credit is fully matched. However, this check only considers `amount_residual_currency` and not `amount_residual`, which, in the case of an exchange difference, are different. opw-4776188 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#216097
Accounting menus for analytic accounting are now hidden when the feature is turned off in company settings. This avoids showing users options that are not available for their company configuration.
Original PR description
Purpose ------- This fixes a visibility issue in the Accounting menus: analytic menus were still displayed even when analytic accounting was not enabled in the company settings. Changes ------- - Applied correct group to hide the menus when analytic accounting is disabled. - Ensured consistency across all related menu entries. How to test ----------- 1. Go to Settings > Companies > Your Company. 2. Disable the "Analytic Accounting" checkbox (under Accounting features). 3. Go to the Accounting app. 4. The "Analytic Accounts" and related submenus should now be hidden.
Fixed an issue that could block manufacturing users from generating serial or lot numbers for tracked components. The system now uses the stock move’s demand quantity when needed, ensuring lot generation continues reliably during shop floor operations.
Original PR description
**Steps to Reproduce :** 1. Install MRP. 2. Create a Bill of Materials (BOM) and add a component with lot tracking. 3. Create and confirm a Manufacturing Order (MO) with BOM. 4. Navigate to the shop…
**Steps to Reproduce :** 1. Install MRP. 2. Create a Bill of Materials (BOM) and add a component with lot tracking. 3. Create and confirm a Manufacturing Order (MO) with BOM. 4. Navigate to the shop floor and click on Generate Serials/Lots. 5. The error appears when trying to generate the lot . **Issue :** Error raised when try to Generate Serials/Lots during the manufacturing process. `TypeError: unsupported operand type(s) for //: 'NoneType' and 'int'` **Cause:** This error occurs because the quantity field is undefined when Generate Serials/Lots is triggered, the quantity field is not being passed in the context, and its value is undefined, which is leading to a division by [none](https://github.com/odoo/odoo/blob/18.0/addons/stock/models/stock_move.py#L993). **Solution:** To fix this, we added the stock move’s demand quantity as a fallback.This ensures the quantity field value is present and its value correctly passed during lot generation. opw-4763600 Enterprise: https://github.com/odoo/enterprise/pull/88739
The point of sale search has been corrected so products with names similar to variant names are not hidden by an early variant match. This helps cashiers find the intended product when searching terms like brand or model names, reducing checkout confusion.
Original PR description
If you have a product template with variant, ex: Telephone case, variant name : Iphone 15 SE, Samsung Galaxy, Nokia 1999 When doing a search with more then 2 letters you will only find the Telephone…
If you have a product template with variant, ex: Telephone case, variant name : Iphone 15 SE, Samsung Galaxy, Nokia 1999
When doing a search with more then 2 letters you will only find the Telephone case, search exemple: Iphone 15 SE, Galaxy, Samsung.
** Step to reproduce **
- Create a product with variant samsung galaxy S24 ultra
- Create a product called Samsung galaxy
- Enable them for point of sale (don't forget to select a category that will appear on your shop)
- Do a search for the product Samsung galaxy
- Only Telephone case will appear.
** Cause of the issue **
Doing a search will call getProductsBySearchWord:
https://github.com/odoo/odoo/blob/5a1fff2cc61bd8676049879039defa3fb2a3f13d/addons/point_of_sale/static/src/app/services/pos_store.js#L2401-L2407
During the product.exactMatch(words) we will get a hit since we will have a name of the product variant:
https://github.com/odoo/odoo/blob/5a1fff2cc61bd8676049879039defa3fb2a3f13d/addons/point_of_sale/static/src/app/models/product_template.js#L265-L278
And the call for the function will finish there since the searchword lenght > 2 and we have a hit.
opw-4864976The website editor now handles duplicate page view records safely instead of crashing when opening a page. This helps administrators and editors keep working even if a website view was accidentally duplicated with the same identifier.
Original PR description
When multiple `ir.ui.view` records exist with the same key (e.g., due to duplication), it can lead to a singleton error. **Steps to reproduce:** 1. Install the website module 2. Go to `Settings >…
When multiple `ir.ui.view` records exist with the same key (e.g., due to duplication), it can lead to a singleton error. **Steps to reproduce:** 1. Install the website module 2. Go to `Settings > Technical > User Interface > Views`. 3. Find and duplicate the **Home** view for **My Website** (same key). 4. Open the website home page in Editor mode. **Error:** `ValueError - Expected singleton: ir.ui.view(2776, 2774)` **Cause:** In `viewref()`, it uses `filter_duplicate()` to filter for the most suitable view, but it may return multiple views if more than one match the criteria. - [1] **Ref:** At [2], system uses `limit=1` in `_view_obj()` to ensure only one view is returned, even if duplicates exist for the same key. [1]: https://github.com/odoo/odoo/blob/edfa37271a0015a0d4acb17e6985a87e707e5f33/addons/website/models/website.py#L1228-L1230 [2]: https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/web_editor/models/ir_ui_view.py#L326 **Fix:** This commit ensures that the result is a record set with at most one view and preventing singleton-related errors. sentry-6223988092 Forward-Port-Of: odoo/odoo#213113
This fixes a minor typo in the Malaysia e-invoicing extension that helps distinguish credit notes from refunds in the code. The existing behavior was already working, but the cleanup reduces confusion and helps prevent future maintenance mistakes.
Original PR description
Fixes a small typo in the code which makes the distinction between credit note and refunds. Note that the code still works with the typo; which explains why the tests were green. But it's a weird line so better clean it up. In 18.1+ it's being fixed during the forward port of the commit that introduced the typo --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The live chat widget page has been adjusted so it fits properly on mobile screens. This helps visitors use chat without text overflowing or the page appearing incorrectly on smaller devices.
Original PR description
**Before this PR:** the livechat widget page was not responsive on mobile devices. This PR fixes the issue by adding the missing meta tag and adjusting font sizing and word wrapping to prevent content overflow on small screens. task-3499603 Forward-Port-Of: odoo/odoo#217127
Scanning a package in the Barcode app now correctly converts quantities when the package and transfer line use different units of measure. This prevents confusing or incorrect picked quantities, such as showing 10 grams instead of 10,000 grams for a 10 kg package.
Original PR description
**Problem:** when scanning a package with a different uom than the barcode line, the conversion is not made **Steps to reproduce:** - enable the "packages" settings - create a new storable product…
**Problem:** when scanning a package with a different uom than the barcode line, the conversion is not made **Steps to reproduce:** - enable the "packages" settings - create a new storable product and set uom of kg - click on the on hand smart button - add a new line - in the package column create a new package - set a quantity of 10 kg - create a new internal transfer and select your product - set a demand on 10000 and the uom of g - mark as todo - open the barcode app - inside internal operations click on your move - scan the name of the pack **Current behavior:** the quantity on the line is now 10/10000g **Expected behavior:** it should be 10000/10000g **Cause of the issue:** https://github.com/odoo/enterprise/blob/4c9fa9dc010958710d848fbcb3241b17ea7205ca/stock_barcode/static/src/models/barcode_picking_model.js#L1500-L1505 remaining_qty is expressed in the uom of the quant so it will be 10 but qty_needed is expressed in the uom of the line is it will be 10000. qty_used beeing the minimum of those two it will be 10. **fix** for the comparison to work we need to convert qty_needed before compairing. Also we need to make sure that the line is updated with the quantity converted in its own uom. Adding the uom to fieldsParam enables _udpdateLineQty to do the conversion https://github.com/odoo/enterprise/blob/4c9fa9dc010958710d848fbcb3241b17ea7205ca/stock_barcode/static/src/models/barcode_picking_model.js#L1669 opw-4860064 Forward-Port-Of: odoo/enterprise#87642
This fix prevents an error when opening Studio from the Documents list after creating a shortcut to a file. Users can now continue customizing Documents with Studio without being interrupted by a crash in this workflow.
Original PR description
Steps: - Install `documents` and `studio` - Open documents, go to list view - Select a random file and 'Create a shortcut' via the actions - Try to open studio - traceback opw-4900667
Tax reports now show the correct net amount when invoices have multiple lines using the same tax but different analytic distributions. This prevents overstated taxable bases while keeping the tax amount accurate, improving reliability of financial reporting.
Original PR description
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales…
### Issue: When having two lines on an invoice with the same tax and different analytic distribution, the base value is doubled on the tax report. ### Steps to reproduce: - Create a new tax on sales (eg 10%) - Make sure the option "Analytic Accounting" is ticked in the settings - Create an invoice with two lines (eg both at $100), add the tax on both - Change the analytic distribution on both lines to different values - Confirm the invoice - Go to the tax report - Select the report "Group By: Account > Tax" - On the report the "Net" amount is doubled ($400), the tax amount is correct ($20) ### Cause: On the invoice we can see in "Journal Items" that two tax lines are created instead of one (one for each analytic distribution). The "Group By" reports are generated by [this query](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L92). At the [creation of the second subtable](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L164-L198) the move lines are linked together based among other things on the tax id. The [filter on analytic distribution](https://github.com/odoo/odoo/blob/51fcbd211d2b1abf4b93becedbcbb9e03002cdd6/addons/account/models/account_move_line_tax_details.py#L187-L191) does not apply here as `tax.analytic = False`. The result is that each tax line is linked with both base lines. The second subtable have 4 lines in this case, with each base line doubled. The result of the query have the base amount doubled. ### Solution: We cannot fix the query as there is no link to find the tax line origin amongst the base lines. The method `_read_generic_tax_report_amounts` in `account_reports` is made to fix the base values in report in case of duplicate. Until now it did not include the duplication caused by analytic distribution but duplication because of repartition lines for example. The fix is to use this method also for analytic distribution. So we add `tdr.analytic_distribution` in the `GROUP BY`. This value must be returned by the query in `account` so we add it. opw-4753676 Forward-Port-Of: odoo/enterprise#87404
Fixed an issue that could block manufacturing users when generating serial or lot numbers from the shop floor. The process now uses the planned demand quantity when the expected quantity value is missing, preventing the error and keeping production workflows moving.
Original PR description
This [PR](https://github.com/odoo/odoo/pull/209860) adds a fallback to product_uom_qty when the quantity field is not present during serial/lot generation from the shop floor. Includes a tour and…
This [PR](https://github.com/odoo/odoo/pull/209860) adds a fallback to product_uom_qty when the quantity field is not present during serial/lot generation from the shop floor. Includes a tour and test case in mrp_workorder to validate the fix. **Steps to Reproduce :** 1. Install MRP. 2. Create a Bill of Materials (BOM) and add a component with lot tracking. 3. Create and confirm a Manufacturing Order (MO) with BOM. 4. Navigate to the shop floor and click on Generate Serials/Lots. 5. The error appears when trying to generate the lot . **Issue :** Error raised when try to Generate Serials/Lots during the manufacturing process. `TypeError: unsupported operand type(s) for //: 'NoneType' and 'int'` **Cause:** This error occurs because the quantity field is undefined when Generate Serials/Lots is triggered, the quantity field is not being passed in the context, and its value is undefined, which is leading to a division by [none](https://github.com/odoo/odoo/blob/18.0/addons/stock/models/stock_move.py#L993). **Solution:** To fix this, we added the stock move’s demand quantity as a fallback.This ensures the quantity field value is present and its value correctly passed during lot generation. opw-4763600 Community: https://github.com/odoo/odoo/pull/209860
Online bank connections are no longer incorrectly marked as payment-enabled when they should not be. The change also cleans up affected existing connections and adds checks to help prevent the issue from returning.
Original PR description
Due to an overly restrictive condition, all online account connections were being marked as payment enabled/activated, even when they shouldn't be. This commit removes the faulty condition and introduces a small test to validate the correct behavior. Additionally, a fallback mechanism has been added to clean up improperly configured connections by removing the incorrect payment_activated flag where needed. no task id
This fix makes Odoo save the invoice sending time before contacting the Mexican e-invoicing provider. If a connection issue happens during sending, retries reuse the same timestamp, reducing duplicate CFDIs with slightly different dates for Mexican customers.
Original PR description
### Background In https://github.com/odoo/enterprise/pull/85026 we changed the behaviour of `l10n_mx_edi_post_time` so that it gets set during the CFDI sending process, rather than when the invoice…
### Background In https://github.com/odoo/enterprise/pull/85026 we changed the behaviour of `l10n_mx_edi_post_time` so that it gets set during the CFDI sending process, rather than when the invoice is posted. This was needed to ensure that the post time both reflects the sending time and is re-used if the invoice needs to be re-sent. ### Bug description Since then, several Mexican customers have reported that some CFDIs are sent duplicated, with a difference of a few seconds in the CFDI's Fecha. ### Analysis A disconnection might occur during sending of the CFDI. In that case, the PAC will process the CFDI, but in Odoo the transaction will be rolled back, and the `l10n_mx_edi_post_time` will be lost. When Odoo re-sends the CFDI, it will take a new `l10n_mx_edi_post_time`. ### Solution Commit before performing the API call so that the `l10n_mx_edi_post_time` gets committed to DB. opw-4780096 Forward-Port-Of: odoo/enterprise#89263 Forward-Port-Of: odoo/enterprise#89117
Delivery barcode scanning now correctly warns users when a scanned location differs from the product's reserved location, especially for lot-tracked products. After the warning, repeating the expected scan sequence confirms the change, helping prevent accidental inventory movements while still allowing intentional corrections.
Original PR description
Issue ----- The ticket raises 2 issues products tracked by lots and stored in a specific location: 1. Scanning Location > Lot overrides the reserved location without asking the user for confirmation…
Issue
-----
The ticket raises 2 issues products tracked by lots and stored in a specific location:
1. Scanning Location > Lot overrides the reserved location without asking the user for confirmation
2. Scanning Location > Product > Lot should first produce a warning then, if repeated, override the reserved location with the scanned one
Setup & issue reproduction
-----
- Enable in settings
- Lots & Serial Numbers
- Storage Locations
- Create 2 storage locations Shelf1 & Shelf2
- Create a product Prod tracked by lots
- Create a lot Lot1 of Prod in location Shelf2
- Go to Inventory > Configuration > Operations Types > Delivery Orders
- In "Barcode App" page, set "Source Location" to "Mandatory Scan"
- Create a new delivery for Prod, set it as To-Do
- Open the delivery in barcode
To reproduce issue 1:
- Scan Shelf1
- Scan Lot1
--> No warning, the user can validate the transfer
To reproduce issue 2:
- Scan Shelf1
- Scan Prod1
- Scan Lot1
--> You get a warning & repeating the steps doesn't work as the warning suggests
Problem analysis
-----
#### TLDR
**The current behaviour is flawed. The warning is for when there is a reserved quantity so the check should happen in `updateLine` and not `createNewLine`. Also, there is a confusion with `needSourceConfirmation` serving for both the need for a warning and indicating the user has been warned. These should be 2 separate flags.**
List of tested flows (with fix) can be found [here](https://github.com/odoo/enterprise/pull/87740#issuecomment-3004459646).
#### Warning popup
The warning popup happens thanks to the check for matching of locations which happens in `createNewLine`
https://github.com/odoo/enterprise/blob/5d10fb2c734d1379c1415f683f3c5ab0620d425b/stock_barcode/static/src/models/barcode_picking_model.js#L51-L57
but not in `updateLine`. This is incorrect as the warning is meant to protect changing the location of an *existing* line. Since it has no reason to be in `createNewLine`, we can move it from there to `updateLine`.
#### Setting the warning flag
When scanning a product after a wrong location, the flag value can be changed in 2 parts of the code...
1. In `_findLine`, where we iterate over the existing lines and, for each, check whether it can be taken from the current location (using `lineCanBeTakenFromTheCurrentLocation`)
https://github.com/odoo/enterprise/blob/cf13e6b102ad33ace724b5ffd28d508158db2d15/stock_barcode/static/src/models/barcode_model.js#L1351
2. In `createNewLine` (`updateLine` after fix) where we check if we need to warn the user before setting the flag to false
https://github.com/odoo/enterprise/blob/cf13e6b102ad33ace724b5ffd28d508158db2d15/stock_barcode/static/src/models/barcode_picking_model.js#L49
#### lineCanBeTakenFromTheCurrentLocation problems
https://github.com/odoo/enterprise/blob/cf13e6b102ad33ace724b5ffd28d508158db2d15/stock_barcode/static/src/models/barcode_picking_model.js#L188-L191
The condition only works for one "acceptable" use flow. Updating the condition wouldn't make much sense, because there is no way to make en exhaustive list of "acceptable" use flows (e.g. adding X unrecognised scans between the location and product scan). The domain of "acceptable" use flows is too large for a simple condition.
We set the flag to true only for "acceptable" use flows. This is the opposite of what we want. We don't want to warn the user when they scan again using an "acceptable" flow.
We `return false` although there is a line we want to take from. This tells `_findLine` that no line can be taken, leading `processBarcode` to create a new line instead.
https://github.com/odoo/enterprise/blob/cf13e6b102ad33ace724b5ffd28d508158db2d15/stock_barcode/static/src/models/barcode_picking_model.js#L192-L193
Setting the flag to false here doesn't make sense, since only non "acceptable" flows lead to here.
We can simplify the behaviour here to simply set the flag to true and not do anything else in this block. This is possible thanks to
https://github.com/odoo/enterprise/blob/cf13e6b102ad33ace724b5ffd28d508158db2d15/stock_barcode/static/src/models/barcode_picking_model.js#L183-L184
which ensures that we are in the case of a mismatch of locations with an existing line. We don't return in here because a line was found so the closing return of the function suffices.
The reason why we want to return true here even when there is a mismatch is because we want the code to try to edit the line. It is up to `updateLine` to ensure no line needing confirmation will be edited. This change means we will have to make adaptations to other parts of the code that were written with the previous behaviour in mind.
#### Updating the condition in `updateLine`
After applying the above change, we have a problem with the condition in `updateLine`. If we set the flag to false when warning the user, we get the following behaviour when scanning the product:
- `lineCanBeTakenFromTheCurrentLocation` sets the flag to true then
- `updateLine` sees that the flag is true, it will warn the user and set the flag back to false.
We have to change how `updateLine` checks if it has to warn the user to avoid this logical loop. We want to warn the user using some combination of the following conditions
1. the location of the line we are trying to update doesn't match with the scanned location (`needSourceConfirmation` is true)
2. the user has been warned (we use a new `askedSourceConfirmation` flag with the same structure as `needSourceConfirmation`)
3. the scanning sequence is an "acceptable" confirmation one (the new `isConfirmationSequence` function)
Using these, we can define 2 scenarios which require a user warning:
A. The locations don't match and the user hasn't been warned yet => 1 AND (NOT 2)
OR
B. The locations don't match, the user has been warned but the scanning sequence isn't "acceptable" => 1 AND 2 AND (NOT 3)
If we are in either scenario, we warn the user and set 2 to true. If both A and B are false, we can update the line and reset both 1 and 2 to false.
#### Example of a simple flow with flag values
- Initial values
> 1 = false, 2 = false, 3 = false
> A = 1 AND (NOT 2) = false, B = 1 AND 2 AND (NOT 3) = false
- Scan wrong location
- Scan product => 1 is set to true
> 1 = true, 2 = false, 3 = true
> A = 1 AND (NOT 2) = true, B = 1 AND 2 AND (NOT 3) = false
- The user gets a warning because A is true => 2 is set to true
>1 = true, 2 = true, 3 = true
> A = 1 AND (NOT 2) = false, B = 1 AND 2 AND (NOT 3) = false
- Scan wrong location
- Scan product => 1 is set to true
> 1 = true, 2 = true, 3 = true
> A = 1 AND (NOT 2) = false, B = 1 AND 2 AND (NOT 3) = false
- The line is succesfully updated because both A and B are false
#### Arbitrary limitation of condition 3 in implementation
We arbitrarily decide to only accept 3 flows for location confirmation.
>this.scanHistIsProd(0) && this.scanHistIsLoc(1) && !line.lot_id ||
>this.scanHistIsLot(0) && this.scanHistIsLoc(1) ||
>this.scanHistIsLot(0) && this.scanHistIsProd(1) && this.scanHistIsLoc(2)
This is to avoid possibly costly computations. Imagine the user gets the warning message. They scan the location again. Then, instead of scanning the product, they scan an unrecognised barcode. After this, they scan the product. Adding this specific case would be easy. But what if the unrecognised scan happens multiple times? Or they scan many products in the meantime? We would have to go through the whole scanning history to see if we can find the "Wrong Location > Product" scanning sequence twice (a first time raising the warning, the second confirming). And what if the first time didn't raise the warning but simply confirmed an existing line?
The domain of possible use cases is hard to formally define. Instead, we can make the reasonable assumption that when prompted the warning, the user will simply rescan "Wrong Location > Product".
-----
Ticket:
opw-4731237Miscellaneous changes
This commit fixes this [runbot error](https://runbot.odoo.com/odoo/runbot.build.error/75847) which is triggered by a toolbar method called at an incorrect time in some instances. Sometimes the method could be called after the form view was exited. Which means that the iframe used by the mailing editor could trigger the method even though it is no longer in the DOM. This leads to a call to getSelection on a document that could no longer be displayed/present in the DOM. To fix this issue, whe
Original PR description
This commit fixes this [runbot error](https://runbot.odoo.com/odoo/runbot.build.error/75847) which is triggered by a toolbar method called at an incorrect time in some instances. Sometimes the method could be called after the form view was exited. Which means that the iframe used by the mailing editor could trigger the method even though it is no longer in the DOM. This leads to a call to getSelection on a document that could no longer be displayed/present in the DOM. To fix this issue, when the selection returned by the document is null (this.document no longer on the DOM), the method returns directly. task-4829204 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#212056
### Issue: Certain shopfloor tests make assert on the number of records present in the shopfloor: - test_shop_floor_my_wo_filter_with_pin_user - test_automatic_backorder_no_redirect These assert can not be reliable due to demo-data's adding unrelated records e.g. https://github.com/odoo/enterprise/blob/5bfadae317ee47ac34703d4cc222677ac677cc7d/purchase_mrp_workorder_quality/data/purchase_mrp_workorder_quality_demo.xml#L79-L84 runbot-build-error-226734 Forward-Port-Of: odoo/enterprise
Original PR description
### Issue: Certain shopfloor tests make assert on the number of records present in the shopfloor: - test_shop_floor_my_wo_filter_with_pin_user - test_automatic_backorder_no_redirect These assert can not be reliable due to demo-data's adding unrelated records e.g. https://github.com/odoo/enterprise/blob/5bfadae317ee47ac34703d4cc222677ac677cc7d/purchase_mrp_workorder_quality/data/purchase_mrp_workorder_quality_demo.xml#L79-L84 runbot-build-error-226734 Forward-Port-Of: odoo/enterprise#88005
This PR introduces new product-level codes for l10n_pe, in accordance with the latest updates from SUNAT: ### Withholding codes (detracciones): - Code `044`: Servicio de beneficio de minerales metálicos gravado con el IGV - Code `045`: Minerales de oro y sus concentrados gravados con el IGV These were added to the `l10n_pe_edi` module. ### Tariff fractions: 39 new values were added based on the SUNAT's updated list of tariff fractions for delivery guides. These were added to t
Original PR description
This PR introduces new product-level codes for l10n_pe, in accordance with the latest updates from SUNAT: ### Withholding codes (detracciones): - Code `044`: Servicio de beneficio de minerales metálicos gravado con el IGV - Code `045`: Minerales de oro y sus concentrados gravados con el IGV These were added to the `l10n_pe_edi` module. ### Tariff fractions: 39 new values were added based on the SUNAT's updated list of tariff fractions for delivery guides. These were added to the `l10n_pe_edi_stock` module. **Source:** https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20250421.xlsx Forward-Port-Of: odoo/enterprise#87138