[FIX] models: init function fields once columns are known and not before
This commit is contained in:
parent
5fee95ca63
commit
6c29af3fa5
|
@ -811,9 +811,6 @@ class BaseModel(object):
|
|||
# introduce magic fields
|
||||
cls._add_magic_fields()
|
||||
|
||||
# register stuff about low-level function fields and custom fields
|
||||
cls._init_function_fields(pool, cr)
|
||||
|
||||
# register constraints and onchange methods
|
||||
cls._init_constraints_onchanges()
|
||||
|
||||
|
@ -3002,6 +2999,9 @@ class BaseModel(object):
|
|||
# determine old-api cls._inherit_fields and cls._all_columns
|
||||
cls._inherits_reload()
|
||||
|
||||
# register stuff about low-level function fields
|
||||
cls._init_function_fields(cls.pool, self._cr)
|
||||
|
||||
# check constraints
|
||||
for func in cls._constraint_methods:
|
||||
if not all(name in cls._fields for name in func._constrains):
|
||||
|
|
Loading…
Reference in New Issue