diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-08-23 16:44:58 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-08-23 16:44:58 +0200 |
| commit | 30bd5ac0e904906d90f4767bbbf178bf940c0c66 (patch) | |
| tree | ea271d0f46ed35c8af460aa71890c1dce474d2a4 /odoo/api.py | |
| parent | 7f2bd086087f73878f62933ecd2e7c2bed32142e (diff) | |
| parent | aec6248bb379c1ece02f5d4f718566c770fc2c6f (diff) | |
[MERGE] forward port branch saas-16 up to aec6248bb37
Diffstat (limited to 'odoo/api.py')
| -rw-r--r-- | odoo/api.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/odoo/api.py b/odoo/api.py index 59bd0636b11..4f4f93071fd 100644 --- a/odoo/api.py +++ b/odoo/api.py @@ -155,6 +155,14 @@ def constrains(*args): ``@constrains`` only supports simple field names, dotted names (fields of relational fields e.g. ``partner_id.customer``) are not supported and will be ignored + + ``@constrains`` will be triggered only if the declared fields in the + decorated method are included in the ``create`` or ``write`` call. + It implies that fields not present in a view will not trigger a call + during a record creation. A override of ``create`` is necessary to make + sure a constraint will always be triggered (e.g. to test the absence of + value). + """ return attrsetter('_constrains', args) |
