summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2020-11-30 10:48:29 +0000
committerRaphael Collet <rco@odoo.com>2020-11-30 16:50:02 +0000
commit80c1dad6d9124da9459ce38d9e8c03e5c461c180 (patch)
treecad059c57885e6f4e82f00a5b65bc762d6c015b3 /addons/web/static/src/js/fields/basic_fields.js
parentf5de98a2ad67f6e507f81cff34ddf4f0dcae816a (diff)
[FIX] core: avoid multiple calls to default_get() in onchange
Upon the first call to `onchange`, the `values` dict is filled with default values. But the fields without a default are left unassigned. This allows to compute fields when accessing them, but non-computed fields will ask again for their default value, which is a waste of time because we know they don't have one. This may even be a performance issue on forms with many fields. Fix this issue by completing `values` with falsy values, and consider the fields with some initial value (given or default) as the assigned ones for triggering onchanges. This explicitly triggers the computation of fields that depend on fields with some initial value, without forcing them to `False`. Also avoid accessing x2many fields on the record in `snapshot.diff()`. Enable the prefetching by simply putting the right value in cache. closes odoo/odoo#62627 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions