[FIX] fields: enable default on company-dependent field

The ORM overrides the default defined programmatically on the field, and
set a default function that retrieves the value in `ir.property`.

closes odoo/odoo#36545

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Raphael Collet
2019-09-09 09:35:19 +00:00
parent a136b4c29a
commit 55e1b44492
+1 -1
View File
@@ -420,7 +420,7 @@ class Field(MetaField('DummyField', (object,), {})):
# by default, company-dependent fields are not stored and not copied
attrs['store'] = False
attrs['copy'] = attrs.get('copy', False)
attrs['default'] = self._default_company_dependent
attrs['default'] = attrs.get('default', self._default_company_dependent)
attrs['compute'] = self._compute_company_dependent
if not attrs.get('readonly'):
attrs['inverse'] = self._inverse_company_dependent