summaryrefslogtreecommitdiff
path: root/odoo/api.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
committerChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
commitd74b4518052066446e2a1975a91ce53c745ca75a (patch)
treec08180f88a512d15e37fbec628931f02b3825f65 /odoo/api.py
parentec162dd0cb5622ab6e56db1a63dab5f531a96f4a (diff)
parentf4105eb9c7010f8693e5d2fd20c0bd9d9cc2e483 (diff)
[MERGE] forward port branch 13.0 up to f4105eb9c70
Diffstat (limited to 'odoo/api.py')
-rw-r--r--odoo/api.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/odoo/api.py b/odoo/api.py
index dd0010db9f5..d3766ea3f3e 100644
--- a/odoo/api.py
+++ b/odoo/api.py
@@ -177,6 +177,16 @@ def onchange(*args):
If the type is set to notification, the warning will be displayed in a notification.
Otherwise it will be displayed in a dialog as default.
+ .. danger::
+
+ Since ``@onchange`` returns a recordset of pseudo-records,
+ calling any one of the CRUD methods
+ (:meth:`create`, :meth:`read`, :meth:`write`, :meth:`unlink`)
+ on the aforementioned recordset is undefined behaviour,
+ as they potentially do not exist in the database yet.
+
+ Instead, simply set the record's field like shown in the example
+ above or call the :meth:`update` method.
.. warning::