[IMP] doc: dotted names not supported in @constrains

or in @onchange for that matter. They should already generate a warning,
but only the first time they're used.

This is done lazily because it introspects the instance/class which can
be costly when performed during the repeated setup of registry setup.

closes #5595
This commit is contained in:
Sathors 2015-03-04 12:55:06 -05:00 committed by Xavier Morel
parent 1c33197828
commit 903cde0522
1 changed files with 12 additions and 0 deletions

View File

@ -155,6 +155,12 @@ def constrains(*args):
Should raise :class:`~openerp.exceptions.ValidationError` if the
validation failed.
.. warning::
``@constrains`` only supports simple field names, dotted names
(fields of relational fields e.g. ``partner_id.customer``) are not
supported and will be ignored
"""
return lambda method: decorate(method, '_constrains', args)
@ -180,6 +186,12 @@ def onchange(*args):
'warning': {'title': "Warning", 'message': "What is this?"},
}
.. warning::
``@onchange`` only supports simple field names, dotted names
(fields of relational fields e.g. ``partner_id.tz``) are not
supported and will be ignored
"""
return lambda method: decorate(method, '_onchange', args)