[FIX] models: no warning when using `api.constrains` on an inherited field

Fixes #17312
This commit is contained in:
Raphael Collet 2017-05-31 17:03:29 +02:00
parent 0e1b8e5e81
commit d0301459ae
1 changed files with 1 additions and 1 deletions

View File

@ -750,7 +750,7 @@ class BaseModel(object):
field = cls._fields.get(name)
if not field:
_logger.warning("method %s.%s: @constrains parameter %r is not a field name", cls._name, attr, name)
elif not (field.store or field.column and field.column._fnct_inv):
elif not (field.store or field.column and field.column._fnct_inv or field.inherited):
_logger.warning("method %s.%s: @constrains parameter %r is not writeable", cls._name, attr, name)
methods.append(func)