Daily updates from Odoo
Friday, November 15, 2024
11 changes
7 changes
Resolved issues and error corrections
This fixes a conflict that could break the state dropdown on the customer account edit page when Peppol invoicing was installed. Customers can now change their country and select the correct state without losing standard portal account behavior.
Original PR description
Steps to reproduce: 1. Go to website > My Account > Edit information 2. Change the country from say India to United States 3. Click on the state drop down, which then appears blank. The issue occurs because the `account_peppol` module extends the public widget by using the same name as the existing `portalDetails` public widget from the portal module, effectively overriding it. This causes certain functionalities to be lost when `account_peppol` is installed. This commit modifies the `account_peppol` module to extend the existing portalDetails widget instead of overriding it. Issue introduced in commit: https://github.com/odoo/odoo/commit/857b9a188c77cef2e3cd8a1c6b3035e7cd8d1305 task-4310315 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fixes an issue where removing the currency from an invoice could cause the page to crash with an error. The invoice and tax calculations now handle a missing currency more safely, helping users continue editing invoices without interruption.
Original PR description
When the user removes the currency from the invoice, a traceback will appear. Steps to reproduce the error: - Enable multiple currencies - Create a invoice > Add a line > Add any product > Remove…
When the user removes the currency from the invoice,
a traceback will appear.
Steps to reproduce the error:
- Enable multiple currencies
- Create a invoice > Add a line > Add any product > Remove currency
Traceback:
```
AssertionError: precision_rounding must be positive, got 0.0
File "addons/account/models/account_move.py", line 1550, in _compute_tax_totals
base_lines, _tax_lines = move._get_rounded_base_and_tax_lines()
File "addons/account/models/account_move.py", line 1529, in _get_rounded_base_and_tax_lines
AccountTax._add_tax_details_in_base_lines(base_lines, self.company_id)
File "addons/account/models/account_tax.py", line 1354, in _add_tax_details_in_base_lines
self._add_tax_details_in_base_line(base_line, company)
File "addons/account/models/account_tax.py", line 1313, in _add_tax_details_in_base_line
taxes_computation = base_line['tax_ids']._get_tax_details(
File "addons/account/models/account_tax.py", line 1034, in _get_tax_details
raw_base = float_round(raw_base, precision_rounding=precision_rounding)
File "odoo/tools/float_utils.py", line 70, in float_round
rounding_factor = _float_check_precision(precision_digits=precision_digits,
File "odoo/tools/float_utils.py", line 35, in _float_check_precision
assert precision_rounding > 0,\
```
https://github.com/odoo/odoo/blob/0bcc55685fd75f88214b7da1f5df9ec9a7aff784/addons/account/models/account_tax.py#L1041
When, the user removes the currency, ``precision_rounding`` will be 0.0
because at [1], ``base_line['currency_id']`` will be empty,
So, the rounding will be 0.0
So, It will lead to the above traceback.
[1]- https://github.com/odoo/odoo/blob/0bcc55685fd75f88214b7da1f5df9ec9a7aff784/addons/account/models/account_tax.py#L1324
When, the user removes the currency, precision_rounding will be 0.0
because at [2], currency will be empty,
[2]- https://github.com/odoo/odoo/blob/a2c9755e3924bc04e524f5ca0e5e17cd98be5b12/addons/account/models/account_tax.py#L985
When, the user removes the currency,
At [3] "singleton: res.currency()" error will be raised.
so, fallback value is added for that.
[3]- https://github.com/odoo/odoo/blob/a2c9755e3924bc04e524f5ca0e5e17cd98be5b12/addons/account/models/account_tax.py#L1433
When the customer and product are added to the invoice, then the user removes
the currency, At [4] "singleton: res.currency()" error will be raised.
so, fallback value is added for that at [5]
[4]- https://github.com/odoo/odoo/blob/a2c9755e3924bc04e524f5ca0e5e17cd98be5b12/addons/account/models/account_tax.py#L1640
[5]- https://github.com/odoo/odoo/blob/a2c9755e3924bc04e524f5ca0e5e17cd98be5b12/addons/account/models/account_tax.py#L1601
When the customer and product are added to the invoice, then the user removes
the currency, At [6] "singleton: res.currency()" error will be raised because
k['currency_id'] is False.
[6]- https://github.com/odoo/odoo/blob/a2c9755e3924bc04e524f5ca0e5e17cd98be5b12/addons/account/models/account_tax.py#L2173
sentry-6018518380
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prPDF quotes with form fields are now generated so those fields cannot be edited after printing. This prevents accidental or unauthorized changes to quote text after the document has been produced.
Original PR description
Versions -------- - 18.0+ Steps ----- 1. Print a PDF quote with forms. Issue ----- Form fields can be modified. Cause ----- Commit be2f31a4ad03 changed some logic in a forward port, making field read-only, only if they have values. This logic was moved between 17.4 & 18.0 to before the values are known, so in 18.0, no fields are marked as read-only. Solution -------- Make all fields read-only. opw-4290594
Splitting PDF files into new documents has been made more reliable. The fix prevents occasional crashes caused by simultaneous access when newly split documents are created for another owner.
Original PR description
Reproduce: 1. Open the split tool on a pdf 2. Split into new documents 3. See crash about concurrent access to records 3. Sometimes you should do it several times This happens because several routes try to access the document simultaneously before any `documents.access` record exist. See `owner_values` in `documents.document`'s `_prepare_create_values` where we do this for the owner, but in the split tool, the owner can be someone else. Task-4319786
The "My Documents" filter now includes documents linked to the user's contact as well as documents they own. This helps keep files visible after migration when ownership may have been reset due to access restrictions.
Original PR description
Purpose ======= During the migration, the owner can be reset, if the user does not have a write access on the documents (because being owner gives all access on the record). Because of that, the filter "My Documents" does not show most of our files on next.odoo.com. To mitigate that, that filter now uses the contact in addition to the owner, and during the migration, if we reset the owner, and if the contact is False, we will set the contact to the partner of the owner. Task-4310779
Incoming emails sent to the Documents alias will no longer automatically assign a partner in a way that blocks other processing. This helps OCR and related document flows apply the correct values more reliably.
Original PR description
This is a known bug somehow reintroduced in sharepocalypse that prevents other flows (namely the OCR) from writing the correct values. Task-4260511
This fixes checkout errors that could block customers buying products on Colombian company websites. The address form now handles billing and delivery details correctly, reducing failed orders and improving the online purchase flow.
Original PR description
Steps to Reproduce: - Set up a website for a Colombian company. - Go to the shop section. - Purchase any product. Issue: - A traceback occurs when the checkout address form opens. - Another traceback appears upon clicking submit. Cause: - The error is due to an attempt to access an element in the form that is not present. Fix: - Added a condition to ensure that the element is accessed only when the address_type is set to billing. - Updated the view to display the identification type field when use_delivery_as_billing is enabled. opw-4278790
4 changes
Resolved issues and error corrections
This update fixes a problem preventing the system from correctly processing CFDI XML invoices containing the `InformacionGlobal` element. The fix ensures proper encoding of special characters like 'ñ' during XML processing, resolving parsing errors and allowing invoices to be imported successfully. This improves invoice processing reliability for Mexican VAT compliance.
Original PR description
When uploading a CFDI XML invoice containing the `InformacionGlobal` element, the system fails to parse the document correctly and displays an error message. ### Steps to Reproduce 1. Install the…
When uploading a CFDI XML invoice containing the `InformacionGlobal` element, the system fails to parse the document correctly and displays an error message. ### Steps to Reproduce 1. Install the `l10n_mx_edi` module. 2. Create a blank invoice. 3. Add a CFDI XML file containing an `InformacionGlobal` as an attachment to the invoice. (You can use the file `enterprise/l10n_mx_edi/tests/test_files/test_global_invoice_year_month_format.xml` for testing.) The chatter displays the following error: Error importing attachment 'xml_file_name.xml' as invoice (decoder=_l10n_mx_edi_import_cfdi_invoice) ### Cause The `InformacionGlobal` element in the XML requires an `Año` attribute (note the special character `ñ`). Correct encoding is crucial here to handle special characters accurately. When the XML file is first uploaded, it is parsed with the correct encoding. However, during processing, the XML is converted back to a string, losing its original encoding in the process. This causes issues with special characters like `ñ`, which can no longer be read correctly by the system, resulting in a parsing error. opw-4226968
This update fixes an issue where rental dates on ecommerce carts weren't automatically updating when the rental period was changed. The fix ensures that the order line name, which determines the rental period, is recalculated whenever the rental dates are modified, resulting in accurate rental durations displayed in the cart.
Original PR description
Steps:
add a rental product in cart in ecommerce
go to cart and update the rental dates on datepicker
Issue:
The new dates are not applied to cart lines
Cause:
rental dates on cart line come from order_line name
order_line name is not updated on change of rental dates
Fix:
Updated _cart_update_renting_period to update order_line name for rental lines
opw-4137981
opw-4124061
opw-4191403This update ensures that simple POS users can accurately view the total due amount for customers, regardless of whether the customer was initially loaded. Previously, this information was missing when searching for new customers, creating a discrepancy in reporting and settlement. This fix aligns the POS user experience with the functionality available to other users.
Original PR description
Currently, simple pos users can see the due amount of the customers, unless the customer wasn't loaded and we need to search for a customer that isn't loaded. Steps to reproduce: -------------------…
Currently, simple pos users can see the due amount of the customers, unless the customer wasn't loaded and we need to search for a customer that isn't loaded. Steps to reproduce: ------------------- * Create a new customer, make a sale order and invoice it. This will set an amount due for that customer * Connect to the shop with a user that has the `point_of_sale.group_pos_user` but not the `account.group_account_readonly` group * Open customer list > Observation: You can see the amount due for multiple customers * Search for the customer created * Select search more > You can't see the amount due for that customer Why the fix: ------------ Since simple pos users are allowed to see the amount due for the loaded customer, there is no reason they shouldn't see it as well for a customer they need to load. Commit allowing simple pos users to see (and settle) customer accounts: https://github.com/odoo/enterprise/commit/37fa4d5f4ed7c7d77f73395a53b7b3ab7006afc4 When loading the pos session `_loader_params_res_partner` is called first and later is called `_get_pos_ui_res_partner`. It is in the function `_get_pos_ui_res_partner` that the amount due is compted if the user does not belong to the group `account.group_account_readonly`. https://github.com/odoo/enterprise/blob/a35a4755cdf86bcfeda0aca6c06397748ba27362/pos_settle_due/models/pos_session.py#L22-L28 However when we load a customer that wasn't previously loaded, only `_loader_params_res_partner` is loaded. And since the users does not belong to the group `account.group_account_readonly`, the field witll not get loaded. We now compute the amount due with the same logic as in `_get_pos_ui_res_partner`. opw-4141955
This update resolves an issue where Mexican tax reports generated from the Chart of Accounts failed validation due to incorrect account group codes. The fix filters out invalid codes from root account groups, ensuring reports comply with SAT requirements. While not a perfect solution, it addresses the primary cause of the validation failure.
Original PR description
**Steps to reproduce:** - Install l10n_mx_reports - Switch to a Mexican company (e.g. ESCUELA KEMPER URGATE) - Go to "Accounting / Configuration / Accounting / Chart of Accounts" - Create an account:…
**Steps to reproduce:** - Install l10n_mx_reports - Switch to a Mexican company (e.g. ESCUELA KEMPER URGATE) - Go to "Accounting / Configuration / Accounting / Chart of Accounts" - Create an account: * Account Name: [any] * Code: 123456789 * Type: Bank and Cash - Go to "Accounting / Reporting / Audit Reports / Trial Balance" - Download "COA SAT (XML)" - Validate the XML on an online SAT document validator (e.g. https://ceportalvalidacionprod.clouda.sat.gob.mx) **Issue:** The validation fails because the XML contains lines with incorrect or missing value for "CodAgrup" attribute. **Cause:** The "CodAgrup" in the "COA SAT (XML)" refers to the code of the account groups. The accepted values are defined in the "Catálogo de Códigos Agrupadores" XSD file. https://github.com/odoo/enterprise/blob/ecce698637dc2ef13dfdb27dfde303a7f1191aaf/l10n_mx_xml_polizas/data/xsd/1.3/CatalogosParaEsqContE.xsd#L4-L1086 The created account [123456789] is put in the root account group with code "1" and a line is added in the "COA SAT (XML)" with this value. However, it is not an accepted value. **Solution:** From the account groups created automatically by MX localization, only the root account groups (i.e. with code "1", "2", "3",...) do not have a valid code for the "COA SAT (XML)". These ones can be ignored. This solution is not perfect as it is still possible to create an account group with an invalid code that is not a root account group. However, handling this use case would require to check that each code is included in the set of valid codes (there is more than a thousand). opw-4209089 Forward-Port-Of: odoo/enterprise#73647