Daily updates from Odoo
Monday, August 12, 2024
14 changes
3 changes
Resolved issues and error corrections
This fix reduces rounding errors when sales order quantities are calculated from product packaging. It helps prevent small packaging-based quantity adjustments from unexpectedly changing ordered amounts, improving accuracy for sales and inventory handling.
Original PR description
### Issue: The way that the `product_packaging_qty` field of the SOL model is defined and used can introduce an error on the qty of the SOL whose as high as half of the uom_rounding (seen as a…
### Issue: The way that the `product_packaging_qty` field of the SOL model is defined and used can introduce an error on the qty of the SOL whose as high as half of the uom_rounding (seen as a percentage) of the qty_per_package E.G. with an uom_rounding of 0.01 you can introduce an error on the qty of the SOL that is up to 0.5% of the qty per package. ### Steps to reproduce the issue: - Enable "Product Packagings" on products in the settings - Create a storable product with a packaging containing 999 units - Create a SO with a SOL for 1004 units of that product - Add your packaging on the SOL #### > the quantity went from 1004 to 1008.99 (error of 5 units that is 0.5%) ### Cause of the issue: Rounding a float number can introduce an error of up to 0.5 the rounding precision e.g. 0.005 rounds up to 0.01 with rounding precision 0.01 which is is an error of half of its rounding precision. The `product_uom_qty` of an SOL is computed by making the product of the `product_packaging_qty` with the `qty_per_packaging`: https://github.com/odoo/odoo/blob/0ffe4cbb5a112b3885f3b624872180bf7bc31891/addons/sale/models/sale_order_line.py#L424-L425 As such, the `product_packaging_qty` is a ratio meant to be re-multiplied with product uom quantities. However, the `product_packaging_qty` is computed with the rounding precision of the `product_uom`: https://github.com/odoo/odoo/blob/0ffe4cbb5a112b3885f3b624872180bf7bc31891/addons/product/models/product_packaging.py#L80 Therefore the `product_packaging_qty` can carry an error as high as half of the `uom_rounding`, that is, most often up to 0.5%. This introduce an error on the `product_uom_qty` that can therefore be as high as 0.5% of the `qty_per_packaging`. ### Fix: Since each of the qty appearing in the quotients and products are rounded, it is impossible to avoid completely any rounding issue but since the `product_packaging_qty` is a ratio that is meant to be remultiplied by a product uom quantity its precision should as high as possible to not introduce any percentage deviation on the quantity. opw-4057874 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update brings the spreadsheet component up to the latest version for Odoo 17.2. It fixes issues around formula evaluation, invalid sheet references, and formatting updates, helping spreadsheets behave more reliably for users.
Original PR description
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/d667a15ba [REL] 17.2.20 Task: 0 https://github.com/odoo/o-spreadsheet/commit/c767b2b2a [FIX] evaluation: add a getter to evaluate value and format Task: 4102210 https://github.com/odoo/o-spreadsheet/commit/da1637eff [FIX] ranges: getRangeFromSheetXC with invalid sheetId Task: 3578461 https://github.com/odoo/o-spreadsheet/commit/a32470f45 [FIX] format: dispatch only once Task: 4091502 Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Mehdi Rachico (mera) <mera@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Sharing a project opened from a sales order now creates the correct project link instead of mistakenly using the sales order link. This prevents errors in the share wizard and helps users reliably share project access with customers or collaborators.
Original PR description
### Steps to reproduce: - Install Sale and Project modules - Create a service product that creates project - Create a quotation with the created service product and confirm it - Click on the project smart button - Try sharing the project ### Current behavior before PR: An error gets triggered when trying to share a project from SO. This happens because the share link that is shown in the share project wizard is not the correct one /mail/view?model=sale.order&res_id=318&access_token=" it will have the sale.order data because of the action_stack the context will have the active_model as sale.order and active_id as SO id which will lead to generation of the wrong link. ### Desired behavior after PR is merged: While opening the share project wizard we will add the project's data to the context to replace the sale.order data so we can have the link generated correctly /mail/view?model=project.project&res_id=178&access_token= opw-4087926
2 changes
Resolved issues and error corrections
This update ensures the Indian GST return reporting process properly returns a response when completing its work. This helps prevent missing feedback or interrupted flows for businesses using GST return reports.
Original PR description
Issue produced in commit- https://github.com/odoo/enterprise/commit/61e5101081c87082de4b6d938fbe7ccdb329e7b6 This commit resolves the missing returning of response
This fix ensures shop floor manufacturing tests behave consistently whether or not the quality manufacturing module is installed. It prevents lot information from being set when no quantity has been completed, reducing false test failures and improving reliability.
Original PR description
test_shop_floor fails with only mrp_workorder installed. With quality_mrp (as in runbot), test succeeds. Origin is in _compute_lot_line_id which set lot_id even when no qty_done.
9 changes
Resolved issues and error corrections
This update fixes three critical issues in the barcode scanning system for inventory operations. It now correctly accepts product packaging barcodes when scanning is required, properly handles lot tracking when scanning GS1 barcodes with packaging, and fixes a bug where incorrect lots were selected when processing batch deliveries. These fixes ensure that warehouse staff can complete inventory tasks more efficiently without encountering unexpected scanning errors.
Original PR description
#### [FIX] stock_barcode: restrict product scan pckging > #### How to reproduce: > - Create a product with a product packaging and set a barcode for this packaging; > - In the Receipts operation type…
#### [FIX] stock_barcode: restrict product scan pckging > #### How to reproduce: > - Create a product with a product packaging and set a barcode for this packaging; > - In the Receipts operation type config, check the product mandatory scan; > - Create and confirm a receipt for the created product; > - Open the receipt in the Barcode app; > - Scan the product's packaging => A notification asks you to scan the product first. > > This behavior is not right, a packaging should be a valid scan too for product's mandatory scan. > > [OPW-4062460](https://www.odoo.com/odoo/project/49/tasks/4062460?cids=1) ### [FIX] stock_barcode: GS1 packaging with lot > #### Steps to reproduce: > - In Inventory settings, choose GS1 as barcode nomenclature and activate packages; > - Create a storable product tracked by lot; > - Create a lot for this product (e.g.: 12345); > - Create a second storable product tracked by lot; > - Create a new lot with the same name (12345) and a packaging on the product page with the barcode number 10000000240489; > - Go back to the barcode app and create a new delivery; > - San the barcode 01100000002404891012345 > => The line is added for the right product but the lot is missing. > > #### What happens: > When the GS1 barcode is parsed, we got a lot name and a packaging barcode, thus, we will search a lot for the scanned lot name. > To avoid fetching the wrong lot in case multiple lots have the same name (but different product), we give a filter when the lot is scanned alongside a product. > The issue here is we didn't scan a product but a packaging and we forgot to give the same filter in this case. > > [OPW-3894500](https://www.odoo.com/odoo/project/49/tasks/3894500?cids=1) ### [FIX] stock_barcode_picking_batch: reserved lot > Bug introduced by: https://github.com/odoo/enterprise/pull/63908 > > #### How to reproduce: > - Create a product tracked by lot; > - For this product, add some quantity in stock for at least two different lots; > - Create a delivery for this product, with enough quantity to reserve at least two different lots; > - Confirm it and add it into a batch; > - Open this batch in the Barcode app; > - You should have a button to display reserved lots on the product line, click on it, it will display the reserved lot AND select the first one; > - Scan a reserved lot other than the first one => The first one will be replaced by the scannned lot even if there is already another line with this lot. > > [OPW-4017945](https://www.odoo.com/odoo/project/49/tasks/4017945?cids=1) Forward-Port-Of: odoo/enterprise#67267
This fix resolves a critical error that prevented users from generating BOE (Boletin Oficial del Estado) documents in the Spanish Tax Report (Mod 349). The issue occurred when processing reversed bills from EU vendors, causing the system to crash. Users can now successfully generate tax reports without encountering errors.
Original PR description
Before this commit:
Steps
1) Install l10n_es_reports
2) Switch to ES company
3) Create a EU vendor (any except SPAIN) + add TIN
4) Create a bill with last month date
5) Reverse that bill with current month date
6) Go to Tax reports
7) Switch to Tax Report (Mod 349) (ES)
8) Choose date range: This Month
9) Generate BOE
=> It shows an error with a traceback `/l10n_es_reports/models/aeat_tax_reports.py", line 1257, in _write_type2_refund_records
previous_report_amount = invoice_line_data['columns'][0]['no_format']
TypeError: 'NoneType' object is not subscriptable`
After this commit:
BOE in mod349 is generated properly without errors
opw-4055702
Forward-Port-Of: odoo/enterprise#68096This fix improves how Sendcloud delivery requests handle customer contact information by checking for mobile numbers first before landline phone numbers. Many shipping carriers require valid mobile numbers for delivery, so this change ensures the system sends the most appropriate contact number to Sendcloud, reducing delivery failures and improving customer experience.
Original PR description
Before this commit: Sendcloud request adds a phone number instead of a mobile number first during the check. For many carriers, Sendcloud requires real mobile numbers instead of (landline) phone number. After this commit: Mobile number is checked before the phone number and added to the request if available. opw-4005520 Forward-Port-Of: odoo/enterprise#66480
This fix resolves an error that occurred when users clicked on cells in accounting reports while using both the Cash Basis Method filter and Analytic Group By feature. The system was incorrectly applying filters to the wrong data model, causing the report to crash. Now the filters are applied to the correct model, allowing users to drill down into report details without errors.
Original PR description
Issue ---- When clicking an account report cell with the cash basis filter on, `account_reports_cash_basis.account_report.action_audit_cell` adds a domain to filter out `account.move.line`s that don't belong to the cash basis criteria. However, the model is not always an `account.move.line`. If an analytic account column is added with the "Analytic Group By" option, the model is `account.analytic.line`, which results in a field not found error. Steps ---- - Go to Accounting -> Reporting -> Profit and Loss. - From the Options button above, select "Cash Basis Method". - From the Analytic Group By button, add an analytic account in the "Accounts" filter. - Click on a cell under the analytic account's column. - An error is thrown. Cause ---- Domain is applied on the wrong model. opw-4034786 Forward-Port-Of: odoo/enterprise#66890
This update fixes an issue where Dutch tax reports were being rejected by the BelastingDienst (Dutch tax authority) due to incorrect formatting. The system now properly limits the professional association name field to 20 characters as required by the tax authority, preventing submission errors and ensuring tax reports are accepted without delays.
Original PR description
The BelastingDienst returns an error if the format for the 'ProfessionalAssociationForTaxServiceProvidersName' tag is not respected. The string value in that tag should not exceed 20 characters.µ opw-4075462 Forward-Port-Of: odoo/enterprise#67635
This update resolves an error that occurred when sending HR Appraisal notifications or surveys after customizing the email template. The fix ensures that employee record information is properly available in customized email templates, allowing HR teams to include relevant appraisal details in their communications without encountering system errors.
Original PR description
Steps to reproduce :
----
- customize mail_notification_light template with a field from record
(with Studio or with inherited template)
- confirm a Hr Appraisal or send a Hr Appraisal Survey
Error before this commit :
----
- RPC error
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
KeyError: 'record'
Template: mail.mail_notification_light
Explanation :
----
We add the record in the template context, therefore any field from the
record can be calledThis update resolves an error that was preventing users from opening the General Ledger report. The report will now open and display correctly without any technical errors, improving the user experience when accessing this important financial document.
Original PR description
before this commit, on opening general ledger report shows traceback for the user  introduced in this commit: https://github.com/odoo/enterprise/commit/402ed134269db6b82679c32d21eb1122bbda7cfe after this commit, the report will be opened without any issues
This fix resolves an issue in Odoo Studio where removing and adding fields to a form would generate unnecessary operations. When users removed a block and added a new field, the system was creating multiple conflicting changes instead of just the intended ones. The fix ensures that form modifications are tracked accurately by uniquely identifying each element, so the system correctly recognizes which specific blocks were changed.
Original PR description
Steps to reproduce ================== - Open a product form - Open Studio - Remove the "Internal Notes" block from "General Information" - Add a new field => The normalized view contains many…
Steps to reproduce
==================
- Open a product form
- Open Studio
- Remove the "Internal Notes" block from "General Information"
- Add a new field
=> The normalized view contains many operations, it should only contain one move and one insertion
Cause of the issue
==================
The normalization compares the original view with the view with all operations applied. To do this, it stringifies every node and then does a textual diff between the original and modified versions.
The issue in this case is that there are multiple ways to represent a diff.
In this example, we remove the first group
```xml
<form>
<group/>
<group/>
</form>
```
```xml
<xpath expr="/form/group" position="replace"/>
```
The before stringified view is represented as
```
/form/group
/form/group[@closed]
/form/group
/form/group[@closed]
```
The after stringified view is represented as
```
/form/group
/form/group[@closed]
```
There are two ways to represent this diff
```diff
- /form/group
- /form/group[@closed]
/form/group
/form/group[@closed]
```
```diff
/form/group
- /form/group[@closed]
- /form/group
/form/group[@closed]
```
In this case, we only want the first one, but the second one is generated.
Solution
========
We can assign an id to every node before performing the diff, this way, the nodes are uniquely represented.
The before stringified view will be represented as
```
/form#1/group#2
/form#1/group#2[@closed]
/form#1/group#3
/form#1/group#3[@closed]
```
The after stringified view is represented as
```
/form#1/group#3
/form#1/group#3[@closed]
```
The diff can now only be represented in one way
```diff
- /form#1/group#2
- /form#1/group#2[@closed]
/form#1/group#3
/form#1/group#3[@closed]
```
opw-3819667This update corrects how currency exchange rates are calculated by properly including a ratio adjustment from the data source. The fix ensures that currency conversions are accurate when processing live exchange rate data, which is important for any financial transactions or reporting that depends on correct currency values.
Original PR description
Updated the currency rate calculation to include the RATIO field from the XML response. This change multiplies the rate by the ratio to ensure accurate conversion rates. Adjusted the datetime parsing to correctly handle the current date calculation.