Tran Truong Son e721ed146d [FIX] account: fix error when delete the SO on form view
Reproduction steps:

- disable any debugger parameter that would on in the url
- create a new sale order
- add a sale order line with a tax
- save (and don't leave the record!)
- delete the sale order

Regarding the bug, there are several issues happening at the same time:

- Business code issue:
	- Our code wasn't defensive and we were assuming the computed value
would always be set to the computed value.
- Framework JS issue: (not OWL itself but its integration into Odoo)
	- When the record is deleted, a re-rendering gets triggered.
	- As we deleted the record in the back, the browsed record in the
front-end gets its data reset to the default values a field could have.
Because the default value of a binary field is False, tax_totals gets
set to false for the reset record.

Now, we have a bunch of race conditions going on.

In the invoicing view, it doesn't happen because the rendering is slower
and it gets cancelled before being done. Thus the field tax_totals
hasn't the chance to re-render itself and thus, to call
TaxTotalsComponent.formatData through the call of onWillRender.
In the case of the sale order view, the field has the time to gets
rendered, the method gets called and the traceback happens.

closes odoo/odoo#159018

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-04-03 22:17:53 +00:00
…
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%