Friday, February 21, 2025
37 changes · master
Enhancements to existing features
This update standardizes how bank statement CSV imports manage temporary database changes, making the process easier to maintain and more consistent. It also simplifies salary simulation rollback handling so trial calculations are fully discarded after running, reducing risk of unintended saved data.
Original PR description
### [IMP] account_bank_statement_import_csv: use savepoint() Use the savepoint object to import the data instead of custom SQL. The goal is to be able to find easily all savepoint usages and have them working in the same way. ### [IMP] hr_contract_salary: remove savepoint for simulation When simulating salary data, we want to rollback all that is done during the simulation. Since we commit just before trying to do the simulation, we can just rollback at the end instead of using savepoints. https://github.com/odoo/odoo/pull/198584
Resolved issues and error corrections
Odoo now returns more appropriate error statuses when requests fail, helping integrations and clients better understand what went wrong. This makes error handling clearer without changing core business workflows.
Original PR description
Historically Odoo always returned 400 as the default "4xx" http status code for when the customer screwed up. But 400 is actually reserved for when the http request is malformed, i.e. there was an…
Historically Odoo always returned 400 as the default "4xx" http status code for when the customer screwed up. But 400 is actually reserved for when the http request is malformed, i.e. there was an error while parsing the headers or the body (according strickly to Content-Type). The default go-to error for when the request is syntaxically valid but otherwise garbage is 422 - Unprocessable Entity. Access Denied uses 403 - Forbidden and not 401 - Unauthorized because 401 mandates the use of the `WWW-Authenticate` and `Authorization` headers which don't apply in Odoo. Missing Error uses 404 - Not Found and not 410 - Gone because Missing Error is not only used when trying to write on a deleted record, it also applies when trying to write on a record that never existed. Used the opportunity to visit some other places where we used 400 and to use a http error that is better indicated. See https://httpwg.org/specs/rfc9110.html#status.4xx for the latest specification of HTTP status codes. task-4284096
Miscellaneous changes
Since commit [6f06420e4a9443c52dc0cb427f8f55eb4aecabce](https://github.com/odoo/odoo/commit/6f06420e4a9443c52dc0cb427f8f55eb4aecabce), fields used in expressions in a view are automatically added to the view if not present originally. This allows all fields to be available in the expression editor for modifiers, which this commit is enabling. task-4481934 Forward-Port-Of: odoo/enterprise#79737 Forward-Port-Of: odoo/enterprise#79672
Original PR description
Since commit [6f06420e4a9443c52dc0cb427f8f55eb4aecabce](https://github.com/odoo/odoo/commit/6f06420e4a9443c52dc0cb427f8f55eb4aecabce), fields used in expressions in a view are automatically added to the view if not present originally. This allows all fields to be available in the expression editor for modifiers, which this commit is enabling. task-4481934 Forward-Port-Of: odoo/enterprise#79737 Forward-Port-Of: odoo/enterprise#79672
`test_knowledge_commands_tour` is currently disabled. Currently it is failing because the main paragraph element in the Composer was changed from `<p>` to `<div class="o-paragraph">`. This commit updates the tour to be compatible with the changes in the Composer, in hope to re-enable the test some day. runbot-task-114943 runbot-task-134158 Forward-Port-Of: odoo/enterprise#79669
Original PR description
`test_knowledge_commands_tour` is currently disabled. Currently it is failing because the main paragraph element in the Composer was changed from `<p>` to `<div class="o-paragraph">`. This commit updates the tour to be compatible with the changes in the Composer, in hope to re-enable the test some day. runbot-task-114943 runbot-task-134158 Forward-Port-Of: odoo/enterprise#79669
- Since this PR(https://github.com/odoo/enterprise/pull/77019) we were not able to settle open invoices in PoS anymore. - Now when the customer have an existing due and that due is not linked to any `pos.order` (like an open invoice), we can now settle it in PoS. To do this we redirect the user to the payment screen and pre-fill the amount to settle. - Add default `settle_product` & `deposit_product` for new `pos.config`. Also add these products for config for which session is in **Opening con
Original PR description
- Since this PR(https://github.com/odoo/enterprise/pull/77019) we were not able to settle open invoices in PoS anymore. - Now when the customer have an existing due and that due is not linked to any `pos.order` (like an open invoice), we can now settle it in PoS. To do this we redirect the user to the payment screen and pre-fill the amount to settle. - Add default `settle_product` & `deposit_product` for new `pos.config`. Also add these products for config for which session is in **Opening control** state. task-id: 4587306 Forward-Port-Of: odoo/enterprise#79605
The `rollback` decorator of `account_acountant` does not properly `release` its savepoint, leading to the subtransaction remaining present until the end of the current transaction (or a rollback to the start of the test). This is unlikely to trigger odoo/odoo#71395 (though not impossible as one of the savepoints is in a test) but it's still bad form and unnecessary: an explicit `close` will *rollback and release* the savepoint, so `savepoin()` can just be wrapped into a `closing()` which will
Original PR description
The `rollback` decorator of `account_acountant` does not properly `release` its savepoint, leading to the subtransaction remaining present until the end of the current transaction (or a rollback to the start of the test). This is unlikely to trigger odoo/odoo#71395 (though not impossible as one of the savepoints is in a test) but it's still bad form and unnecessary: an explicit `close` will *rollback and release* the savepoint, so `savepoin()` can just be wrapped into a `closing()` which will do that for us. For `web_gantt` the savepoint is closed but not on all paths (if `ValueError` is raised the savepoint is never rolled back let alone closed), the manual use is also rather unnecessary as we can just rollback around the relevant method call, none of the later mess interacts with the cursor / connection. Forward-Port-Of: odoo/enterprise#79797
We swap them to that we first have the deferred revenue report first, then the deferred expense report so that we have the same logical order as the Customer then Vendors menu items in the navbar. task-none Forward-Port-Of: odoo/enterprise#79917 Forward-Port-Of: odoo/enterprise#79790
Original PR description
We swap them to that we first have the deferred revenue report first, then the deferred expense report so that we have the same logical order as the Customer then Vendors menu items in the navbar. task-none Forward-Port-Of: odoo/enterprise#79917 Forward-Port-Of: odoo/enterprise#79790
See commits :-) Forward-Port-Of: odoo/enterprise#79743 Forward-Port-Of: odoo/enterprise#79264
Original PR description
See commits :-) Forward-Port-Of: odoo/enterprise#79743 Forward-Port-Of: odoo/enterprise#79264
Before this commit, when we clicked on the activity send tax report. It would result by opening the report at the current date instead of the date of the move. After this commit, the expected behaviour was to open the move of the tax closing. task-4583606 Forward-Port-Of: odoo/enterprise#79807 Forward-Port-Of: odoo/enterprise#79511
Original PR description
Before this commit, when we clicked on the activity send tax report. It would result by opening the report at the current date instead of the date of the move. After this commit, the expected behaviour was to open the move of the tax closing. task-4583606 Forward-Port-Of: odoo/enterprise#79807 Forward-Port-Of: odoo/enterprise#79511
Steps to reproduce the bug: - Create two storable products “P1” and “P2”: - Tracked by Serial Number - Create a quality control point: - Operation: Receipt - Control per: Quantity - Create a receipt: - 10 units of P1 - 10 units of P2 - Mark it as "To Do." - Open the detailed operation of P1: - Assign two SNs: - SN1 - SN2 - Save. - The “Quantity” field of the P1 move is updated to 2. - Mark the move of P1 as "Picked." - Validate the receipt. - The backorde
Original PR description
Steps to reproduce the bug:
- Create two storable products “P1” and “P2”:
- Tracked by Serial Number
- Create a quality control point:
- Operation: Receipt
- Control per: Quantity
- Create a receipt:
- 10 units of P1
- 10 units of P2
- Mark it as "To Do."
- Open the detailed operation of P1:
- Assign two SNs: - SN1 - SN2 - Save.
- The “Quantity” field of the P1 move is updated to 2.
- Mark the move of P1 as "Picked."
- Validate the receipt.
- The backorder wizard is triggered → Validate it.
Problem:
A wizard to process the quality check is triggered, but 12 quality checks (2 for P1 and 10 for P2) are loaded instead of only 2 for P1.
Expected Behavior:
Quality checks should only be triggered for picked moves
opw-4442564
Forward-Port-Of: odoo/enterprise#79810
Forward-Port-Of: odoo/enterprise#76478**Steps to reproduce:** - Use the `NL Company`; - Go to `External Identifiers` (via `Settings / Technical / Sequence & Identifiers`): - Remove `l10n_nl.tax_report_rub_3bg_tag` and/or `l10n_nl.tax_report_rub_3bg_tag` identifiers;  - Try to access `EC Sales List` (via `Accounting / Reporting / Statement Reports`). ___ **Issue:** Can't access `EC Sales List` o
Original PR description
**Steps to reproduce:** - Use the `NL Company`; - Go to `External Identifiers` (via `Settings / Technical / Sequence & Identifiers`): - Remove `l10n_nl.tax_report_rub_3bg_tag` and/or…
**Steps to reproduce:**
- Use the `NL Company`;
- Go to `External Identifiers` (via `Settings / Technical / Sequence & Identifiers`):
- Remove `l10n_nl.tax_report_rub_3bg_tag` and/or `l10n_nl.tax_report_rub_3bg_tag` identifiers;

- Try to access `EC Sales List` (via `Accounting / Reporting / Statement Reports`).
___
**Issue:**
Can't access `EC Sales List` of the Dutch company after deleting any or both of the `l10n_nl.tax_report_rub_3bg_tag` and/or `l10n_nl.tax_report_rub_3bg_tag` identifiers.

___
**Expected:**
Users should be able to access `EC Sales List` even when an identifier is deleted as there is a fallback.

___
**Cause:**
The fallback doesn't refer to the good tax options.
https://github.com/odoo/enterprise/blob/b2368558afdf922fdf04bdcfa8a98b4e690ddccd/l10n_nl_intrastat/models/account_sales_report.py#L82-L84

___
**Fix:**
Adapt the fallback references' module for retrieval as done for testing in: https://github.com/odoo/enterprise/blob/b2368558afdf922fdf04bdcfa8a98b4e690ddccd/l10n_nl_intrastat/tests/test_sales_report.py#L22-L24
___
opw-4425376
Forward-Port-Of: odoo/enterprise#78314
Forward-Port-Of: odoo/enterprise#76366clipboard_macros.js : use hoot action instead of action implemented in web/core/macro.js (The goal is to definitly remove this actions from macro.js) tour_shopfloor.js : Ensure body has not visible modal (and not just modal) preparation_display_tour.js : WaitRequest after clickOrderButton. tour_shopfloor.js : additional step to ensure state of DOM. tour_test_mrp_barcode_flows.js : additional step to ensure state of DOM. No need to click on the input when use edit() action.
Original PR description
clipboard_macros.js : use hoot action instead of action implemented in
web/core/macro.js (The goal is to definitly remove this actions
from macro.js)
tour_shopfloor.js : Ensure body has not visible modal (and not just
modal)
preparation_display_tour.js : WaitRequest after clickOrderButton. tour_shopfloor.js : additional step to ensure state of DOM. tour_test_mrp_barcode_flows.js : additional step to ensure state of DOM.
No need to click on the input when use edit() action. edit() already
click in input to focus it.
export_tours.js : additional step to ensure state of DOM. helpdesk_knowledge_template_bloc_tour.js : No need to click when the
step is just a DOM check.
website_sale_change_rental_duration.js : additional step to ensure
state of DOM.
Forward-Port-Of: odoo/enterprise#79755
Forward-Port-Of: odoo/enterprise#79358Currently, if two taxes in Odoo database matche Avatax name, it will apply both of them on the invoice line therefore duplicating this tax amount on this line. Now we only take the first tax found in database. opw-4493544 Forward-Port-Of: odoo/enterprise#79695
Original PR description
Currently, if two taxes in Odoo database matche Avatax name, it will apply both of them on the invoice line therefore duplicating this tax amount on this line. Now we only take the first tax found in database. opw-4493544 Forward-Port-Of: odoo/enterprise#79695
Before this commit, the test was relying in "today's" date for creating the recurring invoices. Since the time period for generating them was too short, the expected deliveries were not being generated. After this commit, we give a fixed date to the start date of the subscriptions and then generate the recurring invoices with a time distance of a month, solving the issue. Issue-from: OPW-4166852 Related PR: odoo/enterprise#73397 Forward-Port-Of: odoo/enterprise#78300 Forward-Port-Of: odo
Original PR description
Before this commit, the test was relying in "today's" date for creating the recurring invoices. Since the time period for generating them was too short, the expected deliveries were not being generated. After this commit, we give a fixed date to the start date of the subscriptions and then generate the recurring invoices with a time distance of a month, solving the issue. Issue-from: OPW-4166852 Related PR: odoo/enterprise#73397 Forward-Port-Of: odoo/enterprise#78300 Forward-Port-Of: odoo/enterprise#76336
The Bookkeeper should be allowed to create modify and remove the asset as requested - I have edited the security file in asset model making it group_account_user task-4567264 Forward-Port-Of: odoo/enterprise#79106
Original PR description
The Bookkeeper should be allowed to create modify and remove the asset as requested - I have edited the security file in asset model making it group_account_user task-4567264 Forward-Port-Of: odoo/enterprise#79106
Previously, in RTL mode, sidebar resizing calculations were incorrect, causing the sidebar to not follow the mouse properly resulted in incorrect resizing. This fix ensures accurate resizing behavior. Task-4571290 Forward-Port-Of: odoo/enterprise#79568 Forward-Port-Of: odoo/enterprise#79379
Original PR description
Previously, in RTL mode, sidebar resizing calculations were incorrect, causing the sidebar to not follow the mouse properly resulted in incorrect resizing. This fix ensures accurate resizing behavior. Task-4571290 Forward-Port-Of: odoo/enterprise#79568 Forward-Port-Of: odoo/enterprise#79379
When an employee takes a leave, the private car reimbursement amount is reduced by a certain amount. However, when they take multiple leaves, the computation doesn't follow. This commit fixes the issue. task-4353922 Forward-Port-Of: odoo/enterprise#79579 Forward-Port-Of: odoo/enterprise#75552
Original PR description
When an employee takes a leave, the private car reimbursement amount is reduced by a certain amount. However, when they take multiple leaves, the computation doesn't follow. This commit fixes the issue. task-4353922 Forward-Port-Of: odoo/enterprise#79579 Forward-Port-Of: odoo/enterprise#75552
During the creation of quality checks a potentially useless `search` was performed. With this commit, we will perform (indirectly) the search only if needed When method `_create_checks` is called, `quality.check` records are created one at the time. This can become slow wh en a lot of checks are created at once (ex: Bill of Material defined with steps "manual consumption" and used in a manufacturing order). Script used for tests: https://gist.github.com/emi-odoo/d4c6271363dfc3f2e4b7c5efa
Original PR description
During the creation of quality checks a potentially useless `search` was performed. With this commit, we will perform (indirectly) the search only if needed When method `_create_checks` is called,…
During the creation of quality checks a potentially useless `search` was performed. With this commit, we will perform (indirectly) the search only if needed When method `_create_checks` is called, `quality.check` records are created one at the time. This can become slow wh en a lot of checks are created at once (ex: Bill of Material defined with steps "manual consumption" and used in a manufacturing order). Script used for tests: https://gist.github.com/emi-odoo/d4c6271363dfc3f2e4b7c5efabfed5c1 Before: 3.51s (`_create_checks`) - 17493 queries (total queries of the script, not for the single operation)  After: 2.08s (`_create_checks`) - 16103 queries (total queries of the script, not for the single operation)  Comparison of the time taken by Confirming the MRP Order (using `time.process_time()`) | n_components | before (s) | after (s) | ratio | | --- | --- | --- | --- | | 1 | 0.074 | 0.073 | 0.988 | | 5 | 0.134 | 0.140 | 1.042 | | 10 | 0.216 | 0.187 | 0.862 | | 20 | 0.334 | 0.304 | 0.908 | | 50 | 0.736 | 0.600 | 0.816 | | 100 | 1.378 | 1.172 | 0.851 | | 200 | 2.739 | 2.374 | 0.867 | Forward-Port-Of: odoo/enterprise#77608 Forward-Port-Of: odoo/enterprise#65725
Forward-Port-Of: odoo/enterprise#79660
Original PR description
Forward-Port-Of: odoo/enterprise#79660
This commit fixes an issue with the X api calls where the oauth_signature was no longer correct in recent Python versions. `url_quote` used to consider the character `,` as unsafe and quoted it when creating the signature. From Python3.11 this method consider it as reserved but not as unsafe thus not quoting it. This change restores the old behavior to quote so as to respect the oauth_signature format given by X's doc. task-4583612 Forward-Port-Of: odoo/enterprise#79834
Original PR description
This commit fixes an issue with the X api calls where the oauth_signature was no longer correct in recent Python versions. `url_quote` used to consider the character `,` as unsafe and quoted it when creating the signature. From Python3.11 this method consider it as reserved but not as unsafe thus not quoting it. This change restores the old behavior to quote so as to respect the oauth_signature format given by X's doc. task-4583612 Forward-Port-Of: odoo/enterprise#79834
This commit fixes a cohort test failing randomly by ensuring that we wait for the download to be completed before ending the test or asserting the steps. Runbot error-134572 Forward-Port-Of: odoo/enterprise#79738 Forward-Port-Of: odoo/enterprise#79555
Original PR description
This commit fixes a cohort test failing randomly by ensuring that we wait for the download to be completed before ending the test or asserting the steps. Runbot error-134572 Forward-Port-Of: odoo/enterprise#79738 Forward-Port-Of: odoo/enterprise#79555
Due to dependencies and auto installs, Accounting was auto installed for Belgian companies. `l10n_be_reports` was auto installed if `l10n_be` and `account_reports` are installed but it also depends on `account_loans` which is an accounting feature. report by CHKL Forward-Port-Of: odoo/enterprise#79746
Original PR description
Due to dependencies and auto installs, Accounting was auto installed for Belgian companies. `l10n_be_reports` was auto installed if `l10n_be` and `account_reports` are installed but it also depends on `account_loans` which is an accounting feature. report by CHKL Forward-Port-Of: odoo/enterprise#79746
Test that when creating a receipt or internal transfer using the barcode app, the description_picking field of the move_line is not empty. Steps to reproduce the issue: - Create a product with a description for receipts (e.g., 'receipt'). - In the barcode app, create a new receipt and add the product (leave it in draft). - In the inventory app, check the corresponding receipt. - The move_line has no description_picking, even though the product has one. community: https://github.com/o
Original PR description
Test that when creating a receipt or internal transfer using the barcode app, the description_picking field of the move_line is not empty. Steps to reproduce the issue: - Create a product with a description for receipts (e.g., 'receipt'). - In the barcode app, create a new receipt and add the product (leave it in draft). - In the inventory app, check the corresponding receipt. - The move_line has no description_picking, even though the product has one. community: https://github.com/odoo/odoo/pull/193996/files opw-4406582 Forward-Port-Of: odoo/enterprise#79608 Forward-Port-Of: odoo/enterprise#79349
An error occurs when triggering a cron job for posting all pending posts. ```ValueError: Expected singleton: social.post(14, 13)``` A singleton error occurs when the system tries to get a value of 'post_method' from multiple records at [1]. Link [1]: https://github.com/odoo/enterprise/blob/5e968dfce025102bc27f01ba9b07304477835b47/social_push_notifications/models/social_post.py#L26 To avoid the singleton error, we can use the ```mapped()``` function to retrieve a list of values from a
Original PR description
An error occurs when triggering a cron job for posting all pending posts. ```ValueError: Expected singleton: social.post(14, 13)``` A singleton error occurs when the system tries to get a value of 'post_method' from multiple records at [1]. Link [1]: https://github.com/odoo/enterprise/blob/5e968dfce025102bc27f01ba9b07304477835b47/social_push_notifications/models/social_post.py#L26 To avoid the singleton error, we can use the ```mapped()``` function to retrieve a list of values from all the records and check the condition across them. Sentry-6055370689 Forward-Port-Of: odoo/enterprise#74698
Steps to reproduce ================== 1. Allow edit access to portal user on published article. 2. Try to create a child article from the portal user. When the portal user tries to create sub article it sets 'website_published' to true and inverse the field 'is_published' which force to write on the same article. As 'is_published' is not included in the portal writable field it throws an access error. After this commit ================== This commit allows portal user to create arti
Original PR description
Steps to reproduce ================== 1. Allow edit access to portal user on published article. 2. Try to create a child article from the portal user. When the portal user tries to create sub article it sets 'website_published' to true and inverse the field 'is_published' which force to write on the same article. As 'is_published' is not included in the portal writable field it throws an access error. After this commit ================== This commit allows portal user to create article without any errors. Also prevent unnecessary write on empty recordset. Task-4414401 Forward-Port-Of: odoo/enterprise#76349