Nicolas Lempereur b048a6fc27 [FIX] web: widget noreset if rerendered for modifier
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>
2020-01-13 17:59:30 +00:00
2020-01-09 15:34:29 +00:00
2015-09-08 15:45:09 +02:00
2019-10-03 12:48:09 +00:00
2015-09-08 17:58:38 +02:00
2019-11-08 11:24:04 +00:00
2019-10-03 12:48:09 +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%