[FIX] models: correct onchange on one2many fields

The method `convert_to_onchange` on one2many fields [1] makes a `copy()`
of `subnames` before altering it. However during onchange management, we
pass it a `PrefixTree` object that can't be copied. As we knows the
object is empty, directly use a empty dict.

[1] https://github.com/odoo/odoo/blob/e6928a6c976cf0f0f7b7b3280205516ad677b413/odoo/fields.py#L2221

Oversight of 2054b59285
This commit is contained in:
Christophe Simonis
2018-07-25 16:11:39 +02:00
parent e6928a6c97
commit cd2ccc4110
+1 -1
View File
@@ -5106,7 +5106,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
continue
field = record._fields[name]
if not subnames:
result[name] = field.convert_to_onchange(new[name], record, subnames)
result[name] = field.convert_to_onchange(new[name], record, {})
continue
# x2many fields: serialize value as commands
result[name] = commands = [(5,)]