[FIX] core: fix adding a field related to Binary or x2many

such fields have store=True, but they don't exist in table.

---

https://github.com/odoo/odoo/pull/65232#issuecomment-773298323
https://github.com/odoo/odoo/commit/02417290191c22c9c99e6dc96a572c21f38e64f1

closes odoo/odoo#65669

X-original-commit: 2eee717ded0fc702b431f7fe784dc62438aa5603
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
This commit is contained in:
Ivan Yelizariev
2021-02-06 12:41:03 +00:00
parent ef824bdeff
commit ed02c1a2db
+2
View File
@@ -821,6 +821,8 @@ class Field(MetaField('DummyField', (object,), {})):
not column
and len(self.related or ()) == 2
and self.related_field.store and not self.related_field.compute
and not (self.related_field.type == 'binary' and self.related_field.attachment)
and self.related_field.type not in ('one2many', 'many2many')
):
join_field = model._fields[self.related[0]]
if (