[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) <dmo@odoo.com>
This commit is contained in:
maad-odoo
2023-09-27 18:56:20 +00:00
parent b89f53095c
commit 3268b6c710
+1 -1
View File
@@ -106,7 +106,7 @@ export function makeLegacyNotificationService(legacyEnv) {
}
}
legacyEnv.services.notification = { notify, close };
legacyEnv.services.notification = { notify, close, add: notification.add };
},
};
}