Commit Graph
287 Commits
Author SHA1 Message Date
Achraf (abz) 6c39b566d6 [FIX] mass_mailing,project: Prevents crash on form views
When a user double clicks on a record in the kanban view of the form view of project a crash occurs.
This happens because there is an init which is called twice and during the second time the component created during the first click is destroyed and a DOM_updated event is still trigger which leads to a crash because in the case of project_form there is has a use of the element's dom which is then no longer available.

There is the same case in "FieldHtmlWithAction" and in "MassMailingFullWidthFormController"

The problem can be easily fixed by using on_attached_callback and on_detach_callback instead of setting a listener on DOM_updated in the init method.

opw-2685867

closes odoo/odoo#81680

X-original-commit: 8d83433d463dd3d1aef321921939962883f57d68
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2021-12-20 16:53:09 +00:00
Antoine Guenet e60949bc55 [FIX] mass_mailing: properly select text color based on background
When changing a mailing's background color to black, the text of many
snippets would change to white, even though the mailing's body was
white. This was because said body was applied in css while the mailing's
body was applied with a class that also set the text's color.
This fixes that issue by applying the white background on the body via
such a class rather that via css.

task-2711643

closes odoo/odoo#81549

X-original-commit: 31abb63fca22c73b85912eb9ba2cf08806aab679
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-12-16 16:44:49 +00:00
David Monjoie 8b1012a79d [FIX] web_editor: fix css rules computing everywhere
X-original-commit: bf9928d28818324c85318968a235d238398bca68
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
Antoine Guenet bd884ae51d [REF] web_editor, mass_mailing: abstract convert_inline function calls
This adds a `toInline` function that replaces the code that was
duplicated between convert_inline and mass_mailing_widget. The
duplication was confusing and error prone.

X-original-commit: 916582af2d707fc1aa462c6feffa3f5defda75a2
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet de558e5da0 [REF] mass_mailing, web_editor: speed up class to inline conversion
When saving an email, its contents pass through convert_inline to ensure
wide e-mail client compatibility. One phase of that process is the
conversion of classes to inline styles, which involves parsing through
all the styles in all the stylesheets of the document, and matching them
with each element in the DOM. That is an extremely expensive process and
because of that, saving an e-mail can take a very long time depending on
how large the DOM is.
This refactors it for performance gains. Tested on an exaggeratingly big
DOM, what used to take about 12s now takes about 5s.

- The process of parsing through the document's stylesheets is now done
  on opening the email (about 500ms) rather than on saving it so we
  split the processing time between the two.
- When parsing the stylesheets, we now also preprocess them by grouping
  whatever can be grouped together and precomputing the specificity so
  as to sort them appropriately. This has the benefit of considerably
  reducing the number of rules to iterate over for each element (from
  11k+ to 3k+).
- In the process, some things were re-written for improved readability.

X-original-commit: 10e749537186dfb80aee1f2537f3b5804f66cfe5
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet 06225d8498 [FIX] web_editor: properly size media list images
When converting a mailing for mail client compatibility, we guarantee a
height for each image. When none can be found, or in the special case of
media_list, that height should however not be forced so the client can
make it take the full height of the cell automatically. This is what is
accomplished by this commit.

X-original-commit: e80433335020a52d8f683060e98047f5ce77b054
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Nicolas Bayet acd946b8a8 [FIX] mass_mailing: save from the codeview
Whenever opening the codeview from mass_mailing and then directly
saving the document did not work.

Task-2704335

closes odoo/odoo#80899

X-original-commit: d9fe1e22b4f645f1732283ab558de170716a7434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-06 12:55:14 +00:00
Antoine Guenet 9f480ba234 [FIX] mass_mailing: restore empty template thumbnail
The empty template had no thumbnail for the "select your template" tab.
This introduces a simple white one.

closes odoo/odoo#80622

X-original-commit: b1ac5a0167c0463d6d83bf4a8463a5e7432ebc21
Related: odoo/enterprise#22616
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-01 08:00:54 +00:00
Antoine Guenet 4d519e5b9c [FIX] mass_mailing: switch templates on hover thumbnail
Templates in mass_mailing have been redefined in [PR]: all their custom
styles have been removed so they all are built in a way that they could
be built using the editor only. Since this was done, the "select your
template" tab has been broken because there are no styles to apply.
This fixes the feature by adapting it to the new context: instead of
changing the styles, it applies the fresh template as if we were
starting a brand new e-mail.

