From 3268b6c710c11ebd518f2f3ae8a6c5011cd14b7d Mon Sep 17 00:00:00 2001 From: maad-odoo Date: Tue, 19 Sep 2023 12:40:57 +0530 Subject: [PATCH] [FIX] web: traceback on cropping image Before this commit: when cropping a non-supported image in email marketing, it should trigger a warning but instead throws a traceback error. This issue is due to snippet.options.js being in legacy JavaScript, which doesn't include the expected methods from the 'notification' service directly. Instead, it uses methods from 'makeLegacyNotificationService' that lack the .add() method. After this commit: Added the add() methods in the 'makeLegacyNotificationService' which will resolve the error. task-3488181 closes odoo/odoo#136611 X-original-commit: 785e0d7ac12e51ce5db611e535f185a2345241ff Signed-off-by: David Monjoie (dmo) --- addons/web/static/src/legacy/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/legacy/utils.js b/addons/web/static/src/legacy/utils.js index 4e16585ab3e..43c5e971751 100644 --- a/addons/web/static/src/legacy/utils.js +++ b/addons/web/static/src/legacy/utils.js @@ -106,7 +106,7 @@ export function makeLegacyNotificationService(legacyEnv) { } } - legacyEnv.services.notification = { notify, close }; + legacyEnv.services.notification = { notify, close, add: notification.add }; }, }; }