[FIX] core: onchange() snapshot should only contain expected fields

This fixes an issue with an override of onchange() on account.asset,
which asks for less fields to be considered in the snapshot.  This also
guarantees that onchange() does not return values for unexpected fields.

Part-of: odoo/odoo#116779
This commit is contained in:
Raphael Collet
2023-03-31 17:02:43 +02:00
parent 63ee425b46
commit 596358e25b
+2 -1
View File
@@ -6484,7 +6484,8 @@ class BaseModel(metaclass=MetaModel):
# update snapshot0 with changed values
for name in names:
snapshot0.fetch(name)
if name in nametree:
snapshot0.fetch(name)
# Determine which field(s) should be triggered an onchange. On the first
# call, 'names' only contains fields with a default. If 'self' is a new