[PR] https://github.com/odoo/odoo/pull/77312

task-2702007

X-original-commit: 09a8e58fd59c297727f9f64ec2a434caaf5b9a67
Part-of: odoo/odoo#80622
2021-12-01 08:00:54 +00:00
Munaf Khan b296e076d4 [IMP] mass_mailing: enable audience segmentation
Right now, in our mass mailing, marketing users refine the audience they are
going to reach with our beautiful domain selector/editor. The problem here
is that the criteria that 'filters' audience can be very common and might be
used in many mailings.

Such filters have to be re-created manually each time they are needed unless
one duplicates a sent mailing. Another possible workaround is to access this
form view while in debug mode so that one can copy and paste those domain
expressions. Unfortunately, none of those solutions are either ideal or
convenient. Especially during the onboarding where new users are not very
familiar with those notions yet.

This commit allow users to save filters on the mass mailings. That way
favorite filters can be re-used on the next mailing. For that, we added
a new model 'mailing.filter'. We do not use existing 'ir.filter' model as
its usage is not completely the same and as we do not want to bloat view
filters with filters created on the fly in marketing application. This new
model contains the following fields:

 - name (given by user while saving the filter)
 - mailing_domain
 - mailing_model_id (m2o for the recipient model)
 - mailing_model_name (technical name of recipient model)

Users can create the filters by setting domain and then hitting hollow star
icon next to 'Filter' m2o and saving it with the name they want. Same way
to delete the saved filter, user simply have to click the filled star icon
when filter is already set. This is done through a new widget that adds its
own behavior on top of m2o widget.

The saved filters can be also managed with a new menu named 'Favorite Filters'
under 'Configuration' menu of Email marketing.

Task-2092853

closes odoo/odoo#70859

Related: odoo/enterprise#21049
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-29 19:01:43 +00:00
dht-odoo 2816537999 [FIX] mass_mailing: fix the tour bubble for mailing creation
We introduced a tour for email marketing (see commit[1]) which has one
important step, that asks user to create a new Mailing. However, the
selector for this step is generic, which makes the tour bubble appear
on every other installed app's kanban view create button.

Moreover, recently we've recently, for the mailing we've moved to
list view as landing view which previously used to be kanban view.

This commit fixes above issues by adding proper selectors for the
step (list view instead of kanban view) and by adding a new class
to mailing tree view named `o_mass_mailing_mailing_tree`. We provide
this class as extra_trigger for the tour step, so that it can target
the button specific for the tree view of the mailing.

commit[1] - c15f9ef

TaskID-2583760

closes odoo/odoo#80500

X-original-commit: c47bd34293aef5d3359911c3b6bf0da40288d6f5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-29 10:33:57 +00:00
xO-Tx 89ce9f9ab5 [FIX] web_editor, mass_mailing: fix editor history for image shapes
Issue:

1- Website editor > Set shape on image
2- Crop > shape is reapplied on the croped image
3- Change another option (e.g. image width)
4- Undo > image will be shown cropped but without any
shape applied on it.

In the current code we apply shapes on cropped images using
the event listener 'ImageOptimize > _onImageCropped', so in
'ImageTools', the 'crop()' option method will record the
"crop" action but the step where the shape is added is lost.
(See: SnippetOptionWidget > _onUserValueUpdate()).

The goal of this commit is to merge the 'ImageTools' and
'ImageOptimize' in one option so we can simply use shape
related methods to apply shapes when the crop() & resetCrop()
methods are called.
This way, the step to record will be a "cropped image with
a shape on it" instead of just a "cropped image".

task-2628964

closes odoo/odoo#80208

X-original-commit: 7c17d78fbdbb64b1aa5b55f78d3202a64a85ed2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-26 15:10:34 +00:00
Fabio Barbero 43fc87ecc4 [IMP] mass_mailing: improve mailing form view
Purpose
=======

Improve UI of mass_mailing module to give the user a clearer view of the
mailings they send, enabling A/B test by default since it is not invasive.

Specifications
==============

Remove border and padding around the chatter in mass mailing form view.
Add sum and average in mailing list view for KPIs
Change sort order from sent_date to calendar_date
Move user_id in form view
Set group_mass_mailing_campaign to True by default

