From ed02c1a2db053fa2e802df33a4a2491b82ba6e3f Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Thu, 4 Feb 2021 13:51:59 +0000 Subject: [PATCH] [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) Signed-off-by: Ivan Yelizariev // IEL --- odoo/fields.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/fields.py b/odoo/fields.py index 20962d776e3..01de4ad49eb 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -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 (