Thursday, March 26, 2026
22 changes · saas-19.1
Enhancements to existing features
This update allows Peruvian Point of Sale (POS) systems to directly print electronic invoices and receipts on thermal printers, aligning with local regulations and business practices. Previously, customers had to download invoices from a portal. This change improves the customer experience by eliminating the need for a separate download.
Original PR description
Before: - In Peru, Point of Sale (POS) systems are allowed to generate E-invoices and E-receipts that comply with SUNAT’s requirements. - In the POS, Odoo prints a ticket that only includes a QR code linking to the customer portal, where the A4 invoice can be downloaded. - However, according to SUNAT and common practice in Peruvian retail environments, the printed POS ticket itself should serve as the legal representation of the electronic document After: - We allow Peruvian POS users to print electronic invoices and receipts directly on thermal printers (58 mm / 80 mm) using the same electronic document flow and data as the accounting module, ensuring full compliance with SUNAT’s representation requirements. Impact: - Improve customer experience by avoiding portal-only invoice download task-5193544 Forward-Port-Of: odoo/enterprise#101876
Resolved issues and error corrections
This update resolves an issue where a field was incorrectly representing the date the W4 form is filed with the employer, rather than the date it's completed. This correction ensures accurate payroll processing for US businesses using the l10n_us_hr_payroll module, aligning with tax regulations.
Original PR description
This field is about when the W4 is filed with the employer, not when it's filled in. opw-5096780 Forward-Port-Of: odoo/enterprise#111679 Forward-Port-Of: odoo/enterprise#111213
This update fixes an issue where expense refusal messages in the system were displayed in the employee's language instead of the user's. It now correctly uses the user's language for these messages, ensuring a better user experience. Additionally, the system now skips OCR processing for expenses created from Stripe payments, preventing data overwrites.
Original PR description
Problem: For expense created from stripe payment, OCR overwrites the data fetched from stripe. Solution: Skip OCR for expense created from stripe payment and put a log note explaining the same. ***…
Problem: For expense created from stripe payment, OCR overwrites the data fetched from stripe. Solution: Skip OCR for expense created from stripe payment and put a log note explaining the same. *** Purpose: One language may have been set on employee, but that employee may be using any other language in his environment, in that case user should see chatter messages in language from his environment. Before this commit: expense refusal message in chatter used employee's language. After this commit: expense refusal message in chatter uses language of user related to employee. *** Problem: Expense Digitalization (OCR) setting is not properly applied. Steps to reproduce:- - Create a new database with demo data and install `hr_expense_extract`. - Switch to `My US Company` and create an employee for that company. - In expense settings set Expense Digitalization (OCR) to Digitize on demand only. - Create an expense for above created employee and attach receipt. - Expense is digitized automatically. Cause: Here https://github.com/odoo/enterprise/blob/d8acbf22fec266ff7d5dcc9499543e6bea3c1325/hr_expense_extract/models/hr_expense.py#L43 `self.env.company` gives that user's default company instead of currently active company in company selector. Solution: Use `company_id` set on expense to determine Expense Digitalization setting. *** task-5712223 Forward-Port-Of: odoo/enterprise#106261
This update fixes a reporting issue where the KMD INF report incorrectly included partners with turnover below 1,000 EUR. Now, the report accurately filters partners based on a combined total of invoices and credit notes, ensuring more precise financial reporting. The changes improve data integrity and reporting reliability.
Original PR description
The KMD INF report should only include partners whose total turnover for the period reaches 1,000 EUR. Before this PR: - The report did not check this threshold, so partners below €1,000 were still shown. After this PR: - The threshold is now calculated correctly based on specific rules: - The threshold is calculated separately for invoices and credit notes per partner. - If invoices total base amount >= €1,000 OR credit notes total base amount >= €1,000, both invoices and credit notes are included in the report - The same logic applies to bills and refunds in Part B. task-5373606 Forward-Port-Of: odoo/enterprise#111737 Forward-Port-Of: odoo/enterprise#101333
This update corrects a problem where ISO20022 files generated for Swiss bank accounts were being incorrectly formatted, leading to rejection by the bank. The fix ensures the correct 'PAIN 09' version is used, resolving compatibility issues after database migrations. This prevents delays in payment processing.
Original PR description
To reproduce the issue:
- Create a database in 17.0, with a Swiss company, and install account_sepa. Make sure the bank journal uses the Swiss IS020022 PAIN version.
- Migrate this database to 18.0
- Generate an ISO20022 xml file for the Swiss company
==> The file is wrongly formatted, and will be rejected by the bank.
This happens because the sepa_pain_version field of the journal is still set to its old selection value ('pain.001.001.03.ch.02') after migration, which is not supported anymore. The ORM hence returns an empty value when accessing the selection field, and does not enter the proper conditions when generating the file.
An upgrade fix has been made here https://github.com/odoo/upgrade/pull/9771. This commit makes sure already-migrated databases dynamically fix the issue as well.
opw-6060612
Forward-Port-Of: odoo/enterprise#111949This update ensures that all attendees of an appointment, including internal users, receive booking notifications regardless of whether the event syncs with Google or Outlook. Previously, notifications were limited, causing organizers and followers to miss important updates. This change improves communication and ensures everyone is informed about appointment details.
Original PR description
In [1] we prevented cancelation emails from being sent when the booking was synced via google or outlook calendar. However this means even followers who would not be notified by the mail provider (not assisting to the meeting) would not be notified. As well as the organizer who is doing to booking/cancelling from the perspective of the mail provider, as the meeting is created from their account. Instead we should keep sending the "appointment booked" template in all cases as it is only followed by internal users to whom it is always relevant. As for cancelation templates, it should stil be sent to internal users. Partners of the meeting however need not be notified and may be unsubscribed if syncing is enabled, as cancellation typically only happens once. task-5152917 [1]: https://github.com/odoo/enterprise/pull/60913 Forward-Port-Of: odoo/enterprise#111856 Forward-Port-Of: odoo/enterprise#96638
This update fixes a problem preventing users from successfully connecting to their databases. Previously, connection attempts were blocked due to access rights issues. Now, users are correctly redirected to the database website for login or connection.
Original PR description
The aim of this commit is to allow a db_user to be able to connect to a database in which he should be able to connect. Before this commit: Clicking on connect would stumble upon access rights issues on system.parameter and on `database_api_key_to_use`. After this commit: User are correctly redirected on the db website, either already connected or on the login page. task-id: 6046086 Forward-Port-Of: odoo/enterprise#111965
This update resolves an issue in Odoo's Web Studio where invisible fields would lose their visibility settings when toggling the 'Show Invisible Elements' option. The fix ensures that the intended invisible state is consistently maintained, preventing unexpected field visibility changes. This improves the user experience and accuracy of customizations within Web Studio.
Original PR description
Steps to reproduce ================== - Install contacts,web_studio - Login as admin - Go to contacts - Open any record - Open studio - Click on any field - Add the "Role / Portal" group - Toggle the…
Steps to reproduce ================== - Install contacts,web_studio - Login as admin - Go to contacts - Open any record - Open studio - Click on any field - Add the "Role / Portal" group - Toggle the "Show invisible Elements" checkbox - Click on the same field => The field is marked as invisible - Add an invisible condition => The invisible condition is lost (but still applied on the view) Cause of the issue ================== In studio, when fetching the view, the invisible attribute is set to True when the user does not have access to the field (when he is not part of the groups). The goal is to make the field invisible in studio unless the "Show invisible Elements" is toggled. But this causes the actual value of the invisible attribute to be lost. Note that this also applies to the column_invisible attribute. Solution ======== If an invisible/column_invisible attribute is present on the nodes with missing access, we copy the actual value to the `actual_invisible` attribute. We then use that value in the editor, when present. opw-6026971 Forward-Port-Of: odoo/enterprise#111868 Forward-Port-Of: odoo/enterprise#111299
This update fixes an issue where the 'Buy to Resupply' option was automatically re-enabled after being manually disabled. The change ensures that this option remains disabled unless specifically configured, improving order management and reducing potential overstocking. This resolves a previous bug impacting warehouse efficiency.
Original PR description
Steps to produce: --- - Install `purchase_stock` module. - Inventory > Configuration > Settings > Warehouse > enable `Multi-Step Routes`. - Go to Configuration > Warehouse Management > Warehouses. -…
Steps to produce: --- - Install `purchase_stock` module. - Inventory > Configuration > Settings > Warehouse > enable `Multi-Step Routes`. - Go to Configuration > Warehouse Management > Warehouses. - Open `YourCompany` record. - Click on Routes > open `Buy` > enable `Products`. - Return to `YourCompany` and disable `Buy to Resupply`. Issue: --- - After disabling `Buy to Resupply`, the option is automatically re-enabled. Root cause: --- - In [1], `buy_to_resupply` is set to true if either buy route is product selectable OR the current warehouse is included in buy route warehouses. - In the `_inverse_buy_to_resupply` method, unchecking the flag only unlinks the warehouse from the route. However, if `product_selectable` is still enabled, the compute logic will continue to set the field back to true. Solution: --- - `warehouse.buy_to_resupply` is now set to True only when the warehouse ID is present in the buy route’s warehouse_ids. [1] https://github.com/odoo/odoo/blob/aeaace7c70b7ac3db68f188c9c517f1ff849e55d/addons/purchase_stock/models/stock.py#L57 opw-5476302 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#250360
This update fixes a bug that prevented the Google address autocomplete feature from working correctly when certain modules modified address fields. The change adds a new widget to street fields and handles address autocomplete in e-commerce, ensuring accurate and reliable address input for users. It also updates access rights for city data.
Original PR description
_= base,base_address_extended,google_address_autocomplete,website_sale_autocomplete The Google autocomplete feature was breaking when modules such as base_extended_address modified the address form (e.g., replacing street with street_name, street_number, etc.). In this commit: --- - Add the Google autocomplete widget to street-related fields. - Also same thing handled in frontened (e-commerce address autocomplete). - and update 'city_id' from available cities records if matches with google result. - ```update access_rights for RecCity Model - grant read access to public user``` --- task-5382984 opw-5362597 Forward-Port-Of: odoo/odoo#255728 Forward-Port-Of: odoo/odoo#238672
This update resolves an issue where Field Service Reports generated for multiple tasks sometimes produced duplicate PDF files. The fix ensures that reports are generated correctly, avoiding the creation of redundant documents. This improves the reliability of report generation for users.
Original PR description
### Issue: When we try to print the field service report on multiple tasks, some with worksheets, then everything is duplicated in the PDF. ### Steps to reproduce: - Install `industry_fsm` and `sale`…
### Issue: When we try to print the field service report on multiple tasks, some with worksheets, then everything is duplicated in the PDF. ### Steps to reproduce: - Install `industry_fsm` and `sale` - Create two tasks with the same customer - Add timesheet, products and save a worksheet on one of them (the goal is to have titles on two different pages) - In list view select both tasks and click Report > Field Service Report - The downloaded PDF has the report twice ### Cause: When printing for several records then `_render_qweb_pdf_prepare_streams()` tries to split the document. If the document has more pages than the number of records [we fetch the "Outlines"](https://github.com/odoo/odoo/blob/55a58571fbfa6a6bb0edacd6f9676382cc23630b/odoo/addons/base/models/ir_actions_report.py#L938-L954). These are the biggest sections in the document. In our case these sections are the `<h2>` tags, as there are no `<h1>`: [the main title](https://github.com/odoo/enterprise/blob/6c4b88a1dfe245a63a424e3f51ff803e51ccde61/industry_fsm/report/worksheet_custom_report_templates.xml#L31-L33), [the Timesheet section title](https://github.com/odoo/enterprise/blob/6c4b88a1dfe245a63a424e3f51ff803e51ccde61/industry_fsm/report/worksheet_custom_report_templates.xml#L39), etc. Then we check the pages where these titles are displayed; if we get the same number of pages as the number of records, we use them to split the report. If not, then we [render the report for each record individually](https://github.com/odoo/odoo/blob/55a58571fbfa6a6bb0edacd6f9676382cc23630b/odoo/addons/base/models/ir_actions_report.py#L974-L976), add them to `collected_streams`. Then add the initial report generated on the recordset and return. These streams are later merged into one, which explains the duplication: - Task 1 report individually generated - Task 2 report individually generated - Report of the recordset containing the two first reports ### Solution: The issue was introduced by [this commit](https://github.com/odoo/odoo/commit/7fc1ebd4466a2d9b4a48dfe86332b5844026c4fc) which implements the individual generation without returning. So the individual documents will always be followed by the recordset document. This commit adds the return directly after the individual reports generation. opw-6032935 Forward-Port-Of: odoo/odoo#255581
This update fixes an issue where the expiration date on stock moves wasn't correctly updated when switching between lots. Now, the system accurately reflects the expiration date based on the lot being used, ensuring accurate inventory tracking and preventing potential stock discrepancies. This improves the reliability of our expiration date management feature.
Original PR description
Steps to reproduce: - Enable "Expiration Dates" in Inventory settings - Create a storable product "P1" - Add 10 units with "Lot 1" - Enable expiration dates on product P1 - Add 10 units with "Lot 2"…
Steps to reproduce: - Enable "Expiration Dates" in Inventory settings - Create a storable product "P1" - Add 10 units with "Lot 1" - Enable expiration dates on product P1 - Add 10 units with "Lot 2" and set an expiration date - Create a delivery for 10 units of P1 - Mark as "To Do" - Open the move line -> "Lot 1" is automatically reserved - Change the lot from "Lot 1" to "Lot 2" -> The expiration date is not updated automatically - Save and reopen the move line -> The expiration date is correctly set - Change again to "Lot 1" - Save and reopen the move line -> The expiration date is not reset and incorrectly keeps the value from "Lot 2" Cause: The expiration date was only computed based on `lot_id`, ignoring the `quant_id` used during reservation. Additionally, the value was not reset when switching to a lot without an expiration date. Solution: - Add `quant_id` to the compute dependencies - Compute the expiration date based on `quant_id.lot_id` - Explicitly set an expiration date to today when the use_expiration_date product is set to True and the lot doesn't have an expiration date. Result: The expiration date is now correctly updated and cleared when changing lots on stock move lines. opw-5999294 Forward-Port-Of: odoo/odoo#254610
This update fixes an issue where stock valuations were incorrectly calculated for products without assigned product values. The change ensures all products are considered during valuation replays, resulting in accurate inventory accounting. This improves the reliability of financial reporting.
Original PR description
Usecase to reproduce: - Create two average product A and B - Delele all the product.value for B - Receipt both units at 10$ - Set the price unit of A to 20$ - Receipt both units at 20$ Check the value at date to trigger a replay of valuation Expected behavior: - Product A -> 20 units at 20$ -> 400$ - Product B -> 20 units at 15$ -> 300$ Current behavior: - Correct for A but B is 200$ It happens because when we replay the history, we check for the minimal product.value and we replay valuation from this date (with moves). However in our case, the product B has no product value and thus we replay from A product.value. However it arrives after the first receipt of B and thus we only consider the second receipt for B. This is fixed by ensuring we have a product.value for all products in order to add a date domain on the moves. Forward-Port-Of: odoo/odoo#255787
This update significantly speeds up the process of creating manufacturing orders when a sale order triggers them, particularly for products with complex Bill of Materials. By caching key data, the system avoids redundant calculations, reducing processing times from minutes to seconds, even with large product configurations. This improves overall system responsiveness and efficiency.
Original PR description
Before this commit, confirming a Sale Order that creates a Manufacturing Order for a product with a large BoM could take several minutes when `purchase_mrp` was installed. The slowdown comes from…
Before this commit, confirming a Sale Order that creates a Manufacturing Order for a product with a large BoM could take several minutes when `purchase_mrp` was installed. The slowdown comes from `mrp.bom.line._get_cost_share()`, which is called for every line during a BoM explosion. When no explicit `cost_share` is set, the method recomputes the list of eligible BoM lines and checks whether any of them has a manual cost share. That computation depends only on the BoM and the product variant, but it is recomputed for every exploded line during `mrp.bom.explode()`. This causes a full BoM scan to be repeated for every single line. This commit introduces a contextual cache, initialized in `mrp.bom.explode()`, to store that metadata. We compute it once and reuse it for all lines of the same (BoM, variant) within the same explosion. ### Benchmark: | BoM lines | Before PR | After PR | | --- | ---: | ---: | | 100 | 3.747s | 1.094s | | 300 | 26.554s | 2.826s | | 600 | 85.378s | 5.299s | | 992 | 229.246s | 9.068s | opw-6017626 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#255686 Forward-Port-Of: odoo/odoo#254868
This update resolves an issue where the system parameter for email catchall domains wasn't being properly sanitized, leading to incorrect domain matching. The fix ensures that domain lists are correctly processed, preventing misconfiguration and ensuring email notifications are delivered as intended. This improves the reliability of email functionality.
Original PR description
Since its introduction (https://github.com/odoo/odoo/pull/76734), the "mail.catchall.domain.allowed" system parameter is normally sanitized by `_sanitize_allowed_domains` when using `set_param`. But…
Since its introduction (https://github.com/odoo/odoo/pull/76734), the "mail.catchall.domain.allowed" system parameter is normally sanitized by `_sanitize_allowed_domains` when using `set_param`. But the method is not run when the system parameter is created manually, for example through the UI, because the current conditional logic is not triggered for write and create call. This can be an issue if for example the use submits this value: "domain1.com, domain2.com,domain3.com" The comma seperated list will only be split by ',', meaning that the second element is " domain2.com" (space character in front). As such, that domain will not be used as expected, since most flows using that data will end up comparing "domain2.com" vs " domain2.com", and not considering it a match. Before this fix: Create new record in System parameters with key = "mail.catchall.domain.allowed" value = "domain1.com, domain2.com,domain3.com" -> after save, value == "domain1.com, domain2.com,domain3.com" After this fix: -> after save, value == "domain1.com,domain2.com,domain3.com" * fixed 19.1 FW OPW-5505414 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#244279
This update fixes an issue where invoices with exchange differences and exchange accounts as write-offs were incorrectly fully reconciled even when the user chose to keep the invoice open for partial payment. The fix ensures that the system accurately reflects the partial payment and correctly books the exchange difference to the designated account, improving financial reporting accuracy.
Original PR description
Currently, if a user selects an exchange difference account as a write-off but then decides to keep the invoice open, the system still fully reconciles the invoice. Steps to reproduce: - Create an…
Currently, if a user selects an exchange difference account as a write-off but then decides to keep the invoice open, the system still fully reconciles the invoice. Steps to reproduce: - Create an invoice in foreign currency - Click 'Register Payment' - Select company currency - Change the amount to a lower one - Select 'Mark as fully paid' - Add the exchange difference loss/gain account as write off account - Select 'Keep open' - Click 'Create payment' Issue: Even though the user selected the option to create a partial payment and keep the invoice open, it is totally reconciled with a difference booked in the selected exchange account. Analysis: This occurs because the use of the exchange account as write off account trigger a specific flow used in localization where a writeoff is not allowed. Once the payment registration process is ongoing, the system does not check that user kept the same choice on how to handle the payment difference. opw-5468052 Forward-Port-Of: odoo/odoo#254479 Forward-Port-Of: odoo/odoo#251965
This update resolves a bug where snippets like 'countdown' were incorrectly placed in unexpected areas of the website editor. The fix restores a necessary filter, ensuring snippets are dropped into their intended sections. This improves the user experience and prevents content from being misaligned.
Original PR description
After https://github.com/odoo/odoo/pull/240547 was merged, an issue appeared with the snippets that could also be dropped as inner content. Instead of only having the dropzones for sections, all…
After https://github.com/odoo/odoo/pull/240547 was merged, an issue appeared with the snippets that could also be dropped as inner content. Instead of only having the dropzones for sections, all dropzones were activated, meaning that snippets such as countdown would sometimes be dropped as inner content. Steps to reproduce the issue: - Go to Website - Go to Edit mode - From an empty website, click on the snippet group "Content" - Select the countdown => The countdown was dropped in the footer instead of the main To fix this issue, this commit restores the missing filter (removed when the new builder was added). However, since the drag and drop was updated to only display dropzones of the "active" element, there is no need to filter the dropzones within #website_cookies_bar. Finally, the filter is no longer based on the s_popup snippet, as the drag and drop mechanic was moved outside of the website module. This commit also partially reverts the commit 5cb4f5c, since it made the tour fail with the changes of this PR (s_banner snippets can no longer be dropped inside of the s_table_of_content) The tour testing the Countdown was updated since it did not fail prior to saas-19.2, because it was not precise enough. Related to task-5428387 Forward-Port-Of: odoo/odoo#254724 Forward-Port-Of: odoo/odoo#250613
This update fixes a vulnerability where email security software was incorrectly triggering meeting cancellations by visiting links in emails. We’ve changed the email format to use post requests instead of GET requests, preventing these bots from interfering with meeting scheduling. This ensures meetings are scheduled correctly and reliably.
Original PR description
Mails are sent to users containing an acceptation and cancellation link that accepts GET requests but performs an action on visit Some mail defender software analyzes urls in links by actually visiting the URL. This leads to both actions being triggered without user input. Instead we now send buttons with a neutralizing parameter in the mail. Recipients may then visit the url and click a form button to "accept" or "decline". As these are post requests, the email bots should avoid clicking them. task-4555579 Forward-Port-Of: odoo/odoo#255912 Forward-Port-Of: odoo/odoo#198560
This update fixes an issue where invoices processed through Nemhandel in Denmark were incorrectly using the VAT ID instead of the company partner's EAN/GLN as the EndpointID. This change ensures invoices are properly routed and processed within the Nemhandel system, improving data accuracy and compliance. The fix was triggered by a specific test case demonstrating this incorrect behavior.
Original PR description
**STEP TO REPRODUCE** 1. install l10n_dk_nemhandel, and activate nemhandel. 2. Create a company partner, with a EAN/GLN as the nemhandel id. 3. Create an individual partner linked to the company partner. 4. Create an invoice with this individual partner. 5. Send the invoice with nemhandel. 6. open the xml file, and notice that the EndpointID doesn't use the EAN/GLN of the company partner. (It falls back to the VAT instead). opw-5945440 Forward-Port-Of: odoo/odoo#251783
This update fixes an issue where analytic distribution wasn't being correctly passed from sales orders to purchase orders. Now, when a sale order is created with analytic distribution enabled, that distribution will automatically be applied to the corresponding purchase order, ensuring accurate cost tracking and reporting. This improves financial visibility and reporting accuracy.
Original PR description
Steps to reproduce: - Enable analytic distribution in Accounting settings - Create a storable product "P1": - Routes: MTO + Buy - Vendor: add any supplier - Create a Sale Order: - Add 1 unit of P1 -…
Steps to reproduce: - Enable analytic distribution in Accounting settings - Create a storable product "P1": - Routes: MTO + Buy - Vendor: add any supplier - Create a Sale Order: - Add 1 unit of P1 - Set any analytic distribution - Confirm the Sale Order Result: A Purchase Order is created, but the analytic distribution is not propagated to the purchase order line. Problem: When the Sale Order is confirmed, `_action_launch_stock_rule()` is triggered. It creates and confirms the corresponding stock move with values from the sale order line. Since the product uses the MTO route, the procurement rule is executed. The rule prepares procurement values from the stock move, but the analytic distribution is not included in these values: https://github.com/odoo/odoo/blob/18.0/addons/stock/models/stock_move.py#L1539 Later, `_run_buy` is triggered. It uses the procurement values coming from the stock move to find an existing purchase order line candidate or to create a new one. Because the analytic distribution is missing from the values, the created (or matched) purchase order line does not contain the analytic distribution: https://github.com/odoo/odoo/blob/621a93b7b723999d943f1c4da78547763498c008/addons/purchase_stock/models/stock_rule.py#L113 Solution: Propagate the analytic distribution from the sale order line through the stock move so it can be included in the procurement values and correctly applied to the purchase order line. opw-5936971 Forward-Port-Of: odoo/odoo#254933 Forward-Port-Of: odoo/odoo#252292
This update resolves an issue where downpayment accounts weren't correctly linked between POS invoices and sales order invoices. The fix ensures that the correct account ID is used when generating invoices, preventing discrepancies in payment tracking. This improves accuracy and simplifies financial reporting.
Original PR description
[Issue] 1) When a POS downpayment is created, it doesn't set the account.move.lines.is_downpayment = true. So, no POS invoice line was being marked as a down payment. 2) When preparing to create the…
[Issue] 1) When a POS downpayment is created, it doesn't set the account.move.lines.is_downpayment = true. So, no POS invoice line was being marked as a down payment. 2) When preparing to create the invoice lines for the sales order, it never checks the original POS Invoice lines for down payments. [Fix] 1) When creating the invoice lines for the down payment through the POS, set the 'is_downpayment' based on if the product is the POS's down payment product. 2) Create _prepare_invoice_lin,e then filter through the POS invoice lines for downpayments and then set them accordingly. Steps to Replicate: 1) User creates a Sales Order for a customer, 2) Transfers it to the POS, and the customer makes a down payment. 3) The user creates an invoice on the Sales order to pay the remainder of the bill 4) The account Id on the account.move.line does not match the original account on the POS invoice for the original account.move.line Video Demo of the issue: https://drive.google.com/file/d/1FszCJRUF-cCgg8otxu1jj1kmdKauwTGL/view?usp=drive_link Video Demo of Solution: https://drive.google.com/file/d/1yrYBdQZFw7YeKxsgsQQx5gHkuGER-7BN/view?usp=drive_link Forward-Port-Of: odoo/odoo#249180
This update fixes an issue where the cost of stock lots was incorrectly calculated across multiple companies. Previously, the system stored a single, company-specific cost, leading to inaccurate valuations when using shared products. Now, the cost is dynamically calculated based on each company's context, ensuring accurate accounting for all businesses.
Original PR description
Field avg_cost was set to store=True in 42d3e34, but the compute method _compute_avg_cost() is company-context-dependent (calls _run_fifo which filters by env.company). Storing a single value causes incorrect valuations in multi-company databases with FIFO + lot valuation. In multi-company setups with shared products (company_id=False), the lot's avg_cost would compute in one company's context and store that value globally, causing all other companies to see the wrong cost. Fix: Remove store=True to compute dynamically per company context. Cannot use company_dependent=True as it requires JSONB migration. opw-5446941 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#247278