Daily updates from Odoo
Saturday, September 27, 2025
22 changes
4 changes
Resolved issues and error corrections
This fixes an issue where website pages could fail to load after setting an SEO cover image and a website domain. The cover image is now saved in a way that works reliably across domains, preventing visitor-facing server errors.
Original PR description
Scenario: - in 19.0 add a website_meta_og_img (Website > Editor > Site > Optimize SEO > Cover Image) - set a domain on the website - go to the page with the cover image Result: an error 500 with this…
Scenario:
- in 19.0 add a website_meta_og_img (Website > Editor > Site > Optimize
SEO > Cover Image)
- set a domain on the website
- go to the page with the cover image
Result: an error 500 with this traceback error:
```py
File "addons/website/models/mixins.py", line 92, in get_website_meta
opengraph_meta['og:image'] = url_join(root_url, self.env['ir.http']
._url_for(self.website_meta_og_img or opengraph_meta['og:image']))
File "odoo/tools/urls.py", line 59, in urljoin
raise ValueError("Extra URL must use same scheme and host as base,
and begin with base path")
```
Cause: since 19.0 977e62d91f3e8235e251e9d21b08f53db1856c6b werkzeug
url_join is replaced by odoo urljoin, which requires that the path that
is appended has no host, or the same host. Since the current code saves
the scheme and host of the website_meta_og_img, if the URL is different
than the saved one (because of domain or another reason), we get an
error.
Fix: save a relative URL instead of an absolute one.
opw-5101875
opw-5102079
opw-5105258
opw-5107443
opw-5111474
opw-5112343
opw-5113844
opw-5114544
__Note:__ I rebased on 17.0 since the code has not changed since then, the problem just become visible because of the urljoin change.
__Note:__ I created a upgrade PR to fix the issue for migrated database https://github.com/odoo/upgrade/pull/8494
Forward-Port-Of: odoo/odoo#228253This fix ensures cash basis journal item lines show the correct journal entry name instead of a placeholder slash. It helps accounting users rely on accurate labels in journal item lists and reduces confusion during reconciliation and review.
Original PR description
This commit adds a test for the [change made in community](https://github.com/odoo/odoo/pull/225558). ### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if…
This commit adds a test for the [change made in community](https://github.com/odoo/odoo/pull/225558). ### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if the move is posted and has a name. ### Steps to reproduce: - Activate Cash Basis in the accounting settings - Create a tax with "Tax Exigibility" set "Based on Payment" - Set the "Cash Basis Transition Account" to "Current Assets" - Activate reconciliation on "Current Assets" - Create an invoice with this tax, confirm - In the dashboard, click on Bank and new - Set the name of the invoice as the label, and the amount of the invoice as amount - Save & Close - Go in Accounting > Transactions > Journal Items - The lines created for the cah basis entry display '/' in the column "Journal Entry" ### Cause: This issue is linked to the order in which things are done in `_set_next_sequence`: the fields triggered by the sequence field are added in `self.env.transaction.tocompute` then the sequence is computed and assigned. When `_set_next_sequence()` is called from [`_create_tax_cash_basis_moves()`](https://github.com/odoo/odoo/blob/849e4a87178d8c8588b75e3f7d9073d6a78326f9/addons/account/models/account_partial_reconcile.py#L649-L654) this order is problematic as `account.move.line.move_name` will be computed and removed from `self.env.transaction.tocompute`. So it will not be updated when the sequence is assigned in `account.move.name`. The callstack is something like this: - `_set_next_sequence()` calls `_locked_increment()` to compute the sequence - `_locked_increment()` calls `flush_recordset()` which will call `_recompute_recordset()` to recompute all fields - `_compute_invoice_date_due()` needs the field `needed_terms` triggering `_compute_needed_terms()` - `_compute_needed_terms()` needs `invoice_line_ids` - the fetch on `account.move.line` is ordered by `move_name` - So `_compute_related()` is triggered for `move_name` and `account.move.line.move_name` is removed from `self.env.transaction.tocompute` Then `_locked_increment()` returns the sequence, it gets assigned as the move name and `move_name` is never updated because it's not in `self.env.transaction.tocompute`. This doesn't occur in other flows (like calling `action_post()`) because the value of `needed_terms` is read from the cache. ### Solution: Swap the order in which things are done in `_set_next_sequence()`: first compute and assign the sequence and then add the triggered fields in `self.env.transaction.tocompute` so that they are computed afterwards. It seems more logic that way: we change the `_sequence_field` then mark all fields that will be impacted in `tocompute`. opw-5056938 Forward-Port-Of: odoo/enterprise#94111
This fixes an accounting display issue where cash basis journal item lines could show '/' instead of the correct journal entry name after posting. The change ensures related accounting fields are refreshed after the sequence number is assigned, improving accuracy in journal item lists and reducing confusion during reconciliation or review.
Original PR description
### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if the move is posted and has a name. ### Steps to reproduce: - Activate Cash Basis in the accounting…
### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if the move is posted and has a name. ### Steps to reproduce: - Activate Cash Basis in the accounting settings - Create a tax with "Tax Exigibility" set "Based on Payment" - Set the "Cash Basis Transition Account" to "Current Assets" - Activate reconciliation on "Current Assets" - Create an invoice with this tax, confirm - In the dashboard, click on Bank and new - Set the name of the invoice as the label, and the amount of the invoice as amount - Save & Close - Go in Accounting > Transactions > Journal Items - The lines created for the cah basis entry display '/' in the column "Journal Entry" ### Cause: This issue is linked to the order in which things are done in `_set_next_sequence`: the fields triggered by the sequence field are added in `self.env.transaction.tocompute` then the sequence is computed and assigned. When `_set_next_sequence()` is called from [`_create_tax_cash_basis_moves()`](https://github.com/odoo/odoo/blob/849e4a87178d8c8588b75e3f7d9073d6a78326f9/addons/account/models/account_partial_reconcile.py#L649-L654) this order is problematic as `account.move.line.move_name` will be computed and removed from `self.env.transaction.tocompute`. So it will not be updated when the sequence is assigned in `account.move.name`. The callstack is something like this: - `_set_next_sequence()` calls `_locked_increment()` to compute the sequence - `_locked_increment()` calls `flush_recordset()` which will call `_recompute_recordset()` to recompute all fields - `_compute_invoice_date_due()` needs the field `needed_terms` triggering `_compute_needed_terms()` - `_compute_needed_terms()` needs `invoice_line_ids` - the fetch on `account.move.line` is ordered by `move_name` - So `_compute_related()` is triggered for `move_name` and `account.move.line.move_name` is removed from `self.env.transaction.tocompute` Then `_locked_increment()` returns the sequence, it gets assigned as the move name and `move_name` is never updated because it's not in `self.env.transaction.tocompute`. This doesn't occur in other flows (like calling `action_post()`) because the value of `needed_terms` is read from the cache. ### Solution: Swap the order in which things are done in `_set_next_sequence()`: first compute and assign the sequence and then add the triggered fields in `self.env.transaction.tocompute` so that they are computed afterwards. It seems more logic that way: we change the `_sequence_field` then mark all fields that will be impacted in `tocompute`. opw-5056938 Forward-Port-Of: odoo/odoo#225558
Online shop availability now updates correctly when customers add either a kit product or one of its shared components to their cart. This prevents shoppers from seeing misleading remaining quantities and helps avoid overselling when out-of-stock sales are disabled.
Original PR description
### Steps to reproduce: - In the settings website > Shop: - Disable `Out-of-Stock: Continue Selling`. - Enable `Show Available Qty` if below 5 units. - Create 2 storable products published on the…
### Steps to reproduce:
- In the settings website > Shop:
- Disable `Out-of-Stock: Continue Selling`.
- Enable `Show Available Qty` if below 5 units.
- Create 2 storable products published on the website:
- COMP, put 1 unit in stock.
- KIT with bom of type Kit using 1 x COMP.
- With a private window go to the shop.
- Add 1 x COMP or KIT to the chart.
#### > This is not reflected on the available quantity in stock of the other product
### Cause of the issue:
The availability on the website is computed from the product availability using the `free_qty` fetched because of this override: https://github.com/odoo/odoo/blob/d358542c9159f325b4e2ff184ed1f5cdb6b8c5a9/addons/website_sale_stock/controllers/variant.py#L10-L13 from which the cart quantity of the product itself is deduced before re-render:
https://github.com/odoo/odoo/blob/d358542c9159f325b4e2ff184ed1f5cdb6b8c5a9/addons/website_sale_stock/static/src/js/variant_mixin.js#L49-L51 https://github.com/odoo/odoo/blob/d358542c9159f325b4e2ff184ed1f5cdb6b8c5a9/addons/website_sale_stock/static/src/js/variant_mixin.js#L83-L86 While the `free_qty` is correctly computed from kit products based on the component availability:
https://github.com/odoo/odoo/blob/d358542c9159f325b4e2ff184ed1f5cdb6b8c5a9/addons/mrp/models/product.py#L211-L221 The qties in the virtual cart quantities are not recomputed base on kits.
opw-4889956
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#228754
Forward-Port-Of: odoo/odoo#2229451 change
Resolved issues and error corrections
This fix prevents website pages from crashing when an SEO cover image is set and the website uses a configured domain. The cover image is now stored in a way that remains valid across domains, keeping pages accessible and social sharing metadata working correctly.
Original PR description
Scenario: - in 19.0 add a website_meta_og_img (Website > Editor > Site > Optimize SEO > Cover Image) - set a domain on the website - go to the page with the cover image Result: an error 500 with this…
Scenario:
- in 19.0 add a website_meta_og_img (Website > Editor > Site > Optimize
SEO > Cover Image)
- set a domain on the website
- go to the page with the cover image
Result: an error 500 with this traceback error:
```py
File "addons/website/models/mixins.py", line 92, in get_website_meta
opengraph_meta['og:image'] = url_join(root_url, self.env['ir.http']
._url_for(self.website_meta_og_img or opengraph_meta['og:image']))
File "odoo/tools/urls.py", line 59, in urljoin
raise ValueError("Extra URL must use same scheme and host as base,
and begin with base path")
```
Cause: since 19.0 977e62d91f3e8235e251e9d21b08f53db1856c6b werkzeug
url_join is replaced by odoo urljoin, which requires that the path that
is appended has no host, or the same host. Since the current code saves
the scheme and host of the website_meta_og_img, if the URL is different
than the saved one (because of domain or another reason), we get an
error.
Fix: save a relative URL instead of an absolute one.
opw-5101875
opw-5102079
opw-5105258
opw-5107443
opw-5111474
opw-5112343
opw-5113844
opw-5114544
__Note:__ I rebased on 17.0 since the code has not changed since then, the problem just become visible because of the urljoin change.
__Note:__ I created a upgrade PR to fix the issue for migrated database https://github.com/odoo/upgrade/pull/8494
Forward-Port-Of: odoo/odoo#2282531 change
Resolved issues and error corrections
Users can now archive multiple helpdesk teams at once even when those teams are connected to different websites. This prevents an error that interrupted normal helpdesk administration and makes multi-website setups easier to manage.
Original PR description
Currently, an error occurs when archiving multiple helpdesk teams linked to different websites. **Steps to reproduce:** - Install the `website_helpdesk` module. - Go to Website, Configuration >…
Currently, an error occurs when archiving multiple helpdesk teams linked to different websites. **Steps to reproduce:** - Install the `website_helpdesk` module. - Go to Website, Configuration > Websites and create two websites (`W1` and `W2`). - Go to Helpdesk, Configuration > Helpdesk Teams > create two teams (`T1` and `T2`). - Enable the `Website Form` (under `Help Center`), assign `W1` to `T1` and `W2` to `T2`. - Return to the list view, select both teams, and attempt to `archive` them. **Error:** `ValueError: Expected singleton: website(3, 1)` **Root Cause:** At [1], the code incorrectly uses `with_website.website_id.id`, when `multiple websites` are involved, this leads to an `error`. **Fix:** This commit prevents errors and ensures that users can archive multiple helpdesk teams linked to different websites [1]: https://github.com/odoo/enterprise/blob/8b72fdef63f634ccf436b49adbac5c1f9358c127/website_helpdesk/models/helpdesk.py#L102 sentry-6867906123 Forward-Port-Of: odoo/enterprise#94318
2 changes
Resolved issues and error corrections
Fixed an issue that prevented users from archiving multiple Helpdesk teams when those teams were connected to different websites. This keeps day-to-day Helpdesk configuration work smooth for companies managing more than one website.
Original PR description
Currently, an error occurs when archiving multiple helpdesk teams linked to different websites. **Steps to reproduce:** - Install the `website_helpdesk` module. - Go to Website, Configuration >…
Currently, an error occurs when archiving multiple helpdesk teams linked to different websites. **Steps to reproduce:** - Install the `website_helpdesk` module. - Go to Website, Configuration > Websites and create two websites (`W1` and `W2`). - Go to Helpdesk, Configuration > Helpdesk Teams > create two teams (`T1` and `T2`). - Enable the `Website Form` (under `Help Center`), assign `W1` to `T1` and `W2` to `T2`. - Return to the list view, select both teams, and attempt to `archive` them. **Error:** `ValueError: Expected singleton: website(3, 1)` **Root Cause:** At [1], the code incorrectly uses `with_website.website_id.id`, when `multiple websites` are involved, this leads to an `error`. **Fix:** This commit prevents errors and ensures that users can archive multiple helpdesk teams linked to different websites [1]: https://github.com/odoo/enterprise/blob/8b72fdef63f634ccf436b49adbac5c1f9358c127/website_helpdesk/models/helpdesk.py#L102 sentry-6867906123 Forward-Port-Of: odoo/enterprise#94318
The barcode workflow now correctly blocks receipt validation when the operation type requires a destination location scan. This helps ensure stock is put into the intended location and prevents incomplete warehouse processing.
Original PR description
This commit fixes the the problem of not forcing destination location scan before barcode validation even if the setting `Force a destination for all products` is activated. To reproduce: 1- Open `Operation Types` in Inventory. 2- Go to Receipt and open the `Barcode App` page. 3- Select `Destination Location` to be `After group of products`. 4- Activate the checkbox `Force a destination for all products`. 5- Create a receipt and validate it in Barcode App without scanning a destination location. = Validation is accepted. However you shouldn't be able to validate unless you scan a destination location. Forward-Port-Of: odoo/enterprise#94781
12 changes
Enhancements to existing features
The self-ordering flow now helps customers jump directly to any required product option they missed before adding an item or combo. This reduces confusion during ordering and can help customers complete purchases more smoothly.
Original PR description
In this commit: ---------- - We are introducing a feature where the user will be redirected to the missing required attribute on the click of the arrow button at last of the product page/combo page. task-4886023
Resolved issues and error corrections
The AI service now handles invalid tool requests and usage limits more clearly instead of failing silently. This helps conversations recover from errors, avoids stalled responses, and keeps final answers cleaner for users.
Original PR description
This commit introduces several related fixes to the LLM API service to make tool call processing more robust and prevent silent failures. - **Unknown Tool Calls**: When an LLM requests a tool with an…
This commit introduces several related fixes to the LLM API service to make tool call processing more robust and prevent silent failures. - **Unknown Tool Calls**: When an LLM requests a tool with an invalid or unknown name, it previously resulted in an empty response, causing the conversation to stall. This change ensures that a proper error message is now returned to the LLM for the invalid tool call. This allows the LLM to process the failure and continue the conversation. - **Failing on Limits**: The query processing loop in `_request_llm` has limits for both successive API calls and the number of tool calls per request. Previously, these limits would be reached silently. - **API Call Limit**: If the `AI_MAX_SUCCESSIVE_CALLS` limit is reached without the LLM providing a final answer, a `ValueError` is now raised. This prevents silent failures and makes it clear to the calling code that the request could not be completed. - **Tool Call Limit**: If the number of tool calls in a single response exceeds `AI_MAX_TOOL_CALLS_PER_CALL`, any calls beyond the limit are now provided with a result stating that the limit was reached. This gives the LLM the opportunity to try the unprocessed tool calls again in a subsequent turn. - **Ignore Explanatory Text**: The text that LLMs often include alongside a tool call request (the "thinking" text) is now ignored to provide a cleaner and more concise final response to the user.
Point of Sale now prevents two users or sessions from creating separate invoices for the same order at the same time. If invoicing is already underway, the user sees an error, and if an invoice already exists, the system opens it instead of creating another one.
Original PR description
This fix prevents multiple users from generating separate invoices for the same POS order simultaneously. Steps to reproduce: 1. Create a new POS order. 2. Open two tabs (or two POS sessions). 3. Generate an invoice in the first tab. 4. Immediately try to generate an invoice in the second tab. 5. Two invoices will be generated. With this fix: - If a user attempts to generate an invoice while another is already in progress, an error message is shown. - If the invoice has already been generated, the existing invoice view is opened instead of creating a duplicate. opw-5004504 Forward-Port-Of: odoo/odoo#223845
This update fixes two time off request issues: users can now clear an end date without triggering an error, and edited leave dates use the correct employee work schedule. It also improves the related calendar calculation performance, helping leave requests stay accurate when contracts or schedules change.
Original PR description
Bug 1 - traceback on removing end date
Steps to reproduce:
- open the time off request form
- remove the end date
Cause:
- bool comparison with date
Fix:
- add a check before using the request_date_from or request_date_to
Bug 2 - inappropriate resource calendar use
Steps to reproduce:
- Create two different version with different working calendar.
- now while creating leave record it uses correct resource calendar as per
request dates.
- but after saving the leave record, if try to change the request dates
it does not use correct resource calendar.
Cause:
- resource calendar compute method is not dependent on request dates.
Fix:
- updated the depends of compute method.
moreover refactored the method to improve the performance.
task-4965122
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#220313Bill matching no longer fails when a purchase order and vendor bill use the same individual contact linked to a company. Odoo now consistently matches the vendor through the parent company, preventing errors and helping purchasing teams process bills without interruption.
Original PR description
**Issue** When both a Purchase Order and a Vendor Bill are created using the same individual contact linked to a company, Bill Matching fails with a traceback. **Steps to Reproduce** 1. Create an…
**Issue** When both a Purchase Order and a Vendor Bill are created using the same individual contact linked to a company, Bill Matching fails with a traceback. **Steps to Reproduce** 1. Create an individual contact and link it to a company. 2. Create a Purchase Order with the individual as a vendor. 3. Create a Vendor Bill with the same individual as the vendor. 4. Try to perform Bill Matching. 5. A `ValueError: Expected singleton: res.partner(...)` is raised. Video for reference: https://drive.google.com/file/d/1qVnPLpk8jyMTKz-6AVLSaN2nVVeWiF4y/view **Root Cause** Purchase Orders store the partner exactly as selected (the individual contact), while Vendor Bills are normalized internally to the parent company (`commercial_partner_id`). This creates a mismatch in the Bill Matching logic, where records reference both the individual and the company, leading to an invalid recordset and the singleton error. **Fix** Always normalize vendors to their `commercial_partner_id` during Bill Matching. This ensures that both Purchase Orders and Vendor Bills consistently reference the same partner, avoiding mismatches between individual contacts and their parent company. Opw-5050339 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#226130
The salary configurator now presents currency amounts and employer cost details more consistently, making contract offers easier to read. It also fixes a Belgian salary calculation display issue so part-time gross salary information keeps all required values instead of losing details.
Original PR description
The salary configurator had several UI inconsistencies that impacted the readability of contract offers:
- Replaced complex input-group styling with flexbox layout in resume_sidebar.xml to properly align currency symbols and values using Bootstrap's fs-5 and fw-normal classes
- Added align-items-center and justify-content-end for consistent spacing
- Changed tuple reconstruction in main.py to use (_('Gross (Part Time)'), *salary_tuple[1:]) to preserve all salary_tuple values (positions 1-5) instead of truncating to only first 3 elements
task-5063224Manufacturing backorders now keep earlier operations in the correct cancelled state instead of incorrectly changing them to in progress after later work is completed. This helps production teams avoid misleading work order statuses and better track what still needs action.
Original PR description
In this bug, in backorder created for later work opertions, the `state` of initial operation is changed to `progress` after, the backorder is `done`. To produce the bug: 1- Create a Bill of Materials with at least two operations at two work centers 2- Create a manufacturing order and confirm it. 3- Complete the first operation and edit the quantity on the second operation so there is a backorder for the remaining quantity 4- In the second work order, the first operation initially appears as `Cancelled`. Once the second operation is completed, it will change to `In progress`. opw-4931653 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#222075
Chilean electronic supplier bills now import certain exempt lines as negative amounts when the official document marks them that way. This prevents overstatement of vendor bill totals and improves compliance with Chilean electronic invoicing rules.
Original PR description
### Issue: When, in a DTE file, a line has the code 6 in `IndExe`. The amount of the line is supposed to be negative. (See the [doc](https://www.sii.cl/factura_electronica/formato_dte.pdf) page 31/32) ### Steps to reproduce: - Install 'l10n_cl_edi' and switrch to a Chilean company - Have a DTE file with a line having '6' in `IndExe`: - In Accounting > Vendor > Bills, click the button "Upload" and select the DTE file - The imported move has positive values on the every lines ### Cause: The values of `IndExe` are not considered. ### Solution: Add a condition changing the sign of `price_unit` when 6 is in `IndExe` opw-4954723 Forward-Port-Of: odoo/enterprise#95405 Forward-Port-Of: odoo/enterprise#93393
When no receipt printer is connected, self-order payments now send the order to the preparation display before showing the browser print prompt. This prevents staff from missing or waiting on paid orders because a print dialog was left open in another tab.
Original PR description
Steps to reproduce: ------------------- 1. Enable self orderdering, and set an online payment method 2. Open 3 tabs: the main PoS one, the self order one, and the preparation display one (we have to…
Steps to reproduce: ------------------- 1. Enable self orderdering, and set an online payment method 2. Open 3 tabs: the main PoS one, the self order one, and the preparation display one (we have to setup the prep display too) 3. In the self order tab, make an order and pay for it Observe that in the main tab, a receipt modal (window.print) appears, and the order is not sent to the payment display (on the third tab) until we either dismiss or accept the printing popup on the main tab. Reason: ------- If there is no printing device connected, we fallback to printing the receipt with `window.print`; this operation blocks the execution of the code that follows it, in our case sending the order to the preparation display, until we either dismiss or confirm the printing popup. Now if the user is not paying attention to the main tab (only looking at the preparation display for instance), the order will not appear in the prep display. Fix: ---- In the case of fallbacking to web printing, we execute the print in a `setTimeout`, so to not block the code that comes after it. opw-5039685 Forward-Port-Of: odoo/odoo#225742
This fixes an accounting display issue where cash basis journal item lines could show '/' instead of the actual posted journal entry name. The change ensures related fields are recalculated after the entry number is assigned, so users see accurate journal entry references in accounting lists.
Original PR description
### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if the move is posted and has a name. ### Steps to reproduce: - Activate Cash Basis in the accounting…
### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if the move is posted and has a name. ### Steps to reproduce: - Activate Cash Basis in the accounting settings - Create a tax with "Tax Exigibility" set "Based on Payment" - Set the "Cash Basis Transition Account" to "Current Assets" - Activate reconciliation on "Current Assets" - Create an invoice with this tax, confirm - In the dashboard, click on Bank and new - Set the name of the invoice as the label, and the amount of the invoice as amount - Save & Close - Go in Accounting > Transactions > Journal Items - The lines created for the cah basis entry display '/' in the column "Journal Entry" ### Cause: This issue is linked to the order in which things are done in `_set_next_sequence`: the fields triggered by the sequence field are added in `self.env.transaction.tocompute` then the sequence is computed and assigned. When `_set_next_sequence()` is called from [`_create_tax_cash_basis_moves()`](https://github.com/odoo/odoo/blob/849e4a87178d8c8588b75e3f7d9073d6a78326f9/addons/account/models/account_partial_reconcile.py#L649-L654) this order is problematic as `account.move.line.move_name` will be computed and removed from `self.env.transaction.tocompute`. So it will not be updated when the sequence is assigned in `account.move.name`. The callstack is something like this: - `_set_next_sequence()` calls `_locked_increment()` to compute the sequence - `_locked_increment()` calls `flush_recordset()` which will call `_recompute_recordset()` to recompute all fields - `_compute_invoice_date_due()` needs the field `needed_terms` triggering `_compute_needed_terms()` - `_compute_needed_terms()` needs `invoice_line_ids` - the fetch on `account.move.line` is ordered by `move_name` - So `_compute_related()` is triggered for `move_name` and `account.move.line.move_name` is removed from `self.env.transaction.tocompute` Then `_locked_increment()` returns the sequence, it gets assigned as the move name and `move_name` is never updated because it's not in `self.env.transaction.tocompute`. This doesn't occur in other flows (like calling `action_post()`) because the value of `needed_terms` is read from the cache. ### Solution: Swap the order in which things are done in `_set_next_sequence()`: first compute and assign the sequence and then add the triggered fields in `self.env.transaction.tocompute` so that they are computed afterwards. It seems more logic that way: we change the `_sequence_field` then mark all fields that will be impacted in `tocompute`. opw-5056938 Forward-Port-Of: odoo/odoo#225558
This fix ensures cash basis journal item lines show the correct journal entry name instead of a placeholder slash. It helps accounting users see accurate transaction references in Journal Items and adds test coverage to prevent the issue from returning.
Original PR description
This commit adds a test for the [change made in community](https://github.com/odoo/odoo/pull/225558). ### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if…
This commit adds a test for the [change made in community](https://github.com/odoo/odoo/pull/225558). ### Issue: In the list view of Journal Items, cash basis lines show a `move_name` of '/' event if the move is posted and has a name. ### Steps to reproduce: - Activate Cash Basis in the accounting settings - Create a tax with "Tax Exigibility" set "Based on Payment" - Set the "Cash Basis Transition Account" to "Current Assets" - Activate reconciliation on "Current Assets" - Create an invoice with this tax, confirm - In the dashboard, click on Bank and new - Set the name of the invoice as the label, and the amount of the invoice as amount - Save & Close - Go in Accounting > Transactions > Journal Items - The lines created for the cah basis entry display '/' in the column "Journal Entry" ### Cause: This issue is linked to the order in which things are done in `_set_next_sequence`: the fields triggered by the sequence field are added in `self.env.transaction.tocompute` then the sequence is computed and assigned. When `_set_next_sequence()` is called from [`_create_tax_cash_basis_moves()`](https://github.com/odoo/odoo/blob/849e4a87178d8c8588b75e3f7d9073d6a78326f9/addons/account/models/account_partial_reconcile.py#L649-L654) this order is problematic as `account.move.line.move_name` will be computed and removed from `self.env.transaction.tocompute`. So it will not be updated when the sequence is assigned in `account.move.name`. The callstack is something like this: - `_set_next_sequence()` calls `_locked_increment()` to compute the sequence - `_locked_increment()` calls `flush_recordset()` which will call `_recompute_recordset()` to recompute all fields - `_compute_invoice_date_due()` needs the field `needed_terms` triggering `_compute_needed_terms()` - `_compute_needed_terms()` needs `invoice_line_ids` - the fetch on `account.move.line` is ordered by `move_name` - So `_compute_related()` is triggered for `move_name` and `account.move.line.move_name` is removed from `self.env.transaction.tocompute` Then `_locked_increment()` returns the sequence, it gets assigned as the move name and `move_name` is never updated because it's not in `self.env.transaction.tocompute`. This doesn't occur in other flows (like calling `action_post()`) because the value of `needed_terms` is read from the cache. ### Solution: Swap the order in which things are done in `_set_next_sequence()`: first compute and assign the sequence and then add the triggered fields in `self.env.transaction.tocompute` so that they are computed afterwards. It seems more logic that way: we change the `_sequence_field` then mark all fields that will be impacted in `tocompute`. opw-5056938 Forward-Port-Of: odoo/enterprise#94111
Website pages with an SEO cover image could fail to load when a website domain was configured. The fix stores the cover image as a relative link, preventing server errors and keeping shared page previews working reliably.
Original PR description
Scenario: - in 19.0 add a website_meta_og_img (Website > Editor > Site > Optimize SEO > Cover Image) - set a domain on the website - go to the page with the cover image Result: an error 500 with this…
Scenario:
- in 19.0 add a website_meta_og_img (Website > Editor > Site > Optimize
SEO > Cover Image)
- set a domain on the website
- go to the page with the cover image
Result: an error 500 with this traceback error:
```py
File "addons/website/models/mixins.py", line 92, in get_website_meta
opengraph_meta['og:image'] = url_join(root_url, self.env['ir.http']
._url_for(self.website_meta_og_img or opengraph_meta['og:image']))
File "odoo/tools/urls.py", line 59, in urljoin
raise ValueError("Extra URL must use same scheme and host as base,
and begin with base path")
```
Cause: since 19.0 977e62d91f3e8235e251e9d21b08f53db1856c6b werkzeug
url_join is replaced by odoo urljoin, which requires that the path that
is appended has no host, or the same host. Since the current code saves
the scheme and host of the website_meta_og_img, if the URL is different
than the saved one (because of domain or another reason), we get an
error.
Fix: save a relative URL instead of an absolute one.
opw-5101875
opw-5102079
opw-5105258
opw-5107443
opw-5111474
opw-5112343
opw-5113844
opw-5114544
__Note:__ I rebased on 17.0 since the code has not changed since then, the problem just become visible because of the urljoin change.
__Note:__ I created a upgrade PR to fix the issue for migrated database https://github.com/odoo/upgrade/pull/8494
Forward-Port-Of: odoo/odoo#2282532 changes
Resolved issues and error corrections
This fix ensures online shop orders keep the correct pricelist when a shopper signs in or creates an account without an address. It uses the shopper’s GeoIP country during price list selection, preventing customers from being assigned pricing meant for another region.
Original PR description
Versions -------- - 17.0+ Steps ----- 1. Have GeoIP enabled/mocked; 2. have at least 2 pricelists available in eCommerce; 3. have all pricelists restricted to a certain country group; 4. have the 1st…
Versions -------- - 17.0+ Steps ----- 1. Have GeoIP enabled/mocked; 2. have at least 2 pricelists available in eCommerce; 3. have all pricelists restricted to a certain country group; 4. have the 1st pricelist be incompatible w/ the current GeoIP location; 5. open a cart as a public user; 6. check pricelist in back-end (should be correct); 7. go to "Sign In" & create a new portal account without address; 8. check pricelist in back-end (should still be correct); 9. go back to cart with portal account; 10. check pricelist in back-end. Issue ----- The first pricelist is assigned to the order, which shouldn't be compatibly with the partner's current GeoIP location. Cause ----- The pricelist is recomputed on changing the `partner_id` on a sale order. Commit 6504c0624b990 added a check on the `country_code` context value when retrieving the `property_product_pricelist` for a partner. This context value is currently not getting added during `_compute_pricelist_id`. Because all pricelists are restricted to a country group, when the pricelist gets recomputed on `partner_id` change, there's no location-independent pricelist to fall back on, which is why the first pricelist is used regardless of country restrictions. Solution -------- Add a `_compute_pricelist_id` override which adds the current GeoIP country code to the context when computing the field for website orders. opw-5000198 Forward-Port-Of: odoo/odoo#225582
Support Document Credit Notes in Colombia now consistently use the required internal reference format for product identification. This prevents DIAN validation error NSAZ13 and reduces the risk of rejected documents when products also have barcodes or UNSPSC codes configured.
Original PR description
Before this PR:
- Support Document Credit Notes sent barcode (scheme 010) when available, causing DIAN `NSAZ13` error and document rejection.
After this PR:
- Although a product has all of these 3 fields configured (barcode, UNSPSC, internal reference), still, for a Support Document Credit Note, the `cac:StandardItemIdentification` is always sent with the Internal Reference information ('999', 'Estándar de adopción del contribuyente').
- If internal reference is not configured, then barcode or UNSPSC code is sent with scheme ('999', 'Estándar de adopción del contribuyente').
task-4796034