Task-2679537

closes odoo/odoo#79213

Related: odoo/enterprise#22202
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 13:16:52 +00:00
Martin Trigaux a8e50921af [FIX] *: correct typos and English errors
closes odoo/odoo#80181

X-original-commit: efd178daee689192d4e930a075475587038b3e0d
Related: odoo/enterprise#22439
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-22 14:48:04 +00:00
Nicolas Bayet f2b9960677 [FIX] web_editor: properly fix link selection
There is a fix in the editor to fix link selection (see
_fixLinkMutatedElements). Prior to this commit, in mass mailing
the main editable element had the class `o_not_editable`.
This class on the editable disabled the link fix.

Also, it was semantically strange to have the editable being
`o_not_editable`.

Task-2684360

closes odoo/odoo#79934

X-original-commit: 112f3776985fbe8f5291cd4d26424f6c427ff36c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-18 18:44:58 +00:00
Sébastien Geelen (sge) cb1fcb598f [FIX] web_editor: fix ResizeObserver error in FF
The error "ResizeObserver loop limit exceeded" was catch by the browser error
global listener. this error was wrongly flagged as a CORS error.
This error is well known to be useless and can safely be ignored.

We do so.

Task-2670745

closes odoo/odoo#79645

X-original-commit: 1c21e2d6fa3c25d2a920902ebecd19f6229b56d8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 09:04:32 +00:00
Romain Derie 9a1f868de5 [FIX] mass_mailing: correctly hide editor button
Since this [commit], the layout style was improved to not break when the save
and discard button are translated.
But it was breaking the mass mailing editor, as those button were not hidden
anymore.

[commit]: https://github.com/odoo/odoo/commit/120c88a6fffc111afba734c60eb06cf0543c1760

closes odoo/odoo#79719

X-original-commit: 940ac7a6c0d54e9ef8a89b0dc74b892209e1c125
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-12 15:48:11 +00:00
Julien Banken fa106b03bc [IMP] mass_mailing: update the snippet icons of the mail editor
On the right panel of the mail editor, the icons of the mass mailing
module do not match with the other icons. We will then update them to
improve the consistency of the layout. The icons will now have the same
background color as the other icons.

task-2658133

Co-Authored-By Carlos Valverde <cvs@odoo.com>

closes odoo/odoo#78645

X-original-commit: 8aa5c39c0ba84a4e5bdb27ff6d70a43ad90ae4af
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-10-20 05:32:55 +00:00
Younn Olivier 46c0bf7827 [FIX] website, mass_mailing: remove composed css classes
Recently, [1] broke the style of a few snippets, because it was adding a
:not selector to the parent css class, that was used to define children
classes that were adding a suffix to the parent class name with the &
symbol.

It was decided that every snippet css class should be explicitly
declared to avoid breaking the style when adding selectors to the parent
class. This will also prevent breaking the style when adding a new css
version for the snippet.

task-2660921

[1]: https://github.com/odoo/odoo/pull/77312

closes odoo/odoo#78413

X-original-commit: af6785599358d2dcb9ff811afc2e558a94d9704d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-15 16:13:47 +00:00
Antoine Guenet 47584e6716 [IMP] mass_mailing: show body_arch in readonly, body_html in a debug tab
The body of a mailing is saved in two fields: body_arch without
modifications, and body_html with conversion for email client
compatibility. Prior to this commit, we were showing body_html when
opening the form view of a saved mailing in readonly. This was pretty
strange and confusing as it's a sort of intermediary version that
doesn't mean much: an in-browser rendering of html that is compiled for
email clients.
With this commit, we change the view to always show body_arch instead.
A new tab is introduced in order to show body_html for debugging, which
is therefore only visible in debug mode.

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Antoine Guenet 0249b0ce1a [REF] mass_mailing, website: rename conflictual snippet options classes
The css of some website snippets conflicted with their mass_mailing
equivalents. A quick, non-intrusive solution had been to contain that
css so it wouldn't conflict. This replaces that solution with the more
neighborly renaming of said snippets in mass_mailing. This way there is
no added awareness of mass_mailing within the code of website.

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Antoine Guenet ff9a77c4be [FIX] mass_mailing, web(site,_editor): restore original website options
Commit [1] copied a lot of website snippet options into mass mailing.
Some were moved to web_editor and xpathed to be used in both without
duplicating code. Sadly that is not without side effects and it was
therefore decided to duplicate them instead so they can live separate
lives in the future.

