summaryrefslogtreecommitdiff
path: root/odoo/api.py
diff options
context:
space:
mode:
authorfja-odoo <fja@odoo.com>2019-08-09 09:58:32 +0000
committerfja-odoo <fja@odoo.com>2019-08-09 15:47:09 +0000
commit20efea970af8d74b06d11d709982429678d35e25 (patch)
tree9485ada7c3945cbaacf8d49305e3a913182b5ea3 /odoo/api.py
parent79d7904b4f650b38c80239fca38bcec39a373580 (diff)
[IMP] *: display some onchange warning with notif
* = base, web, sale, stock, sale_stock, stock_account Warnings for the onchange now takes a type to know if it needs to be displayed with a notification. Else it is displayed with a dialog notification (like before). Related to https://github.com/odoo/odoo/pull/32132 and https://github.com/odoo/odoo/pull/35209 Part of https://github.com/odoo/odoo/pull/35342 task-2047628 closes odoo/odoo#35342 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'odoo/api.py')
-rw-r--r--odoo/api.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/odoo/api.py b/odoo/api.py
index 87534567cfe..f4eeae44516 100644
--- a/odoo/api.py
+++ b/odoo/api.py
@@ -170,8 +170,10 @@ def onchange(*args):
return {
'domain': {'other_id': [('partner_id', '=', partner_id)]},
- 'warning': {'title': "Warning", 'message': "What is this?"},
+ 'warning': {'title': "Warning", 'message': "What is this?", 'type': 'notification'},
}
+ 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.
.. warning::