b048a6fc2750bb2111c5627b054bbfde5b8e8cfa
If we have a many2many_tags widget that is writable then becomes
readonly, we can have in the code this chain of event:
- get list of widgets we need to reset some data for
- apply modifiers
- reset the widgets
but applying modifiers can delete a widget (eg. an editable field that
becomes readonly), so when resetting we could call code on a deleted
widget which caused an error.
For example, if we have an attribute:
`<field widget="many2many_tags" attrs="{'readonly': 'condition'}"/>`
if the field goes from editable to readonly and is affected by an
onchange, we will call `setIDForLabel` on the deleted instance of the
widget which will cause an error.
Added test without fix fails with error:
TypeError: Cannot read property 'attr' of undefined
at Class.setIDForLabel (/web/static/src/js/fields/abstract_field.js:324:35)
because as said, the function is called on the editable widget that is
removed and replaced with readonly widget at that point.
opw-2154471
closes #43137
closes odoo/odoo#43244
X-original-commit: 6f5ca16524be7c5bb45b03e7421154a20edc4cf6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%