From cd2ccc4110274e23607521c18309f07cca68476a Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 25 Jul 2018 16:11:39 +0200 Subject: [PATCH] [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 2054b5928574affbb7efcd8a9ab146ee4fa34938 --- odoo/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/models.py b/odoo/models.py index 5a85708e0ea..6c094e54687 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -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,)]