*: web_editor, website
Prior to this commit, the template structure for declaring the snippet
options used in a specific context (website, mass_mailing, ...) made it
hard to easily modify SnippetOptions defined in web_editor.
Indeed, the structure was as below
```xml
<template>
<t t-call="web_editor.snippet_options" />
... Additional Options ...
</template>
```
If someone wanted to alter the behaviour of an option from web_editor
for their module, they had 2 solutions
- To extract that option inside another template, extend that template
inside their own module, remove its call from web_editor and instead
call manually the option inside each module (preferred method)
- To impact the web_editor template directly with an extension instead
of a new primary template or override JS options using include or
replacing an option inside the registry.
The second solution was often used but created extra code to make sure
that other modules were not impacted... and it was often not properly
done. For example:
- [1] and [2] introduced javascript code inside the web_editor options
and isolating it by checking if they are in fact, inside mass_mailing.
- [3] adds code in mass_mailing mentioning JS classes of website, and
actually broke parallax for website (after [5]).
- [4] broke the image transform option for website (after [5]).
- [6] added some shapes for mass mailing images but ended up adding them
for the website builder too.
- [7] created different images options for mass_mailing... but ended up
impacting website options too. Half of those can actually either be
put in web_editor to improve everything or just in mass_mailing to not
break the website.
- ...
This commit tries to fix everything "the right way" in master (and will
be backported for the recent 16.0). Other stable fixes will need to be
made to restore the website options in a stable way.
To fix that, this commit changes the structure to
```xml
<template inherit_id="web_editor.snippet_options" primary="True">
<xpath ...>
... Change existing options ...
</xpath>
<xpath expr="." position="inside">
... Additional options ...
</xpath>
</template>
```
This allows each module to modify the existing web_editor templates
without impacting it and each other. They can even change the JS
behaviour by using an XPath to replace the data-js of an option, and
changing it to their own extended version of the JS option.
[1]: https://github.com/odoo/odoo/commit/f296992317e96562c66bd7ad59a5080d6c551ed5#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R134-R138
[2]: https://github.com/odoo/odoo/commit/cd403480f90cf7103651f3be818a14b06d3c73ca#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R175
[3]: https://github.com/odoo/odoo/commit/e9237ae8004502a3071e8ceb132d9dac11fe00b3#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R372
[4]: https://github.com/odoo/odoo/commit/ff422df49201be6ed7baa11ef3deb5b9a41042a7
[5]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[6]: https://github.com/odoo/odoo/commit/24a4c7f897d4db6bdf0f3cbfc91a3ce7351241a2
[7]: https://github.com/odoo/odoo/commit/d0c2d8e9a1436a8eaf263797c790329f81d7615b
closes odoo/odoo#99850
Related: odoo/design-themes#597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Odoo Mass Mailing
Easily send mass mailing to your leads, opportunities or customers with Odoo Email Marketing. Track marketing campaigns performance to improve conversion rates. Design professional emails and reuse templates in a few clicks.
Send Professional Emails
Import database of prospects or filter on existing leads, opportunities and customers in just a few clicks.
Define email templates to reuse content or specific design for your newsletter. Setup several email servers with their own IP/domain to optimise opening rates.
Organize Marketing Campaigns
Design, Send, Track by Campaigns with our Lead Automation app.
Get real time statistics on campaigns performance to improve your conversion rate. Track mails sent, received, opened and answered.
Easily manage your marketing campaigns, discussion groups, leads and opportunities in one simple and powerful platform.
Integrated with Odoo Apps
Get access to mass mailing features from every Odoo app to improve the way your users communicate.
Send template of emails from Odoo CRM opportunities, select leads based on marketing segments, send job offers and automate answers to applicants, reuse email template in the lead automation marketing campaigns.
Answers to your emails appears automatically in the history of every document with the social network module.
Clean Your Lead Database
Get a clean lead database that improves over the time using the performance of your mails. Odoo handle bounce mails efficiently, flag erroneous leads accordingly and gives you statistics on the quality of your leads.
One click emails send
The marketing department will love working on campaigns. But you can also give a one click mass mailing facility to all others users on their own prospects or documents.
Select a few documents (e.g. leads, support tickets, suppliers, applicants, ...) and send emails to their contacts in one click, reusing existing emails templates.
Follow-up On Answers
The chatter feature enables you to communicate faster and more efficiently with your customer. Get documents created automatically (leads, opportunities, tasks, ...) based on answers to your mass mailing campaigns Follow the discussion directly on the business documents within Odoo or via email.
Get all the negotiations and discussions attached to the right document and relevent managers notified on specific events.
Campaigns Dashboard
Get the insights you need to make smarter marketing campaign. Track statistics per campaign: bounce rates, sent mails, best content, etc. The clear dashboards gives you a direct overview of your campaign performance.
Fully Integrated With Others Apps
Define automated actions (e.g. ask a salesperson to call, send an email, ...) based on triggers (no activity since 20 days, answered a promotional email, etc.)
Optimize campaigns from lead to close, on every channel. Make smarter decisions about where to invest and show the impact of your marketing activities on your company's bottom line.
Integrate a contact form in your website easily. Forms submissions create leads automatically in Odoo CRM. Leads can be used in marketing campaigns.
Manage your sales funnel with no effort. Attract leads, follow-up on phone calls and meetings. Analyse the quality of your leads to make informed decisions and save time by integrating emails directly into the application.