summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2019-03-14 14:45:53 +0000
committerRaphael Collet <rco@odoo.com>2019-05-27 08:20:07 +0000
commitf14ae73a98ecb40c102c8a22729df4ceb44802e9 (patch)
tree4ee679d81e20d41d1af547602c2e5f3417272592 /addons/web/static/src
parentec792da72b92b22349b6f325e53fd37d953c7db3 (diff)
[FIX] models: do less snapshots in onchange()
As snapshots are costly to compute, we now create exactly two snapshots: one initial snapshot and one final snapshot. All intermediate checks are done with respect to the initial snapshot. Note also that checks are costly for x2many fields. Therefore, once a field has changed, it will never be checked again. This optimization is correct since, by contract, the onchanges of a field are processed at most once. This guarantees the absence of cycles in onchange. For instance, assume that field A modifies fields B and C, and that field C modifies fields D, E and F: - before: 7 snapshots (snapshot, process A, snapshot, process B, snapshot, process C, snapshot, process D, snapshot, process E, snapshot, process F, snapshot) - after: 2 snapshots (snapshot, process A, process B, process C, process D, process E, process F, snapshot) closes odoo/odoo#31872 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/web/static/src')
0 files changed, 0 insertions, 0 deletions