Skip to content

Commit 7ab66fb

Browse files
agau-odoobso-odoo
authored andcommitted
[REF] mass_mailing: only show mass_mailing and web_editor options
task-3850413
1 parent 5ed4465 commit 7ab66fb

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

addons/mass_mailing/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
'mass_mailing.assets_snippets_menu': [
158158
('include', 'web_editor.assets_snippets_menu'),
159159
'mass_mailing/static/src/js/snippets.editor.js',
160+
'mass_mailing/static/src/js/snippets.registry.js',
160161
'mass_mailing/static/src/xml/mass_mailing.editor.xml',
161162
],
162163
'web.assets_frontend': [

addons/mass_mailing/static/src/js/snippets.editor.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ export class MassMailingSnippetsMenu extends snippetsEditor.SnippetsMenu {
8484
html.querySelectorAll('img').forEach(img => img.setAttribute("loading", "lazy"));
8585
return super._computeSnippetTemplates(html);
8686
}
87+
/**
88+
* @override
89+
*/
90+
getOptions() {
91+
const options = super.getOptions().filter(([, option]) => {
92+
return ["mass_mailing", "web_editor"].includes(option.module);
93+
});
94+
return options;
95+
}
8796
/**
8897
* @override
8998
*/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { registerOption } from "@web_editor/js/editor/snippets.registry";
2+
3+
export function registerMassMailingOption(name, def, options) {
4+
if (!def.module) {
5+
def.module = "mass_mailing";
6+
}
7+
return registerOption(name, def, options);
8+
}

0 commit comments

Comments
 (0)