Skip to content
Snippets Groups Projects
Commit 446d59fd authored by Raphael Collet's avatar Raphael Collet
Browse files

[IMP] api: improve documentation of `api.onchange`

This fixes #3968.
parent 66ce0ac9
Branches
Tags
No related merge requests found
......@@ -171,6 +171,15 @@ def onchange(*args):
when one of the given fields is modified. The method is invoked on a
pseudo-record that contains the values present in the form. Field
assignments on that record are automatically sent back to the client.
The method may return a dictionary for changing field domains and pop up
a warning message, like in the old API::
return {
'domain': {'other_id': [('partner_id', '=', partner_id)]},
'warning': {'title': "Warning", 'message': "What is this?"},
}
"""
return lambda method: decorate(method, '_onchange', args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment