From 2bedd640db14642441c568c2d0b36441f4ba554a Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Wed, 3 Jan 2018 14:35:54 +0000 Subject: [PATCH] [FIX] ir_model: ignore monetary fields during install (#21789) Previous to this commit, we try to load as many fields as possible during module installation, however sometimes some fields are not ready to be loaded, which is the case for custom monetary fields, thus when trying to find the current model's currency_id field it would not find it at all, generating an assertion error. This commit changes this by completely skipping monetary fields if they are not ready to be loaded. OPW 787223 --- odoo/addons/base/ir/ir_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/addons/base/ir/ir_model.py b/odoo/addons/base/ir/ir_model.py index 868865a26a7..f2b711514fe 100644 --- a/odoo/addons/base/ir/ir_model.py +++ b/odoo/addons/base/ir/ir_model.py @@ -854,6 +854,8 @@ class IrModelFields(models.Model): attrs['column1'] = field_data['column1'] or col1 attrs['column2'] = field_data['column2'] or col2 attrs['domain'] = safe_eval(field_data['domain'] or '[]') + elif field_data['ttype'] == 'monetary' and not self.pool.loaded: + return # add compute function if given if field_data['compute']: attrs['compute'] = make_compute(field_data['compute'], field_data['depends'])