Monday, November 17, 2025
35 changes · saas-18.4
Resolved issues and error corrections
This update corrects how withholding taxes on payments are reflected in Philippine report amounts. It ensures the reported figures match the expected totals, reducing discrepancies in compliance and financial reporting.
Original PR description
Partially backport the rework from 19 in order to ensure withholding taxes on payment affect the amounts as expected. Community PR: odoo/odoo#226794 Ref 19.0 Community: odoo/odoo#218090 Ref 19.0 Enterprise: odoo/enterprise#89830 Task [link](https://www.odoo.com/odoo/project.task/5081387) task-5081387 Forward-Port-Of: odoo/enterprise#94541
This update fixes how withholding taxes are applied when a payment is made, so the reported amounts now match the expected values. It helps ensure Philippine tax reports are more accurate and consistent with payment processing.
Original PR description
Partially backport the rework from 19, in order to ensure withholding taxes on payment affect the amounts as expected. Enterprise PR: odoo/enterprise#94541 Ref 19.0 Community: odoo/odoo#218090 Ref 19.0 Enterprise: odoo/enterprise#89830 Task [link](https://www.odoo.com/odoo/project.task/5081387) task-5081387 Forward-Port-Of: odoo/odoo#226794
This update fixes an error that could appear when users enter certain barcode numbers in the barcode scanning screen. It ensures the system returns the expected information format, preventing crashes and allowing barcode scans to be processed normally.
Original PR description
This error occurs while entering the barcode number. Steps to reproduce: --- - Install `stock_barcode` module(without demo) - Setting > Barcode > Set Barcode Nomenclature = `Default GS1 Nomenclature`…
This error occurs while entering the barcode number. Steps to reproduce: --- - Install `stock_barcode` module(without demo) - Setting > Barcode > Set Barcode Nomenclature = `Default GS1 Nomenclature` - Barcode > click on `Scan or tap` > Enter a barcode(barcode number should startwith `urn` (eg: "urn:epc:tag:sgtin-96 : 3.0614141.038656.0")) > Apply Traceback: --- `KeyError: 'rule'` (with GS1 Nomenclature) `AttributeError: 'list' object has no attribute 'get'` (without GS1 Nomenclature) At [1], we expect the key `rule` to be present in the result, but this key is never set in the return statement at [2]. Since [1] also relies on the result’s type, a new key value `type` has been added in this [commit] to address that. This commit ensures that the correct keys are passed in the result dictionary. [1]- https://github.com/odoo/enterprise/blob/b001e9cc2af0f800e2a7965b61aa9b9c5bd4e89e/stock_barcode/controllers/stock_barcode.py#L29-L31 [2]- https://github.com/odoo/odoo/blob/f8f72b15598576f5870e49879e96fc5c127a6100/addons/barcodes/models/barcode_nomenclature.py#L174-L189 [commit]: https://github.com/odoo/odoo/commit/1394fa161a6fcf77b4443cbf784ad7dd635e7f9e#diff-be2a58d0591614180295c070396ff487f4bc04bf33aad2829d7bfab4671a792cR60 sentry-6992944243 Forward-Port-Of: odoo/enterprise#98761
This change brings back missing contact information in the Swiss payroll transmission flow. It helps ensure employee records are complete when payroll data is sent, reducing the risk of issues caused by incomplete contact details.
Original PR description
task-5248986 Forward-Port-Of: odoo/enterprise#99401
Regular users can now create Global Invoices in Mexico without running into an access error on attachments. This prevents a blocked workflow for demo and other non-admin users while keeping the invoice creation process working as expected.
Original PR description
## Issue: When creating a Global Invoice with a non-admin user (e.g., demo), an Access Error was raised: `Sorry, you are not allowed to access this document` ## Cause: This commit change the…
## Issue: When creating a Global Invoice with a non-admin user (e.g., demo), an Access Error was raised: `Sorry, you are not allowed to access this document` ## Cause: This commit change the attachment creation to use the SUPERUSER: https://github.com/odoo/enterprise/pull/95197 However, updating `attachment.res_id` then required `base.group_system` access rights, preventing regular users from modifying the attachment As a result, non-admin users (like demo) triggered an access error during Global Invoice creation ## Steps to reproduce: - Switch to the MX company - Create a product with an UNSPSC Category (Accounting Tab) - Create and Confirm an Invoice for the product (enable CFDI to public) - Connect as Demo - Go in Accounting > Customers > Invoices - Toggle the last created invoice checkbox - Actions > Create Global Invoice - Before the fix, the Access Error is displayed - Check in the invoice Chatter for the Global CFDI document creation success opw-5181925 Forward-Port-Of: odoo/enterprise#98218
The VoIP contact search now skips the mobile-phone lookup until the user has typed at least three characters. This prevents an error from appearing when someone starts typing a phone number and makes the search feel smoother and more reliable.
Original PR description
`phone_mobile_search` doesn't allow you to search for less than 3 characters. This commit excludes `phone_mobile_search` from the search domain when there are less than 3 characters. This avoids triggering an UserError on the first characters typed. Forward-Port-Of: odoo/enterprise#99548
This change prevents large memory spikes when importing French accounting files (FEC). Odoo now loads only the partner information needed to match records, instead of preloading all partner data, which helps the import complete more reliably on large databases.
Original PR description
### Description: When importing an FEC, Odoo will fetch all the partners to link the new imported records to the existing partners. The issue is that it triggers the prefetching of all the fields of the partners (304k partners in their case), causing a memory error. To avoid that, we can just fetch the field that we need (e.g. "name" and "ref"). ### Reference: opw-5153555 Forward-Port-Of: odoo/enterprise#98483
This fix resolves an error that could happen when users add a shape to an image picked from Unsplash after searching with multiple words. The image link is now handled correctly, so the editor can process the image without failing.
Original PR description
Steps to reproduce: =================== - Connect Unsplash to your database - Add a snippet on your website page like "Feature wall" for example - Double click on an existing image - type at least…
Steps to reproduce: =================== - Connect Unsplash to your database - Add a snippet on your website page like "Feature wall" for example - Double click on an existing image - type at least two words separated by a space like "Sleeping cat" - select any image from the list. - Add a shape to this image -> Traceback Cause: ====== When an image is chosen from Unsplash using a multi-word search, its URL contains encoded characters (e.g., `%20` for a space). The image processing utility was extracting the `pathname` directly from the image's URL. This path, however, remained URL-encoded. This encoded path was then used in a subsequent RPC call to fetch the original image data before applying the shape. https://github.com/odoo/odoo/blob/b9435baa1948f54e19f2dd5702a39d073e8eb57d/addons/html_editor/static/src/utils/image_processing.js#L204 This caused the fetch operation to fail, returning an `undefined` value. The attempt to apply a shape to this `undefined` result is what triggered the traceback. Solution: ========= The `srcUrl.pathname` is now wrapped in `decodeURIComponent()`. This function correctly decodes URL-encoded sequences (like `%20`) back into their original characters before the path is sent to the server. The backend now receives a clean, valid path, resolving the traceback. opw-5241317 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update prevents AI chat issues when a user closes a conversation before the answer arrives. Instead of crashing or sending the reply to a new, unrelated chat, the system now handles the closed conversation correctly.
Original PR description
If a user sends a message to an ai agent and then closes the chat channel before receving the response, - For AI composer channels (channels opened through AI chatter button) an error occurs. - For…
If a user sends a message to an ai agent and then closes the chat channel before receving the response, - For AI composer channels (channels opened through AI chatter button) an error occurs. - For other AI channels, A new ai chat channel gets created and the response is posted to that channel instead of the deleted one. Cause of the Issue : When the channel is deleted, a serialization error occurs because one transaction is trying to delete the channel while the other is trying to post the ai response to the channel. The delete transaction finishes execution and the response generation transaction is retried. - For AI composer channels some fields of the deleted channel are accessed inside `_ai_add_message_to_context` and `_ai_create_response` which raises an error. - For other AI channels, when generate_response is retried,_get_or_create_ai_chat is called and given that the old channel has already been deleted, a new one is created and the response is posted to that channel. Note: No issue will happen if the response generation transaction is executed and the deletion transaction is retried, because it will delete the channel after the response was posted which is a normal behavior. task-5063221 Forward-Port-Of: odoo/enterprise#93877
This update corrects the way fixed local taxes are written into Mexican electronic invoices (CFDI). It prevents the tax amount from being multiplied by 100, ensuring the XML shows the right value and reducing the risk of rejected or incorrect invoices.
Original PR description
Steps to reproduce: 1. With an MX Company setup configure a new tax as follows - Tax Computation: Fixed - SAT Tax Type: Local - Factor Type: Cuota - Amount: 5 2. Create a customer invoice with the tax 3. Generate CFDI Issue: In the XML the ImpuestosLocales node contains `<implocal:TrasladosLocales ImpLocTrasladado="VAT 0%" Importe="20.00" TasadeTraslado="500.00"/>` The tax fixed amount was multiplied by 100 This occurs because we don't check if the tax is fixed when normalizing the amount opw-5132807 Forward-Port-Of: odoo/enterprise#99431 Forward-Port-Of: odoo/enterprise#98988
Invoice generation for subscriptions now works even if a previously invoiced order line was deleted. This prevents a billing error that could stop customers from creating new invoices, while keeping the existing partial credit note behavior intact.
Original PR description
**Issue** When a subscription order line is deleted after being invoiced, attempting to create a new invoice for the subscription raises a UserError about UoM category mismatch. Video:…
**Issue** When a subscription order line is deleted after being invoiced, attempting to create a new invoice for the subscription raises a UserError about UoM category mismatch. Video: https://drive.google.com/file/d/11-CV7wcEHQJFoVEQM5o5YBkZuTXPYDqL/view **Steps to Reproduce** 1. Create and confirm a subscription with a recurring product (e.g., Car Leasing) 2. Generate and post the invoice for the subscription 3. Add a new product line to the subscription (e.g., Office Cleaning Service) 4. Delete the original invoiced line (Car Leasing) 5. Attempt to create an invoice for the new product line → Error: "The unit of measure Units defined on the order line doesn't belong to the same category as the unit of measure False defined on the product. Please correct the unit of measure defined on the order line or on the product, they should belong to the same category." (https://drive.google.com/file/d/11-CV7wcEHQJFoVEQM5o5YBkZuTXPYDqL/view) **Root Cause** Commit https://github.com/odoo/enterprise/commit/22e49fca1e0fbfefac974c562491d170b8d70025 introduced quantity tracking per period in _get_max_invoiced_date() to fix partial credit note handling. The implementation accesses `sale_line_ids.product_uom` assuming sale_line_ids is always populated. However, when a sale order line is deleted, the related account.move.line remains in the system with empty sale_line_ids. Accessing `sale_line_ids.product_uom` on an empty recordset returns False, causing the UoM validation to fail during invoice creation. **Fix** Add a fallback to use the invoice line's own product_uom_id when sale_line_ids is empty. This preserves the partial credit note fix from https://github.com/odoo/enterprise/commit/22e49fca1e0fbfefac974c562491d170b8d70025 while handling the edge case of deleted subscription lines. If no valid UoM is found, the line is skipped in the calculation. Forward-Port-Of: odoo/enterprise#99497 Forward-Port-Of: odoo/enterprise#99231
Fixed an issue in the website editor where adding an image to a grid could cause the page to keep loading indefinitely. This improves reliability when building pages, especially when using GIF or SVG images.
Original PR description
The action for adding an image was waiting on the `load` event on the image, but it may have already occurred, thus the promise would never resolve. With this commit, we do not wait if the img is already `complete`. Steps to reproduce (non-deterministic): - Open website builder - Click on a grid element (for example a "Banner" snippet) - Click on "Image" in "Add Elements" option - Add an image (it seems more likely to trigger the bug with a gif) - Bug: The dialog closes, and an infinite load follows task-5187071 opw-5167545
This update fixes product search in sales orders so users can find items by a supplier’s product name or code again. It restores context needed by the search logic after a previous cleanup removed it, improving day-to-day order entry speed and accuracy.
Original PR description
Commit 6e69b1d4a357bf236695a2ed5b09fd62de911872 cleaned up SO views and removed some context fields from the product_id and product_template_id fields which were in fact used in the `_search_display_name` override of the related models. This commit brings back those values to allow finding products by their seller product name or code. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235591
This update sends the database identifier to Odoo’s cloud service when SMS-related requests are made. It helps support teams more quickly identify the affected system and troubleshoot customer issues.
Original PR description
Send the db_uuid to IAP such that we can more easily debug and support our users in case of a problem. task-none Forward-Port-Of: odoo/odoo#235540 Forward-Port-Of: odoo/odoo#233912
When a lead is moved to a different sales team, its stage is now refreshed to match the stages allowed for that team. This prevents leads from staying in an outdated stage that may no longer be valid for the new team, helping keep CRM records accurate and consistent.
Original PR description
**Steps to reproduce:** - Install CRM and set the Leads configuration setting - Go to CRM > Configuration > Sales Teams - Create two Sales Teams - Go to CRM > Configuration > Stages - Create multiple stages specific to each team - Make the current user belong to both teams - Go to CRM > Leads - Create a new lead (stage is assigned here) - Change its Sales Team - Lead stage is not updated according to the team **Issue:** The `stage_id` of `crm.lead` is never updated after it is set. This means that changing the related team will not modify the possible stages of the lead (even if it should not be available to the current team). **Fix:** Check if the team of the lead is the same as the one of its current stage during `_compute_stage_id`. opw-4901009 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#232136
The system now keeps the correct default document type when creating debit notes. This prevents the debit note wizard from accidentally replacing it with an invoice document type, making the default selection more reliable for users.
Original PR description
Restores code from v16 to define a default document type for debit notes on records with debit_origin_id. Previously, when using the wizard to generate a debit note, the default document type (related to debit notes) was being overwritten by the first document type associated with invoices. Although this behavior will be removed in v17, this fix is necessary to prevent overwriting the default value for now. Note: It's still possible to use the document type for invoices. Therefore, the change only affects the computation of the default value. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#181106
This change removes an unnecessary database sequence created for each Point of Sale session once that session is closed. It helps keep the database cleaner and avoids accumulating unused sequences over time, which improves maintainability.
Original PR description
to avoid having too many postgres sequences, this make sure the sequence used by the pos session is cleaned up after being closed. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235875 Forward-Port-Of: odoo/odoo#235500
This fix ensures the manufacturing work order’s cost is properly recorded when an operation is marked as done directly from the status widget. As a result, project profitability and gross margin calculations now include the expected labor cost in this workflow.
Original PR description
Backport of: 223ec6ac83ba2ec94f7ea394458aee0972bb8b44 **Original msg commit:** This commit fixes the problem of adding the hourly cost of the work center when marking an operation as done from the status widget. To reproduce the bug: 1- Create a work center with an hourly cost > 0. 2- Create an MO with 1 operation in that work center, expected time > 0. 3- Create and set a project on the MO. 4- Make sure that project has an analytic account. 5- Mark the operation as done from the status widget. (click on it and choose done, don't use the start button) 6- Go to the analytic account of the project and check the gross margin. = No cost of the workorder was added. Now, this commit takes into account the duration of the WO first when marking it as done directly from the status widget. opw-5170664 Forward-Port-Of: odoo/enterprise#99439
This fix ensures the POS shows the right message when communication with the Blackbox times out. It prevents users from seeing a misleading warning about the Fiscal Data Module, helping support teams and store operators understand the real issue faster.
Original PR description
Before this commit, in the case when there is a timeout communicating with the Blackbox in the POS, an incorrect error message was shown stating that "The IoT Box is connected but the Fiscal Data Module isn't". This message should only be shown when we receive a reply from the IoT box, but it tells us it cannot find the Blackbox. <img width="695" height="240" alt="image" src="https://github.com/user-attachments/assets/ec011f4a-42dd-4ffd-8741-350032897471" />
This change prevents grouped list views from crashing when sample data is shown alongside real group information. It makes list views handle sample records more consistently, so users can browse grouped data without errors in empty or partially empty views.
Original PR description
This commit reverts PR [1] which attempted to fix an issue with grouped list views with sample data. The issue occured when the web_read_group returned real groups that are all empty. When this…
This commit reverts PR [1] which attempted to fix an issue with grouped list views with sample data. The issue occured when the web_read_group returned real groups that are all empty. When this happened, the model kept and relied on the real groups information, in particular which groups are open ("folded" flag).
In kanban, this works fine because we use those real groups in the sample server, and populate them with sample records. However, we didn't do that for the list view, for an obscure reason. As a consequence, in list, we sometimes received sample groups that matched the real ones (same id, when grouped by many2one), so we re-used the real group information (i.e. the folded flag). We were then manipulating groups that we believed to be open, i.e. to have a `records` key, whereas the fake read group done by the sample server returned groups without that `records` key, leading to a crash.
PR [1] tried to fix web_read_group in the SampleServer, to take into account the `opening_info` and return a `__records` key for opened groups. However, the fix crashed if there were more open real groups than sample groups (i.e. 5).
This commit fixes the issue by generalizing the kanban logic to the list, i.e. by moving it to the RelationalModel. From now on, both kanban and list will use the real groups, and fill them with sample data if necessary.
In master, we'll go even further by allowing to manipulate those groups (e.g. edit, create new...) like we do in kanban.
[1] https://github.com/odoo/odoo/pull/226253
Issue reported on the feedback pad after migrating odoo.com to v19
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prWhen a sales order’s pricelist is changed and prices are recalculated, optional products will now update correctly as well. This avoids showing outdated or incorrect prices on the order, helping users keep quotations and sales orders consistent.
Original PR description
### Steps to reproduce: - Create a sale order with a SOL and an optional product - Preview the sale order and add the optional product to the order - Go back to edit mode and change the pricelist -…
### Steps to reproduce: - Create a sale order with a SOL and an optional product - Preview the sale order and add the optional product to the order - Go back to edit mode and change the pricelist - Click on 'Update Prices' - Notice the optional product price won't change ### Cause: When updating the prices of the SOLs we filter some lines that we won't recompute. Upon this commit https://github.com/odoo-dev/odoo/commit/2d919694d5c9588e0644d5ba82b15b9d3f762373 we remove the optional products from the recordset that will get price recomputation. If sale_subscription is installed we will set the product's prices to 0 https://github.com/odoo/enterprise/blob/85e0689ba12442e22e83f3337749c7ad2eb9d7d8/sale_subscription/models/sale_order.py#L674 so the price of the 'Optional product' SOL will change but will be equal to 0 ### Fix: An exception for the filtering has been introduced as we will recompute the price of the optional products only if the pricelist is getting changed opw-5058609 Forward-Port-Of: odoo/odoo#234968 Forward-Port-Of: odoo/odoo#230053
This change corrects how payroll versions are chosen when creating payslips, so calculations now better match the payslip dates. It also removes an automatic date default that could lead to incorrect results, especially for manually created payslips.
Original PR description
Current version_id computation does not depend on payslip dates, which could very often lead to wrong calculations, in this PR we solve this by removing the cyclic dependency between dates and version compute by removing the default computation of the date_start, which is often wrong anyway in the case of a single manual payslip
The Job Page button on job cards now only appears when Online Posting is enabled. When it is available, the button correctly opens the job link, helping users avoid confusing or non-functional actions.
Original PR description
This commit fixes the visibility of the "Job Page" button on the job kanban view. The job page button is now invisible when the `Online Posting` setting is disabled and visible when it is enabled, and directs to the job link. task-5153230 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Users can now remove the date from a draft payslip without triggering an error. This makes it safer to edit payslips in progress and helps prevent interruptions while correcting payroll data.
Original PR description
When removing the date in a draft payslip an exception was raised. This was fixed and a test was added to check the flow. Related to odoo/odoo#231247 task-5159666
This change prevents an error in payroll processing when a payslip date is empty or missing. It makes the system handle those cases safely instead of crashing, improving reliability for users and reducing interruptions.
Original PR description
The assertion was added to prevent the use of the _is_overlapping_period function with null or False dates. Which fixes an exception caused when a payslip's date was false/null. Related to odoo/enterprise#97013 task-5159666
This change fixes an issue in Malaysian e-invoicing where vendor credit notes could be rejected if the original bill had a custom reference. The system now uses the stored original invoice reference when generating the reversal document, helping submissions pass validation reliably.
Original PR description
Currently, customers get an error when trying to send the vendor credit note to MyInvoise if a reference has been set on the bill. ``` The validation failed with the following errors: The reference…
Currently, customers get an error when trying to send the vendor credit note to MyInvoise if a reference has been set on the bill. ``` The validation failed with the following errors: The reference document UUID [...] does not exist. The internal ID for DocumentUUID [...] does not match. ``` Steps to reproduce: - With an MY company setup - Create a bill and add a custom reference - Send Bill to MyInvois - Create credit note for the Bill - Send Credit note to MyInvoice Issue: Validation will fail because the reference does not match. In the reverse bill we always send the original bill name as original bill id, but also the reference could have been used. Analysis: A solution would be to send always the reference of the original vendor bill if present. However, the bill reference may be altered after submitting the e-invoice. A safer way is to retrieve the reference from the stored e-invoice. opw-5057050 Forward-Port-Of: odoo/odoo#234762 Forward-Port-Of: odoo/odoo#234199
This update refreshes a networking library used by the IoT box to help prevent unexpected disconnections. It should make connected devices more reliable and reduce interruptions for users relying on the IoT box.
Original PR description
This commit updates the PIP package websocket-client to 1.9.0 to fix disconnection issues. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235848 Forward-Port-Of: odoo/odoo#235748
Imported refund invoices for Italian e-invoicing now keep their refund status even when they match a purchase order. This prevents the document type from being changed incorrectly, reducing accounting errors during invoice import.
Original PR description
The `move_type` is changed after PO match. This PR fixes the case of import a refund that matches a PO so the `move_type` is not changed after matching. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235609 Forward-Port-Of: odoo/odoo#233907
Users can now mention every member of a group chat even when they are inside a thread. This fixes a limitation that previously only allowed mentioning oneself in that context, making threaded conversations more useful and consistent.
Original PR description
Before this commit, when inside a thread of a group chat, it would not be possible to mention channel members that are not inside said thread. Steps to reproduce: 1. Create group chat 2. Create a thread 3. Try to mention -> can only mention self This commit fixes the issue by: 1. In the `get_mention_suggestions_from_channel`: correctly adding in the store all partners inside the parent channel 2. In the suggestion service: taking the `channel_member_ids` from the `parent_channel_id` when present task-5233010 Forward-Port-Of: odoo/odoo#235793 Forward-Port-Of: odoo/odoo#234887
The livechat info side panel now displays chatbot answers for the selected conversation instead of accidentally showing responses from a later session. It also hides blank chatbot entries, making the panel clearer and easier to read.
Original PR description
**Description of the issue this PR addresses:** The info side panel in livechat displayed incorrect or empty chatbot answers for previous sessions. 1. When a visitor used the same chatbot multiple times, the panel showed answers from the latest session instead of the selected one. 2. when a user skipped a question, the panel still displayed an empty line with a comment icon. **Current behavior before PR:** 1. Chatbot answers were fetched using an incorrect query that didn’t consider the specific livechat session or channel. 2. Empty chatbot responses appeared in the side panel. **Desired behavior after PR is merged:** 1. The correct chatbot answers for the selected session are now shown in the info side panel. 2. Empty chatbot answers are hidden. task-[4981175](https://www.odoo.com/odoo/project/1519/tasks/4981175)
This change ensures Paymob keeps the reference prefix provided by the system when creating unique payment references. It helps avoid reference issues that could affect payment tracking and consistency.
This change fixes a validation issue in accounting that could incorrectly block updates when the same special account exists in multiple inactive companies. It now treats inactive companies separately, so valid records are grouped properly and no longer trigger a false error.
Original PR description
# Description of the issue/feature this PR addresses: Currently, the constraint `account.account._check_account_type_unique_current_year_earning` raises a validation error when there are more than…
# Description of the issue/feature this PR addresses:
Currently, the constraint `account.account._check_account_type_unique_current_year_earning` raises a validation error when there are more than one accounts of type "Current Year Earnings" in the same company. This is expected behaviour.
However, the ORM will throw an exception if it finds two or more accounts of this type across multiple inactive companies. Example:
```sql
lare_3183476=>
SELECT COUNT(account.id), account.company_id, company.active
FROM account_account account
JOIN res_company company
ON account.company_id = company.id
WHERE account.account_type = 'equity_unaffected'
GROUP BY account.company_id, company.active;
count | company_id | active
-------+------------+--------
1 | 1 | t
1 | 2 | f --
1 | 3 | t
1 | 4 | f --
1 | 5 | t
1 | 6 | t
(6 rows)
```
# Current behavior before PR:
When the above constraint retrieves accounts of type "Current Year Earnings" grouped by their companies, those records belonging to inactive companies are grouped together into an "empty" company, res.company(). This raises an exception due to the definition of the constraint even though the accounts belong to a different company, and therefore, don't break the condition.
# Desired behavior after PR is merged:
To address this issue, we will modify the context of the environment to consider inactive records in the search by disabling the flag `active_test`. Since only two models are involved in the query, and account.account doesn't have a field for active records, this addition will correctly group the accounts in their correct company.
---
upg-3185680
upg-3143424
Thanks to @jlom-odoo for providing initial insights on the problems as well as additional examples.
---
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/18.0/odoo/service/server.py", line 1361, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-13>", line 2, in new
File "/home/odoo/src/odoo/18.0/odoo/tools/func.py", line 97, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/18.0/odoo/modules/registry.py", line 129, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/src/odoo/18.0/odoo/modules/loading.py", line 523, in load_modules
migrations.migrate_module(package, 'end')
File "/home/odoo/src/odoo/18.0/odoo/modules/migration.py", line 222, in migrate_module
exec_script(self.cr, installed_version, pyfile, pkg.name, stage, stageformat[stage] % version)
File "/home/odoo/src/odoo/18.0/odoo/modules/migration.py", line 259, in exec_script
mod.migrate(cr, installed_version)
File "/home/odoo/src/odoo/18.0/addons/l10n_mx/migrations/2.2/end-migrate.py", line 7, in migrate
env['account.chart.template'].try_loading('mx', company, force_create=False)
File "/home/odoo/src/odoo/18.0/addons/account/models/chart_template.py", line 160, in try_loading
return self._load(template_code, company, install_demo, force_create)
File "/home/odoo/src/odoo/18.0/addons/account/models/chart_template.py", line 228, in _load
self._post_load_data(template_code, company, template_data)
File "/home/odoo/src/enterprise/18.0/account_reports/models/chart_template.py", line 10, in _post_load_data
super()._post_load_data(template_code, company, template_data)
File "/home/odoo/src/odoo/18.0/addons/stock_account/models/account_chart_template.py", line 12, in _post_load_data
super()._post_load_data(template_code, company, template_data)
File "/home/odoo/src/odoo/18.0/addons/account/models/chart_template.py", line 681, in _post_load_data
self._setup_utility_bank_accounts(template_code, company, template_data)
File "/home/odoo/src/odoo/18.0/addons/account/models/chart_template.py", line 874, in _setup_utility_bank_accounts
self.env['account.account']._load_records([
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 5503, in _load_records
data['record']._load_records_write(data['values'])
File "/home/odoo/src/odoo/18.0/addons/account/models/account_account.py", line 1103, in _load_records_write
super()._load_records_write(values)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 5421, in _load_records_write
self.write(values)
File "/home/odoo/src/odoo/18.0/addons/account/models/account_account.py", line 1036, in write
res = super(AccountAccount, self.with_context(defer_account_code_checks=True, prefetch_fields=not any(field in vals for field in ['code', 'account_type']))).write(vals)
File "/home/odoo/src/odoo/18.0/addons/mail/models/mail_thread.py", line 343, in write
return super(MailThread, self).write(values)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4830, in write
real_recs._validate_fields(vals, inverse_fields)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 1631, in _validate_fields
check(self)
File "/home/odoo/src/odoo/18.0/addons/account/models/account_account.py", line 42, in _check_account_type_unique_current_year_earning
raise ValidationError(_('You cannot have more than one account with "Current Year Earnings" as type. (accounts: %s)', [a.code for a in account_unaffected_earnings]))
odoo.exceptions.ValidationError: You cannot have more than one account with "Current Year Earnings" as type. (accounts: [False, False])
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#231708When a kit is bought and delivered through a workflow without a pull rule, the system now correctly links the purchased component to the original sales order line. This ensures delivered quantities and invoice cost calculations are accurate, avoiding zero delivery figures and inflated costs.
Original PR description
[FIX] purchase_mrp, sale_purchase_stock: track kit bom when receiving without pull rule Problem: If an inventory workflow is completed without any pull rules (only Push or Buy), then `bom_line_id` is…
[FIX] purchase_mrp, sale_purchase_stock: track kit bom when receiving without pull rule Problem: If an inventory workflow is completed without any pull rules (only Push or Buy), then `bom_line_id` is never set on the sale order line. The result has two primary impacts: `qty_received` will not be updated upon final transfer, and the COGS line on the invoice will be calculated using the incorrect method, with an incorrect result. Solution: Upon confirming a Purchase Order, when the picking is being created, we will try to assign the `bom_line_id` on the Sale Order Line if: 1. The PO is attached to a Sale Order 2. The SO line is for the kit 3. The product on the PO line is component of the BOM for that kit With the `bom_line_id` assigned on the SO line, `qty_received` will be calculated correctly for kits, and COGS lines on the generated invoice will also be calculated correctly based on the kit. Steps to Replicate (Runbot 18) - 2-step receipt, 2-step delivery - Cross-Dock enabled - Kit item, fifo auto - No routes enabled on kit - Two components, fifo auto - Enable Buy and Cross-Dock routes - Set a vendor and non-zero price 1. Create a sale order for the kit and sell for non-zero price, confirm 2. Confirm the PO 3. Validate the pickings 1. Receipt 2. Cross-Dock 3. Delivery 4. Go back to the sale order, note the first issue of 0 quantity delivered 5. Create an Invoice 6. Confirm the invoice, note the second issue of the COGS lines being triple the total purchase price opw-5139590 Forward-Port-Of: odoo/odoo#235818 Forward-Port-Of: odoo/odoo#233132
This update prevents a payment failure that could occur when customers pay subscriptions in Indonesian rupiah through Xendit using cards that require 3D Secure verification. It ensures the amount sent to Xendit is in the format the payment provider expects, so checkout can complete successfully.
Original PR description
When trying to pay a subscription (tokenization enforced) in IDR with a card that require the 3DS flow in Xendit, the following error is raised: `"amount" must be an integer.` So following 46166e25f049, when creating then token authentication we must use the rounded amount (introduced by b3f4e08cea6c) to meet Xendit specific currencies requirements. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235759
This change makes specific report attachments, such as images needed by chatter-generated reports, be saved locally instead of kept as remote links. This improves reliability when reports need to use those files later, and it also adds checks to avoid unsafe remote URLs from being used directly.
Original PR description
During commit #226094, several methods were added to allow fetching remote resources for certain reports. After that commit, we notice that some attachments (like images -> image_src) must need the file localy. To avoid this issue we decided to convert this documents from remote to localy (binary), to be able to manage them. It'll just happen for the reports that need to add attachments from the chatter. OPW-5036638 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#235710 Forward-Port-Of: odoo/odoo#235077