diff options
| author | fja-odoo <fja@odoo.com> | 2019-06-11 12:26:57 +0000 |
|---|---|---|
| committer | fja-odoo <fja@odoo.com> | 2019-06-28 08:53:53 +0000 |
| commit | 283f8fed6e85f2df0386de46138129b4cadc52d7 (patch) | |
| tree | 296f46e0038125cf3b6a2e17b0c8d889f8c8dcac /addons/web/static/src/js/core | |
| parent | 0d1407a715901ea06e9a7211c0e3dbe09fadb785 (diff) | |
[IMP] web, *: display rpc warnings with toasts
* = test_website, partner_autocomplete
- All the rpc warnings are now displayed using the notification system
of https://github.com/odoo/odoo/commit/b94395b50175925fc7d1bd3655e5facb78a8ba2b
- test_website is up to date
Part of https://github.com/odoo/odoo/pull/32132
task-1894820
Diffstat (limited to 'addons/web/static/src/js/core')
| -rw-r--r-- | addons/web/static/src/js/core/service_mixins.js | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/addons/web/static/src/js/core/service_mixins.js b/addons/web/static/src/js/core/service_mixins.js index 209f6ccabb3..f34adfe4de8 100644 --- a/addons/web/static/src/js/core/service_mixins.js +++ b/addons/web/static/src/js/core/service_mixins.js @@ -225,34 +225,42 @@ var ServicesMixin = { /** * Displays a notification. * - * @param {string} title - * @param {string} [message] - * @param {string} [type='warning'] 'info', 'success', 'warning', 'danger' or '' - * @param {boolean} [sticky=false] - * @param {string} [className] + * @param {Object} options + * @param {string} options.title + * @param {string} [options.subtitle] + * @param {string} [options.message] + * @param {string} [options.type='warning'] 'info', 'success', 'warning', 'danger' or '' + * @param {boolean} [options.sticky=false] + * @param {string} [options.className] */ - displayNotification: function (title, message, type, sticky, className) { - return this.call('notification', 'notify', { - type: type, - title: title, - message: message, - sticky: sticky, - className: className, - }); + displayNotification: function (options) { + return this.call('notification', 'notify', options); }, /** * @deprecated will be removed as soon as the notification system is reviewed * @see displayNotification */ do_notify: function (title, message, sticky, className) { - return this.displayNotification(title, message, 'warning', sticky, className); + return this.displayNotification({ + type: 'warning', + title: title, + message: message, + sticky: sticky, + className: className, + }); }, /** * @deprecated will be removed as soon as the notification system is reviewed * @see displayNotification */ do_warn: function (title, message, sticky, className) { - return this.displayNotification(title, message, 'danger', sticky, className); + return this.displayNotification({ + type: 'danger', + title: title, + message: message, + sticky: sticky, + className: className, + }); }, }; |
