From b843407fed99521d7803a7ea85e56ae65dfe4faf Mon Sep 17 00:00:00 2001 From: Pouya Malekinejad Date: Fri, 18 Feb 2022 09:24:26 +0000 Subject: [PATCH] [IMP] models: small optimization in onchange closes odoo/odoo#84865 Signed-off-by: Vincent Schippefilt (vsc) --- odoo/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/odoo/models.py b/odoo/models.py index 9ad95dbc976..9f82cb7ce08 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -6525,6 +6525,9 @@ Fields: record._onchange_eval(name, field_onchange[name], result) done.add(name) + if not env.context.get('recursive_onchanges', True): + break + # determine which fields to process for the next pass todo = [ name @@ -6532,9 +6535,6 @@ Fields: if name not in done and snapshot0.has_changed(name) ] - if not env.context.get('recursive_onchanges', True): - todo = [] - # make the snapshot with the final values of record snapshot1 = Snapshot(record, nametree)