Daily updates from Odoo
Monday, July 27, 2026
23 changes · 18.0
Enhancements to existing features
Current behavior before PR: Threads couldn't be recognized by reading messages in the chat but only in the channel list. Desired behavior after PR is merged: As in 19.0, when a thread (sub-channel) has been created from a message in a channel, the originating message displays a preview card below it showing the thread name, last message preview, author prefix, and timestamp. This backports that feature to 18.0 by: - Adding an 'after-reactions' extension slot to the mail.Message template
Original PR description
Current behavior before PR: Threads couldn't be recognized by reading messages in the chat but only in the channel list. Desired behavior after PR is merged: As in 19.0, when a thread (sub-channel) has been created from a message in a channel, the originating message displays a preview card below it showing the thread name, last message preview, author prefix, and timestamp. This backports that feature to 18.0 by: - Adding an 'after-reactions' extension slot to the mail.Message template - Adding a new SubChannelPreview component that renders the thread preview card (sub_channel_preview.js/xml/scss) - Patching the Message component to render SubChannelPreview after reactions when message.linkedSubChannel exists and is not the current thread (message_patch.js/xml/scss) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This PR replaces the "ting" notification sound with a more pleasant and common notification sound. If Odoo's Discuss is used as a main communication method within an organization, the notification sound is important. It should be a pleasant sound so that users don't receive it as unpleasant and may disable it eventually. At the same time the sound should be clear and not too low so that it doesn't get overlooked easily. The "ting" sound can received as too rough. In future Odoo versions "t
Original PR description
This PR replaces the "ting" notification sound with a more pleasant and common notification sound. If Odoo's Discuss is used as a main communication method within an organization, the notification sound is important. It should be a pleasant sound so that users don't receive it as unpleasant and may disable it eventually. At the same time the sound should be clear and not too low so that it doesn't get overlooked easily. The "ting" sound can received as too rough. In future Odoo versions "ting" has been replaced by "dm_02" in #186944 which is not clear enough and could be overlooked. The sound introduced by this PR aligns more with other messenger and chat systems and has a pleasant, short and clear sound. Alternatively to replacing the sound file we could add it as a new sound file and use it as the default for Discuss. Let me know if you prefer that. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
Customer follow-up reports now exclude invoices that have already been fully paid, even when they were paid as part of a grouped payment. This prevents customers from seeing settled invoices as still outstanding and makes follow-up communications more accurate.
Original PR description
Steps to reproduce: - Configure a bank journal with Outstanding Receipts/Payments accounts - Create two customer invoices for the same partner (e.g. 1000 and 2000) - Select both, Register Payment,…
Steps to reproduce: - Configure a bank journal with Outstanding Receipts/Payments accounts - Create two customer invoices for the same partner (e.g. 1000 and 2000) - Select both, Register Payment, enable Group Payments, pay 1500 so that the first invoice is fully paid and the second remains partially paid (1500 due) - Validate and reconcile the payment, then open the Customer Follow-up Report Issue: The fully paid invoice still shows up in the Follow-up Report, alongside the partially paid one. Cause: The report's 'unreconciled' domain (account.report. _get_options_unreconciled_domain) filters on full_reconcile_id, which is set per matching-number group rather than per line: when several invoices are settled together through a grouped payment, they all share the same matching number, and the group only gets a full_reconcile_id once *every* line in it is fully paid. Since the second invoice is still open, the group stays without a full_reconcile_id, so the first invoice is wrongly treated as unreconciled too, even though its own residual amount is zero. Fix: Override _get_aml_values on the Follow-up report handler to drop lines that are individually reconciled (amount_residual = 0), instead of relying on the group-level full_reconcile_id. The generic unreconciled domain is left untouched since Partner Ledger and Aged Receivable also rely on it and may depend on keeping partially settled matching groups grouped together. opw-6323401
Ecuador branch users can now create customer invoices without being blocked by an access error. The fix avoids requiring direct access to the parent company when checking the journal’s country, keeping normal accounting workflows working in branch setups.
Original PR description
Steps to reproduce: - Install `l10n_ec` module - Create one branch of the EC company - Give user(not admin) access to company branch and login with user - Go to Accounting > Customers > Invoices - Click New > AccessError Cause: This error occurs because the user is working within a branch of the main company. The code tries to access the journal’s company, which is set to the parent company. As the user does not have access to the parent company, fetching the country code fails. Solution: In some cases, strict company access rules cause `AccessError` and block normal flows, especially with parent–child company setups where a child needs data from the parent. To ensure smooth processing, we use a related field on the journal to retrieve the country code without directly accessing the company. opw-6087460
This fix prevents Swiss payroll ELM transmission from failing when a related payroll rule has been archived. It helps HR teams continue payroll reporting without unexpected errors caused by inactive configuration records.
Original PR description
Forward-Port-Of: odoo/enterprise#103677
Ri.Ba. payment validation now accepts San Marino IBANs as well as Italian IBANs, preventing valid batch payments from being blocked. The payment file generation was also adjusted to keep San Marino records within the required format length.
Original PR description
**_Steps to reproduce :_** - Install l10n_it_riba. - Configure a company with a San Marino (SM) IBAN as the bank account for the journal used for Ri.Ba. - Create a customer payment and add it to a…
**_Steps to reproduce :_** - Install l10n_it_riba. - Configure a company with a San Marino (SM) IBAN as the bank account for the journal used for Ri.Ba. - Create a customer payment and add it to a Batch Payment using the Ri.Ba. payment method. - Validate the Batch Payment. **_Observed behavior :_** The validation fails with the error: `Only bank accounts with an Italian IBAN are allowed to use Ri.Ba. payments` **_Cause :_** The Ri.Ba. validation logic only accepts IBANs with the IT country code and incorrectly rejects valid San Marino (SM) IBANs. **_Fix :_** - Update the Ri.Ba. IBAN validation to accept both Italian (IT) and San Marino (SM) IBANs when generating Ri.Ba. payment files. - While validating Batch Payments for SM IBANs, we observed that the extracted value could overlap with the branch code portion, causing the generated RIBA record to exceed the expected 120-character length. This change updates the extraction logic to prevent overlap and ensure compliance with the required record format. **_opw_** - 6303820
This fixes where Mexican CFDI invoice fields are placed so they no longer disappear when Colombian electronic invoicing is also installed. It ensures users can reliably see and use the CFDI Origin field on Mexican invoices regardless of other localization modules.
Original PR description
The CFDI fields used //sheet/group//group[last()], which targets the last group by position. Once l10n_co_edi adds its group after header_right_group, the fields land in it instead, and it is invisible unless country_code is CO, so CFDI Origen disappears on MX invoices. Use //group[@id='header_right_group'], like l10n_co_edi already does, so placement no longer depends on what modules are installed. Task Adhoc side: 67269 Forward-Port-Of: odoo/enterprise#124545
Before this commit, the down payments line of the project profitability panel had no drill down action for salespersons and billing users without accounting access, because the group references were written with a trailing comma inside the XML id, making the two checks silently fail for everyone. Only the accounting read group check, written correctly, was effective. Steps to reproduce: - create a service product with "Create on Order: Project & Task", sell it on a sale order and confirm it
Original PR description
Before this commit, the down payments line of the project profitability panel had no drill down action for salespersons and billing users without accounting access, because the group references were…
Before this commit, the down payments line of the project profitability panel had no drill down action for salespersons and billing users without accounting access, because the group references were written with a trailing comma inside the XML id, making the two checks silently fail for everyone. Only the accounting read group check, written correctly, was effective. Steps to reproduce: - create a service product with "Create on Order: Project & Task", sell it on a sale order and confirm it - create a down payment invoice from the sale order and post it - create a user with Sales "User: All Documents" access, Project "User" access and no accounting access - as that user, open the dashboard of the generated project and look at the Down Payments line of the profitability panel The Down Payments amount is displayed as plain text, while a user with accounting access can click it to open the related invoices, as intended for the salesperson too. Solution: Move the commas out of the group references. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
When running `ŧest_free_reservation`, it could happen on very rare occasions that both moves would be created at a different second. In such cases, the test would fail. Since we want to test the case with *exact* same dates, we can't use `assertAlmostEqual` which is usually better for dates. Instead, we freeze the time for the duration of the creation / assignation. runbot-944453 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of:
Original PR description
When running `ŧest_free_reservation`, it could happen on very rare occasions that both moves would be created at a different second. In such cases, the test would fail. Since we want to test the case with *exact* same dates, we can't use `assertAlmostEqual` which is usually better for dates. Instead, we freeze the time for the duration of the creation / assignation. runbot-944453 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#278103
Steps to reproduce: - Install `l10n_cl` module - Create one branch of the CL company - Give user(not admin) access to company branch and login with user - Go to Accounting > Customers > Invoices - Click New > AccessError Cause: This error occurs because the user is working within a branch of the main company. The code tries to access the journal’s company, which is set to the parent company. As the user does not have access to the parent company, fetching the country code fails. Solu
Original PR description
Steps to reproduce: - Install `l10n_cl` module - Create one branch of the CL company - Give user(not admin) access to company branch and login with user - Go to Accounting > Customers > Invoices - Click New > AccessError Cause: This error occurs because the user is working within a branch of the main company. The code tries to access the journal’s company, which is set to the parent company. As the user does not have access to the parent company, fetching the country code fails. Solution: In some cases, strict company access rules cause `AccessError` and block normal flows, especially with parent–child company setups where a child needs data from the parent. To ensure smooth processing, temporary `sudo()` usage is required in specific places. opw-6087460
Seven entries of the Mexican chart of accounts template carry a name belonging to a **different** group, copied from a neighbouring entry. Each record's XML ID still states the intended name, which is what this restores. | Code | Field | Before | After | |---|---|---|---| | `6` | `name@es` | Gastos generales | Gastos | | `252.07` | `name@es` | `account_subgroup_hipotecas_por_pagar_a_largo_plazo_nacional` | Hipotecas por pagar a largo plazo nacional | | `602` | `name`, `name@es` | Cost of sales
Original PR description
Seven entries of the Mexican chart of accounts template carry a name belonging to a **different** group, copied from a neighbouring entry. Each record's XML ID still states the intended name, which…
Seven entries of the Mexican chart of accounts template carry a name belonging
to a **different** group, copied from a neighbouring entry. Each record's XML ID
still states the intended name, which is what this restores.
| Code | Field | Before | After |
|---|---|---|---|
| `6` | `name@es` | Gastos generales | Gastos |
| `252.07` | `name@es` | `account_subgroup_hipotecas_por_pagar_a_largo_plazo_nacional` | Hipotecas por pagar a largo plazo nacional |
| `602` | `name`, `name@es` | Cost of sales / Costo de venta | Selling expenses / Gastos de venta |
| `613` | `name@es` | Amortización contable | Depreciación contable |
| `614` | `name` | Accounting depreciation | Accounting amortisation |
| `701.06` | `name`, `name@es` | Interest on foreign bank charges / Intereses a cargo bancario extranjero | Interest payable by national natural persons / Intereses a cargo de personas físicas nacional |
| `702` | `name@es` | Utilidad cambiaria | Productos financieros |
### Why it is not cosmetic
The electronic accounting Chart of Accounts XML takes the `Desc` attribute of
every `<Ctas>` element from the *account group name* — `cfdicoa.xml`
(`t-att-Desc="account.get('name')"`), fed by `trial_balance.py`
`_l10n_mx_get_coa_values()`. Any `es_*` database therefore declares:
```xml
<catalogocuentas:Ctas CodAgrup="702" NumCta="702" Desc="Utilidad cambiaria" Nivel="1" Natur="A"/>
```
whereas the SAT catalogue (Anexo 24) publishes `702` as *Productos financieros*,
with `702.01 Utilidad cambiaria` … `702.10 Otros productos financieros` beneath
it. `CodAgrup` comes from `code_prefix_start` and stays correct, so the file
still validates against the XSD, but the declared description does not match the
official nomenclature. Trial Balance and Pólizas are unaffected — neither
exports group names.
### Evidence
- `252.07` contains its own XML ID as the Spanish name.
- `602` duplicates `501.01`, yet its children are `Sueldos y Salarios`,
`Compensaciones`, `Tiempos extras`.
- `613` and `614` are swapped in one language each: `613`'s children are
depreciations, `614`'s are amortisations.
- `701.06` duplicates `701.05` in both languages; the correct name is symmetric
to `701.07` and to `702.06`.
- `6` is the only single-digit root group whose Spanish name does not match its
XML ID (`account_group_gastos`).
### Notes
Introduced in d782b8b92557; correct in 15.0, where the names lived in
`account.account.tag.csv`. Still present in 18.0, 19.0 and master, hence
targeting 17.0. Template data only — existing databases are unaffected until the
chart is (re)installed, and renaming a group moves no balance.
Forward-Port-Of: odoo/odoo#277426`ref` already gives back a recordset if it found the reference. There is no need to research using the id on the same model, as `ref` calls `exists`, which already does the "same" query that's present here. Closes #137826 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#276554
Original PR description
`ref` already gives back a recordset if it found the reference. There is no need to research using the id on the same model, as `ref` calls `exists`, which already does the "same" query that's present here. Closes #137826 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#276554
## Steps to Reproduce: 1. Install the Sales and Studio modules. 2. Create a new menu for "**Sales Order Line**". 3. Open the menu in list view and group by "**Order**". 4. Sort by "**Order Reference**". ## Issue: Sale order lines appear to be sorted randomly when grouped by Order and sorted by Order Reference. ## Cause: When sorting on a many2one field, the `_order_field_to_sql()` method uses the comodel's default `_order` to generate the SQL query. - [1] Since `order_id` is a many
Original PR description
## Steps to Reproduce: 1. Install the Sales and Studio modules. 2. Create a new menu for "**Sales Order Line**". 3. Open the menu in list view and group by "**Order**". 4. Sort by "**Order…
## Steps to Reproduce: 1. Install the Sales and Studio modules. 2. Create a new menu for "**Sales Order Line**". 3. Open the menu in list view and group by "**Order**". 4. Sort by "**Order Reference**". ## Issue: Sale order lines appear to be sorted randomly when grouped by Order and sorted by Order Reference. ## Cause: When sorting on a many2one field, the `_order_field_to_sql()` method uses the comodel's default `_order` to generate the SQL query. - [1] Since `order_id` is a many2one on `sale.order.line` model, sorting by the `order_id` (Order Reference) also applies this default ordering of `sale.order` model, which is `date_order desc, id desc`. As a result, sale order lines are not ordered by SO name, but also by the corresponding sale order's order date. This ordering changes the order of the records, making the result appear random from the user's perspective, even though they explicitly sorted by Order Reference. ## Fix: This commit removes the `date_order` from the default ordering of the sale order and keeps only ordering by id. This prevents the sale order's order date (date_order) from affecting the ordering of sale order lines. This follows the same approach previously accepted for purchase orders. Task: https://www.odoo.com/odoo/project/49/tasks/2367965 PR: https://github.com/odoo/odoo/pull/60542 [1] - https://github.com/odoo/odoo/blob/16a1a545e2809a2172053f4db6193f425900e4ec/odoo/models.py#L5652-L5671 opw-6348322
Description of the issue this commit addresses: When a member of the Invoicing group tries to create a payment trough the L10nPlAccountPaymentRegister wizard, upon clicking "Create Payment", an AccessError is thrown. Invoicing group members should be able to handle payments so this is an issue. --- Steps to reproduce: 1. Make sure sale_management and l10n_pl_bank_verification are installed. 2. Create a new user with "Invoicing" Accounting group. 3. Create a new sales order with sai
Original PR description
Description of the issue this commit addresses: When a member of the Invoicing group tries to create a payment trough the L10nPlAccountPaymentRegister wizard, upon clicking "Create Payment", an…
Description of the issue this commit addresses: When a member of the Invoicing group tries to create a payment trough the L10nPlAccountPaymentRegister wizard, upon clicking "Create Payment", an AccessError is thrown. Invoicing group members should be able to handle payments so this is an issue. --- Steps to reproduce: 1. Make sure sale_management and l10n_pl_bank_verification are installed. 2. Create a new user with "Invoicing" Accounting group. 3. Create a new sales order with said user (any customer, any product) 4. Confirm the quotations and, from its form view, "Create Invoice". 5. Confirm the invoice and, from its form view, "Pay". 6. Upon clicking "Create Payment", an Access Error is thrown. --- Desired behavior after this commit is merged: This commit makes sure an Invoicing group member is able to create the payment withtout AccessErrors being thrown. --- task-none feedback from: https://github.com/odoo/odoo/pull/267992 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
`_get_belgian_cocontractant_note()` resolves the co-contractant fiscal position through chart_template.ref(), which uses env.company. The "Send invoices automatically" cron runs as the inactive OdooBot user, so env.company is OdooBot's default company, not the invoice's. That company can differ from the invoice's and even be archived, in which case ref() raises "IndexError: tuple index out of range" (parent_ids is empty for an archived company) Steps to reproduce: - Set the main company to a
Original PR description
`_get_belgian_cocontractant_note()` resolves the co-contractant fiscal position through chart_template.ref(), which uses env.company. The "Send invoices automatically" cron runs as the inactive OdooBot user, so env.company is OdooBot's default company, not the invoice's. That company can differ from the invoice's and even be archived, in which case ref() raises "IndexError: tuple index out of range" (parent_ids is empty for an archived company) Steps to reproduce: - Set the main company to a non-Belgian company, and invoice from another active Belgian company. - Move every active user off the main company and archive it - Send a Belgian 0% invoice through the cron. => IndexError: tuple index out of range in chart_template.ref opw-6398778 Forward-Port-Of: odoo/odoo#278326
### Issue before this commit: When importing an electronic invoice from SDI that is failing with an exception, the resulting account.move record was saved in the "Miscellaneous Operations" journal instead of the correct one (Vendor Bills), even though the move_type itself was correct. ### Steps to reproduce the issue: Pre steps: you need to have access to https://iap-services-test.odoo.com/odoo 1. Download Accounting and l10n_it 2. Go to Settings > Companies and set the VAT of IT company
Original PR description
### Issue before this commit: When importing an electronic invoice from SDI that is failing with an exception, the resulting account.move record was saved in the "Miscellaneous Operations" journal…
### Issue before this commit: When importing an electronic invoice from SDI that is failing with an exception, the resulting account.move record was saved in the "Miscellaneous Operations" journal instead of the correct one (Vendor Bills), even though the move_type itself was correct. ### Steps to reproduce the issue: Pre steps: you need to have access to https://iap-services-test.odoo.com/odoo 1. Download Accounting and l10n_it 2. Go to Settings > Companies and set the VAT of IT company the same as the one in the xml 3. Go to Settings > Italian Electronic Invoicing and select Test 4. Go into the code and insert an Exception inside the function _l10n_it_edi_import_invoice after self.move_type = move_type (or create any type of exception from the user interface) 5. Go to IAP service into IT EDI app and see that your company is there as user 6. Click into the record > receive move button > upload your xml > create 7. Go to your DB > Scheduled Actions > filter with IT > IT EDI: Receive invoices from the SdI > Run Manually 8. Go to Journal entries, remove the filter and find your imported bill 9. You can see it was inserted into the Miscellaneous Operations Journal instead of a Vendor Bill Journal ### Cause of the issue: The move is created inside a savepoint context manager, designed so that even if parsing fails, an empty move with the attachment still remains. The problem is that if the exception is raised, the savepoint rollback undoes everything that follows, but the journal was already determined before the correct move_type was known, leaving the move in the wrong default journal. ### Reason to introduce the fix: The fix is needed to ensure that, regardless of where parsing fails, the move's journal is correctly set even if an exception occurs so that it is possible to find the move in the correct section even if not imported correctly. opw-6397712 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#278111
Once a ZATCA invoice is posted, the "Reset to Draft" button is still shown on the form until the chain index is set on the move. In that window, a user can click it (or force it visible from Studio on an already-accepted invoice) and reset the move to draft, even though it has been -- or is about to be -- submitted to ZATCA. The invoice can then be resubmitted, breaking the ZATCA chain. Steps to reproduce: 1. Configure a SA company and set up ZATCA. 2. Create and post a customer invoice. 3
Original PR description
Once a ZATCA invoice is posted, the "Reset to Draft" button is still shown on the form until the chain index is set on the move. In that window, a user can click it (or force it visible from Studio on an already-accepted invoice) and reset the move to draft, even though it has been -- or is about to be -- submitted to ZATCA. The invoice can then be resubmitted, breaking the ZATCA chain. Steps to reproduce: 1. Configure a SA company and set up ZATCA. 2. Create and post a customer invoice. 3. On the posted invoice, click "Reset to Draft" -> the move becomes draft, while the ZATCA submission still goes through. Fix: - Add a user error on account.move.button_draft if the invoice has l10n_sa_chain_index set task-6208977 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#270766
odoo/odoo#155588 was a workaround to the lack of location permissions in the iOS app, skipping geolocation entirely for check in/out. Since odoo/mobile#118 added support for them, we can now revert that fix so iOS users get prompted for their location again. task-6279460 Forward-Port-Of: odoo/odoo#276934
Original PR description
odoo/odoo#155588 was a workaround to the lack of location permissions in the iOS app, skipping geolocation entirely for check in/out. Since odoo/mobile#118 added support for them, we can now revert that fix so iOS users get prompted for their location again. task-6279460 Forward-Port-Of: odoo/odoo#276934
# How to reproduce - Create an eLearning course - In Options, set "Show Course To" to Course Attendees - Add an attendee - Click on the "Go to website" smart button - Publish the course - Add content that is an image - Select a file & tile, then save # The issue In the mail sent to the attendee, the image is not displayed # Cause To display the image, the mail has a link to this route : https://github.com/odoo/odoo/blob/65dbcabcd243abf24d6d3c3788d2caff66485790/addons/web/controlle
Original PR description
# How to reproduce - Create an eLearning course - In Options, set "Show Course To" to Course Attendees - Add an attendee - Click on the "Go to website" smart button - Publish the course - Add content that is an image - Select a file & tile, then save # The issue In the mail sent to the attendee, the image is not displayed # Cause To display the image, the mail has a link to this route : https://github.com/odoo/odoo/blob/65dbcabcd243abf24d6d3c3788d2caff66485790/addons/web/controllers/binary.py#L185 However, it seems the request sent to the server via the mail client to retrieve the image does not keep the user session. We therefore try to see the image as the "Public user", which is forbidden since the visibility of the course is limited to attendees. # Proposed solution Add an access token in the image link.
The state_id field was not cleared when editing an address and switching to a country without states — the state selector reset visually, but the stale state_id was still saved to the backend. Steps to reproduce: 1. Add a product to the cart. 2. Go to checkout and edit the address, selecting a country that has states. 3. Edit the address again, now selecting a country without states. 4. Save and check the contact in the backend: state_id still holds the state from the previo
Original PR description
The state_id field was not cleared when editing an address and switching to a country without states — the state selector reset visually, but the stale state_id was still saved to the backend. Steps to reproduce: 1. Add a product to the cart. 2. Go to checkout and edit the address, selecting a country that has states. 3. Edit the address again, now selecting a country without states. 4. Save and check the contact in the backend: state_id still holds the state from the previous country. Solution: reset the state_id select options for the new country. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Code cleanup and technical improvements
Owl considers declared component props mandatory unless they are marked optional. The `required: true` flags therefore duplicate the default and add noise to the prop definitions. Remove those flags from `PlacesAutoComplete`, all four props remain mandatory. Forward-Port-Of: odoo/odoo#278562
Original PR description
Owl considers declared component props mandatory unless they are marked optional. The `required: true` flags therefore duplicate the default and add noise to the prop definitions. Remove those flags from `PlacesAutoComplete`, all four props remain mandatory. Forward-Port-Of: odoo/odoo#278562
Documentation and clarification updates
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Steps to reproduce the problem: * Create a SO line by code setting a specific unit price. * Modify afterwards the quantity. Result: The unit price is reset. Expected behavior: The unit price is kept. You can exercise it with this code in the shell: ```python from odoo import Command partner = env["res.partner"].create({"name": "Test partner"}) product = env["product.product"].create({"name": "Test product", "list_price": 60.0}) order = env["sale.order"].create( {
Original PR description
Steps to reproduce the problem: * Create a SO line by code setting a specific unit price. * Modify afterwards the quantity. Result: The unit price is reset. Expected behavior: The unit price is kept.…
Steps to reproduce the problem:
* Create a SO line by code setting a specific unit price.
* Modify afterwards the quantity.
Result: The unit price is reset.
Expected behavior: The unit price is kept.
You can exercise it with this code in the shell:
```python
from odoo import Command
partner = env["res.partner"].create({"name": "Test partner"})
product = env["product.product"].create({"name": "Test product", "list_price": 60.0})
order = env["sale.order"].create(
{
"partner_id": cls.partner.id,
"order_line": [Command.create({"product_id": cls.product.id, "price_unit": 100})],
}
)
print(order.order_line.price_unit) # It's 100
order.order_line.product_uom_qty = 2
print(order.order_line.price_unit) # It's 60!
```
This is because when the technical price is not set on SO line creation, the value is set on precompute as the unit price, thus being considered non manually modified, and consequently being reset.
It can be fixed setting a different value from the unit price. For not conflicting with any of the creation possible values, a high negative number is set.
@Tecnativa