[1] https://github.com/odoo/odoo/commit/4f7cd33d0fd69ee5984d0968233ffc73d7751030

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Elisabeth Dickinson ec39e48ea6 [IMP] mass_mailing: optimize snippet images
Reduce snippet images' file sizes to be under 100kb.

task-2554899

X-original-commit: 982ab71c01a52c53dc5f1ac90904962b1c52eba5
Part-of: odoo/odoo#77724
2021-10-04 15:31:10 +00:00
Elisabeth Dickinson 351bcdedc2 [IMP] mass_mailing: apply default background color to all HTML mailings
This applies a default background color to all HTML mailings in order to
emphasize the separation between the mailing itself and its body.

task-2554899

X-original-commit: 75cbf5a559f891546c92f9079eb4d8dd22ac5e6b
Part-of: odoo/odoo#77724
2021-10-04 15:31:09 +00:00
Elisabeth Dickinson d328063349 [ADD] mass_mailing: add an empty template to drop snippets into
This adds an empty template to `mass_mailing`, in which snippets can be
dropped, to start an HTML mailing from scratch.

task-2554899

X-original-commit: 7522272f42b38ef2f47e2432660bcf6a3030795c
Part-of: odoo/odoo#77724
2021-10-04 15:31:08 +00:00
Antoine Guenet 38c8533575 [FIX] mass_mailing, web_editor: prevent dropping snippets out of mailing
Prior to this commit, it was possible to drop snippets out of the
confines of the mailing's body and into its editable parent instead.
This makes that impossible.

task-2554899

X-original-commit: e3942e4aa1391ca82a946d4b6b3823d2690733ee
Part-of: odoo/odoo#77724
2021-10-04 15:31:07 +00:00
Antoine Guenet b3706f1afc [REM] mass_mailing: remove unnecessary table-related snippet
`mass_mailing_table_item` was charged with ensuring proper cloning and
removing of table elements precisely because `mass_mailing` relied so
heavily on them. Since it doesn't anymore, there is no need for that
option. This removes it.

task-2554899

X-original-commit: 386848568adb8e11f57e458cb7862cb3058b07c9
Part-of: odoo/odoo#77724
2021-10-04 15:31:07 +00:00
Antoine GuenetandElisabeth Dickinson d0c2d8e9a1 [ADD] mass_mailing, web[site|_editor]: website snippets to mass_mailing
The following snippets (and their relevant options) were added to
`mass_mailing`, mostly duplicated from the website builder:

- s_cover
- s_title
- s_text_block
- s_comparisons
- s_color_blocks_2
- s_three_columns
- s_image_text
- s_text_image
- s_picture
- s_features
- s_numbers
- s_masonry_block
- s_media_list
- s_showcase
- s_company_team
- s_call_to_action
- s_references
- s_product_list
- s_features_grid
- s_alert
- s_rating
- s_blockquote
- s_hr
- s_text_highlight
- s_coupon_code

The following snippets were removed to make way for the new:

- s_mail_block_banner
- s_mail_block_title_sub
- s_mail_block_paragraph
- s_mail_block_comparison_table
- s_mail_block_two_cols
- s_mail_block_three_cols
- s_mail_block_image_text
- s_mail_block_text_image
- s_mail_block_image
- s_mail_block_footer_separator
- s_mail_block_steps
- s_mail_block_discount2

The following standalone snippet options were added, mostly duplicated from the
website builder:

