Saturday, August 31, 2024
3 changes · saas-17.2
Resolved issues and error corrections
Users can now add a barcode to a product even when no Customer Taxes are set. This prevents an unexpected error screen and keeps product setup workflows running smoothly.
Original PR description
When the user tries to add a barcode without Customer Taxes, a traceback will appear. Traceback: ``` AttributeError: 'product.template' object has no attribute 'super' File "odoo/http.py", line 2374,…
When the user tries to add a barcode without Customer Taxes,
a traceback will appear.
Traceback:
```
AttributeError: 'product.template' object has no attribute 'super'
File "odoo/http.py", line 2374, in __call__
response = request._serve_db()
File "odoo/http.py", line 1904, in _serve_db
return self._transactioning(
File "odoo/http.py", line 1967, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1934, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2178, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 223, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 755, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 35, in call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 459, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "addons/web/models/models.py", line 1008, in onchange
record._apply_onchange_methods(field_name, result)
File "odoo/models.py", line 7042, in _apply_onchange_methods
res = method(self)
File "home/odoo/src/enterprise/saas-17.4/product_barcodelookup/models/product_template.py", line 20, in _onchange_barcode
product._update_product_by_barcodelookup(product, barcode_lookup_data)
File "home/odoo/src/enterprise/saas-17.4/product_barcodelookup/models/product_template.py", line 77, in _update_product_by_barcodelookup
product.list_price = self._get_list_price(price)
File "addons/account/models/product.py", line 154, in _get_list_price
return self.super._get_list_price(price)
```
https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/account/models/product.py#L146 Here, self.super is used instead of super() .
so, it will lead to the above traceback.
sentry-5766033395
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prPurchase order PDFs now avoid showing an unnecessary tax base line when there is only one VAT rate. This fixes a rounding mismatch for currencies such as Chilean pesos, making printed tax information clearer and consistent.
Original PR description
Steps to reproduce: - Install 'Purchase' - Create a new company with CLP currency. - Select Chile fiscal localization in Settings. - Make a new Request for Quotation - Add any product set price to…
Steps to reproduce: - Install 'Purchase' - Create a new company with CLP currency. - Select Chile fiscal localization in Settings. - Make a new Request for Quotation - Add any product set price to 23.67 - Add VAT of 19% - Confirm the order - Click on the Action button -> Print -> Purchase Order. Issues: On the downloaded pdf, the tax base is displayed as "VAT 19% on $24". It shouldn't be the case as we have a single VAT so no need to display this. The reason for this appearing is because we have a rounding incosistency. Here we apply `currency.round` on the amount. https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/account/models/account_tax.py#L2116 This is not the case here. https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/account/models/account_tax.py#L2163 Because of this we will have 2 amount in `encountered_base_amounts` whiche means that `'display_tax_base'` will be set to True. https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/account/models/account_tax.py#L2188 opw-4039152
Fixed an issue where scheduled activities could show different user avatar and date information when the same record was open in multiple browser tabs. This keeps activity details consistent across tabs, reducing confusion for users working with forms such as Contacts.
Original PR description
Before this commit, when opening a form view of record containing an activity on 2 different tabs, one of tab showed the user avatar while the other doesn't. Steps to reproduce: - open Contact form…
Before this commit, when opening a form view of record containing an activity on 2 different tabs, one of tab showed the user avatar while the other doesn't. Steps to reproduce: - open Contact form view - schedule an activity - open this form view on another tab => the new tab has user avatar on activity while previous tab doesn't This happens because the state of activities is shared between tabs, and the newer tab shares its state to other tabs. However, activity state was not properly passing relational field values notably for the author: instead of passing `type` and `id` identifying values, it only passes `id`. This comes from a typo in code where the `toIdData()` was used on current model (Activity) rather than the target model (Persona), thus only persona id was retrieved. This commit fixes the issue by properly using `toIdData` on target model of relational field. Also the date and datetime fields were not properly serialized, which also result in breaking the datetime in other tabs. This commit also fixes this issue. Task-4143781 Before / After <img width="300" alt="Screenshot 2024-08-28 at 17 10 25" src="https://github.com/user-attachments/assets/e4422b69-8800-4dc3-ba16-515ea6b7392d"> <img width="369" alt="Screenshot 2024-08-28 at 17 10 30" src="https://github.com/user-attachments/assets/4d5783bd-2935-4630-8ea1-d94264b739bf">