[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
This commit is contained in:
Adrian Torres
2018-01-03 14:35:54 +00:00
committed by GitHub
parent 9f583717e5
commit 2bedd640db
+2
View File
@@ -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'])