- Box
- layout_column
- SnippetMove
- snippet_options_text_align (via web_editor)
- snippet_options_width (via web_editor)
- snippet_options_block_align (via web_editor)
- BodyWidth (based on ContainerWidth but only for the mailing's body)
- minHeight
- so_snippet_addition
- so_content_addition
- sizing_x
- vAlignment

Styles and selectors were adapted to the specifics of `mass_mailing`.

task-2554899

X-original-commit: e5e1d4255ab416581b2ef7159c0c28540528771c
Part-of: odoo/odoo#77724
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2021-10-04 15:31:07 +00:00
Antoine Guenet 5de7bdb924 [IMP] (website_)mass_mailing: convert tables to bootstrap grids
The new automatic conversion from Bootstrap grid to tables allows us to
convert `mass_mailing` templates from their old table structures to
Bootstrap grid (as the reverse conversion will now be applied on save).

General heuristic for the conversion of templates:

|      **Table**      |                **Bootstrap**               |
|:-------------------:|:------------------------------------------:|
|      `<table>`      |          `<div class="container">`         |
|      `<thead>`      |                 _(removed)_                |
|      `<tbody>`      |                 _(removed)_                |
|      `<tfoot>`      |                 _(removed)_                |
|        `<tr>`       |             `<div class="row">`            |
|        `<th>`       |       `<div class="col o_col_head">`       |
|        `<td>`       |             `<div class="col">`            |
| `<td width="_n_%">` | `<div class="col-_o_">` where o ~= 12n/100 |
|    `cellspacing`    | _(removed but always added back to table)_ |
|    `cellpadding`    | _(removed but always added back to table)_ |
|       `border`      | _(removed but always added back to table)_ |

Some styles had to be changed to account for the difference in the HTML.

task-2554899

X-original-commit: c26dac24c5fd15165935c770175c1b6f87aaad41
Part-of: odoo/odoo#77724
2021-10-04 15:31:06 +00:00
Antoine Guenet 066e1c7c84 [IMP] mass_mailing: multiple transpiler improvements
This brings a series of improvements to the mechanism in place to
convert the output html of mass mailing into html that is more compliant
with the main mail clients' requirements.

The biggest change is the automatic conversion of Bootstrap grids into
table structures. Currently all templates in `mass_mailing` are designed
with tables so they work in mailings as is. That has limitations though
as it makes it less easy to edit with snippets such as those used in the
website builder. This new automatic conversion from Bootstrap grid will
allow us to adapt the mailing and snippet templates and be more free
within `mass_mailing`.

Note: Because of the limited support of media queries in emails, this
doesn't support the mixing and matching of column options
(e.g., `"col-4 col-sm-6"` and `"col col-4"` aren't supported).

Other changes include:
- The conversion of Bootstrap cards to table structures
- The conversion of Bootstrap list-groups to table structures
- The conversion of snippets (.o_mail_snippet_general) and mailings
    (.o_layout) into table structures
- The conversion of all rgb colors to hexadecimal
- The conversion of all "rem" sizes to "px"
- Various small corrections to the output styles

task-2554899

X-original-commit: e2e00939e09220051f6f4ecfb7bb3276105387bf
Part-of: odoo/odoo#77724
2021-10-04 15:31:06 +00:00
Elisabeth Dickinson 5c056b6228 [FIX] mass_mailing: add button styling
"Rounded" and "Flat" buttons didn't have their proper styling
if the website module was not installed.
Styles for rounded and flat buttons have been added to theme_default.scss

closes odoo/odoo#77661

X-original-commit: 74540364428e9d5a308a1012ae8614aa37ecb8a6
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-10-04 07:57:12 +00:00
Antoine Guenet 68d27ec73e [FIX] web_editor, mass_mailing: use new historyReset io/ resetHistory
344d82c renamed `resetHistory` into `historyReset` but failed to update
some calls to it and rename its equivalent in wysiwyg.js. This commit
corrects the discrepancy.

Part-of: odoo/odoo#75901
2021-09-08 09:03:07 +00:00
Antoine Guenet c0d6f1993d [IMP] mass_mailing: remove outdated and expensive from_inline conversion
When saving a mailing, we do some processing (converting classes to
inline styles mostly) in order for the mailing to display properly in
all email clients. Until we started saving the processed version
separately from the unprocessed version, we had to revert the process
whenever we would start editing the mailing. This was extremely
expensive and made the loading of a previously created email very, very
slow. This was kept so far for backward compatibility reasons 3 years
ago (see f296992). This commit removes the that unnecessary conversion.

Part-of: odoo/odoo#75901
2021-09-08 09:03:07 +00:00
Antoine Guenet 95754eb6a4 [FIX] mass_mailing: save transpiled html without affecting body_arch
Since the introduction of Odoo Editor, `field_html`'s `_getValue` uses
`wysiwyg.getValue`. This conflicts with the mechanism of `mass_mailing`
which modifies the html of the editable area in place to save an
"e-mailable" version on the `body_html` field, then relies on
`_getValue` to reset the original html (`body_arch`).
This ensures the field has a value before modifying the html in place,
so we can manually restore it instead of relying on a side effect of the
old behavior of `_getValue`.

Part-of: odoo/odoo#75901
2021-09-08 09:03:06 +00:00
Jérémy Hennecart bc8f4373c3 [IMP] mass_mailing(_sms): a/b testing
Manage correctly a/b testing in mass_mailing.
We can now organize a mass_mailing campaign by testing
multiple mailings for the recipients targeted (subject,
templates, design, ...)

For this a new tab on the mailing record is added to better
promote the existence of the feature.

When an user has the group to manage mailing campaign, he can
access the tab A/B Test. This tab allows to enable A/B testing
for the mailing. If there is no campaign set for the mailing,
one is automatically created allowing the user to continue
smoothly.

Once A/B testing enable, the percentage of recipients use can be
set for each mailings. Also, the user can choose the deciding factor
that will set the final mailing as winner.
In a case, the user is not in manual mode, he can set the schedule datetime
for sending the final mailing.

task-2123242
COM PR: odoo/odoo#75622
ENT PR: odoo/enterprise#20454
UPG PR: odoo/upgrade#2781

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-07 18:08:03 +00:00
Antoine Guenet d7fd94eac1 [IMP] mass_mailing: ensure sidebar remains visible when scrolling mail
When editing the bottom of a long e-mail, you can't see the top of the
sidebar's contents anymore. This addresses that problem by dynamically
repositioning the sidebar on scroll.

Task-2545445

closes #71511
2021-08-12 10:19:14 +00:00
Antoine Guenet 7ed3f3151a [IMP] mass_mailing, web, web_editor: remove scrollbar on iframe contents
Mass mailing form view currently has a scrollbar for the contents of the
editor, one for the form view itself, and one for the sidebar. In
consequence we can sometimes end up with three scrollbars side by side,
which is ugly and confusing.
This ensures the height of the iframe is always that of its contents so
there is no need for a scrollbar.

When inserting a new snippet we want to autoscroll to that snippet. That
is a complicated situation because the element we want to scroll is not
in the same document as the element we want to scroll _to_.
To address that situation, a new option is added to `scrollTo` so we can
pass it the element to scroll. It can then check if we are in the
aforementioned situation, in which case it can correct the scrolling and
apply it to the right element.
We use that option in mass_mailing to prevent the bug.

Task-2545445

closes #71511
2021-08-12 10:19:14 +00:00
Antoine Guenet 66b757b5ed [IMP] mass_mailing: restyle the mass mailing form view to full width
Currently, editing a mail feels a little claustrophobic because of the
boxes within boxes within boxes design. This commit removes the chatter
and the sheet from the form view so the mail editor can take up more
horizontal space. The chatter is then moved into one of the notebook's
tabs.

Task-2545445

closes #71511
2021-08-12 10:19:12 +00:00
Xavier Morel 0e552b96da [FIX] *: convert tip contents to t-out
Requires markup every markup-using tip content as Markup. Would be a
nice occasion to migrate everything to a markup-safe markdown I think,
especially if we could migrate the translations so we don't lose them.
2021-07-20 05:40:55 +00:00
cd403480f9 [IMP] web_editor, mass_mailing, *: add shape clipping option on images
*: tools

The ImageOptimizer option can now set shapes on images to use those
shapes as clip path and background. It uses a flexible path so that the
shape will always fit the image proportionally. We also added an html
file alongside a javascript file to semi-convert the shape from
illustrator into a usable shape for this usecase (the clip path must
have values between one and zero therefore we must do some computation
before the shape is ready to use).

Thanks to Samuel for this specific shape-converter tool and other
technical points about svgs and clip-paths.

Thanks to Mehdi for remaining development post-testing and post-reviews
and for the many fixes.

Thanks to Brieuc for the actual shape SVG files.

Part of https://github.com/odoo/odoo/pull/69179
task-2327045

closes odoo/odoo#69179

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: xO-Tx <mou@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-06-21 16:31:07 +00:00
+1 14bffd983e [REF] *: adapt code to new owl webclient
This commit adapts the community codebase to the rewriting of the
/web application in owl.

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-06-18 21:31:27 +02:00
Arthur Detroux (ard) f3d840d1a6 [FIX] mass_mailing: make editor perform cleanForSave on save
Before this commit, when editing a mass_mailing template, on save,
the editor would not tell the snippet menu to perform a cleanForSave
which it should normally do for the option to properly prepare to save.

Bug discovered while working on task-2327045
Ideally, would need to be backported but requires a different fix in the
old editor.

closes odoo/odoo#72346

X-original-commit: 639b6a55586107bd3d855d322c1102df101eb079
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-18 12:08:45 +00:00
Antoine Guenet 99ac6089e5 [FIX] web_editor, mass_mailing, mail: restore the codeview as option
HTML fields used to have a toggle button for a "code view" (which came
from the Summernote library), in debug mode. This allowed the advanced
user to edit content with jinja conditions. This was lost with the new
editor but reintroduced for Mass Mailing. As it turns out it was needed
elsewhere so this makes the code view available as a node option, and
already activates it for mail templates.
To activate the code view in an html field:
```xml
<field type="html" options="'codeview': True"/>
```

Task: 2561300

closes #71860

closes odoo/odoo#71891

X-original-commit: 0f9684677676b563a0ff2712e42cea24a2ef27bb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-06-08 16:45:58 +00:00
Antoine Guenet b386eed954 [FIX] mass_mailing: ensure mailing snippets are in same window as others
Mass Mailing needs to extend the registry of wysiwyg snippets but
couldn't do so because they didn't live in the same window. This moves
the mass mailing snippets to the top window.
2021-06-01 10:07:03 +00:00
nounoubensebia 171eea3fae [IMP] mass_mailing[_sms], tools: make mass mailing form focus on body
Make the email body take the entire space to avoid having some wasted space,
this will also make the user have more focus when designing an email.

Revamp the settings notebook page in order to give more clarity to the user,
and move some fields from the main form have been moved to this section to
have more space in the bottom for the email body.

In the mailing form, when the mailing is sent or is being sent, set fields
which are no longer useful for the user to change to readonly mode.

Add a wizard that enables the user to schedule a mailing, the schedule field is
still kept in the form for the user to be able to change the date when the
mailing is in the queue (if they want to send it sooner).

Display an action helper-style content when the email is empty, because,
currently, the user is left with a big white screen when the email has no
content which is not desirable.

Update the html_empty function to take into account style attributes to better
match the editor's void content.

Hide A/B testing fields from SMS mailing form view as these are not supported
for SMS marketing.

Task-2469409

closes odoo/odoo#68882

Ent-pr: https://github.com/odoo/odoo/pull/68882
Related: odoo/enterprise#18391
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 09:40:40 +00:00
Antoine Guenet 6ce790612c [FIX] mass_mailing, web_tour: skip a unsuitable parent for the tour tip
This makes it possible to declare an element unsuitable as parent of the
tour tip via the "o_forbidden_tooltip_parent" class.
We then apply this class to the "o_we_customize_panel" of mass_mailing's
snippets menu so the tip is applied to its parent like in saas-14.2.
Without that, the tip is hidden by the body of the mail. The reason it
was positioned in the parent in saas-14.2 is that the theme selector
wasn't in the customize panel but positioned absolutely above it.
This is an ad-hoc fix to something of an ad-hoc situation, given the
relative weirdness of the html environment (the snippets menu is in the
padding of the body of an iframe).

closes odoo/odoo#69876

X-original-commit: 58d5af5df81926af1a5715dd57f6b5c3b40b1e16
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 06:29:20 +00:00
Sébastien Geelen (sge) 1158e7f99f [FIX] web_editor, mass_mailing: remove snippets from plain text mail 2021-04-23 12:18:04 +00:00
Antoine Guenet 65800bcfa5 [FIX] web_editor, mass_mailing: restore missing html edition feature
closes odoo/odoo#69324

X-original-commit: 8e4d0c43eac15718df45b32738d7eb46be426652
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-15 14:00:39 +00:00
Sébastien Geelen (sge) 92d0713478 [IMP] web_editor, mass_mailing: activate undo/redo button in mail edition
closes odoo/odoo#68912

X-original-commit: 2b12674fcfdebf362e5bd806bc8374d82c30de82
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-07 15:44:43 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00