Attachments that are uploaded on a record that isn't saved yet are
created with res_id set to 0. In the case of attachments linked through
a m2m rather than the usual (res_model, res_id), it means they may not
be readable afer the creation of the record, except by their creator.
Re-attaching them to the mailing / template at the end of the create()
call fixes the ownership.
Fixes#81935closesodoo/odoo#82120
X-original-commit: 05fb705f2729ffdf07ab36accda20415a44e1aa6
Signed-off-by: Olivier Dony <odo@odoo.com>
Purpose
=======
Allow users with enough access rights to disable next-day report on
mass mailing lists. The option has been added in the mass mailing
settings and is enabled by default. Mass mailing reports can also be
disabled with a "Turn off mailing reports" button in the report email
itself. Reports are enabled and disabled for all responsible.
Task-2692211
closesodoo/odoo#82430
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#81680
X-original-commit: 8d83433d463dd3d1aef321921939962883f57d68
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
A horizontal padding was applied to each media list item, making it
impossible to make the media list items full width. Full width media
list items can always be reduced by adding padding in the editor, but
the converse is not true. For this reason, this commit applies
horizontal padding 0 to each media list item in the snippet template.
task-2716398
closesodoo/odoo#81637
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When the cover snippet's image is in full width, we don't notice it's
not centered. But reduce its width and it appears at the left of its
container. There is no reasonable scenario in which this would be what
we expect so this commit centers that image by default.
task-2716399
Part-of: odoo/odoo#81637
The footer templates were using a font awesome icon for the copyright
sign, while it has a unicode equivalent, which is easier to edit and
lighter.
task-2716401
Part-of: odoo/odoo#81637
mass_mailing used to show the body_html but now shows the body_arch
field instead (and body_html only in debug mode). As a result, one demo
that had only defined body_html showed an empty field. This moves
the body_html of that demo into its body_arch.
task-2710460
closesodoo/odoo#81586
X-original-commit: a313276e7a84eac053b0b35b290e3f3132c051e2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When double clicking a number in the numbers snippet, then typing a new
number, the number line would be merge with the text underneath. This
prevents that by adding a line break in between so they aren't
considered the same line by the editor (an inline with a block as
sibling is a tricky case for edition).
task-2711644
closesodoo/odoo#81551
X-original-commit: 886af1f328a9f1664b0d3e204bf984bfee28b215
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
The wrong classes were declared for the s_blockquote and
s_text_highlight snippets in the selector of so_content_addition. As a
result, these snippets could not be inserted inside other snippets.
task-2711645
closesodoo/odoo#81550
X-original-commit: 8d05470e51b9a48d73f8ffaba4789321523b3129
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
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
closesodoo/odoo#81549
X-original-commit: 31abb63fca22c73b85912eb9ba2cf08806aab679
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
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
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
Prior to this commit, it was impossible to change the background color
of many columns (eg.: Big boxes). This was because the selector for the
option had likely not been adapted along with the snippet structure.
task-2711618
closesodoo/odoo#81538
X-original-commit: 9db006a6f2f5f1f8e6fd29ca0c0b5157988fb710
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
mass_mailing_demo has a missing space separating two classes in its
mass_mail_1 template. This restores it.
X-original-commit: a104d4279b0438a05dc4b739fbc4e95e7038e6aa
Part-of: odoo/odoo#80621
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
Whenever opening the codeview from mass_mailing and then directly
saving the document did not work.
Task-2704335
closesodoo/odoo#80899
X-original-commit: d9fe1e22b4f645f1732283ab558de170716a7434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The empty template had no thumbnail for the "select your template" tab.
This introduces a simple white one.
closesodoo/odoo#80622
X-original-commit: b1ac5a0167c0463d6d83bf4a8463a5e7432ebc21
Related: odoo/enterprise#22616
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
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
*mass_mailing_crm, mass_mailing_sale
Currently, the Mailing stat buttons have a few problems.
The business reporting smart buttons send the user to a list of linked records,
which doesn't provide much value (e.g. what is the user supposed to do with a
list of 12345 leads?). They also show wrong values depending on access rights.
The Mailing KPI smart buttons lead to a blank screen if there's no data to show.
In this commit, we add/adapt all action helpers to help users understand what is
going on. For the business reporting smart buttons we instead send users to
relevant reporting actions, so they can make sense of the data we showed before.
The values of the business reporting smart buttons are now calculated as a super
user.
We also change some domains from the whole UTM Sale Domain to only using
Source ID, which simplifies computation while staying accurate.
task-2604515
closesodoo/odoo#76798
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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
closesodoo/odoo#70859
Related: odoo/enterprise#21049
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Some stored mailing fields should use the real mailing_model_id many2one
field for triggers and not sub-fields of it. As those are not stored this
may lead to unwanted writes.
Followup of odoo/odoo#41877
Spotted during Task-2092853
Part-of: odoo/odoo#70859
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
closesodoo/odoo#80500
X-original-commit: c47bd34293aef5d3359911c3b6bf0da40288d6f5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#80208
X-original-commit: 7c17d78fbdbb64b1aa5b55f78d3202a64a85ed2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
closesodoo/odoo#79213
Related: odoo/enterprise#22202
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
This commit consolidates UTM usage across all applications.
Global purpose is to avoid having undesired side-effects, such as unlinking an
utm.source/utm.medium/utm.campaign and at the same time cascading the deletion
to various records without noticing.
SPECS
ALLOW MORE PEOPLE TO CLEAN UTM RECORDS
Currently, not even the system administrator can delete utm.mediums and
utm.sources (he can only delete campaigns).
These were considered as "technical records", but allowing some cleanup is
a good idea since these records are often automatically generated and can
create a lot of unnecessary noise in the database.
That's why we now allow the following groups to delete all UTM records
(sources, mediums and campaigns):
- group_system
- group_mass_mailing_user
- group_social_manager (enterprise)
PREVENT DELETION
For some use cases, removing an utm.source/utm.medium/utm.campaign would
cascade delete the related record, which was unintended / hidden side effect.
These combinations were secured by preventing to unlink:
- mailing.mailing source_id field
Trying to delete the utm.source will throw an error message
- mailing.mailing medium_id field
Trying to delete the utm.medium will throw an error message
- hr.recruitment.source source_id field
Trying to delete the utm.source will throw an error message
ADDING CLEAN ERROR MESSAGES
When trying to delete an UTM record that is linked with ondelete="restrict", we
improved the error message to give a clear explication to the user, e.g:
"You can't delete these UTM sources as they are linked to the following
mailings in the Mass Mailing APP, and deleting the source would break the
statistics: Newsletter"
SPECIFY 'ondelete' strategy
For a lot of uses of sources/mediums/campaigns, the 'ondelete' strategy was not
specified, leading to the confusion of "is this really how we want to handle
this?".
A lot of ondelete="set null" have been added in various field definitions to
ensure that this is the desired and logical strategy we want for that
specific model.
PREVENT REMOVING HARDCODED UTM RECORDS
In some functional flows, UTM records are hardcoded using their direct
record reference.
This is notably the case for the recruitment process and its creation of
aliases, and for the Email / SMS Marketing flows.
As deleting them would break these flows, we prevent their deletion in a
"api.ondelete" method.
ENFORCE NEW RULES WITH TESTS
A lot of python tests have been added to make sure we enforce the decisions
taken here above.
LINKS
ENT PR odoo/enterprise#19048
Task-2459480
closesodoo/odoo#72239
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#79934
X-original-commit: 112f3776985fbe8f5291cd4d26424f6c427ff36c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When mailings have no responsible, KPIs emails are broken as there is no
from and to on the mail. This leads to mails being invalid and set in
exception.
Moreover currently author and from / to of those D+1 emails are not coherent
as author is current user (generally odoobot as this is generated through
a cron) while from and to are based on mailing responsible.
In this commit we make statistics emails more coherent
* when a responsible is set on the mailing: author, from and to are linked
to the responsible;
* when there is no responsible, current user is set as it may be sent by
regular people;
* reply-to is set to company email as it is often the case with 'marketing'
emails;
Task-2686586 (Repair mailing statistics email)
X-original-commit: 95a21ca16f560cf4341c547f6bc909d3261acd1b
Part-of: odoo/odoo#79877
When there is an issue updating mailing state (concurrent access, or some other
error that may happen), mailing statistics emails may be sent in loop. As we
do not think timing is so important, we now use the email queue to send
statistics emails.
Task-2686586 (Repair mailing statistics)
X-original-commit: f78ac45c2eafc3cf6b213e1f1608e76e243bd8d2
Part-of: odoo/odoo#79877
Currently if someone replies to a mass mailing email, then performs a click on
tracked links, final trace status is set to opened. Indeed both reply and
click set the trace as opened, as replying or clicking imply opening the
mail.
Update is the following
* user replies -> set status to open, then set status to reply, and update
open_datetime and reply_datetime;
* user clicks -> set status to open, then update click_datetime;
In the end the trace is left as opened while it is replied, with a click
datetime attached to the trace. To avoid unnecessary status update, a trace
is set to opened only if it is not already opened or replied. Other statuses
should not override themselves.
Task-2692316
X-original-commit: ce88d364369c8b58256e8d93b7cb506a2c262a34
Part-of: odoo/odoo#79877
Recently some "de-t-rawify" [1] was done through Odoo. A change in digest
layout broke mailing statistics. Indeed mailing statistics are build on digest
main layout to re-use it. In mailing case a ``kpi_name`` value was missing when
rendering statistics columns, leading to a crash. This is now fixed in both
mailing and sms marketing.
In this commit we also add tests for statistics emails (D+1 KPIs) rendering
for both mail and SMS marketing mailings. Email details are also tested
in order to better highlight future changes and tweaks in email sending
linked to D+1 KPIs emails.
Task-2641394 (Digest emails sending improvement)
Task-2582128 (Digest onboarding and usage improvement)
Task-2686586 (Repair mailing statistics email)
[1] odoo/odoo@c56e8c9f5a
X-original-commit: c9905ceb3172d8e80e3aff4ae9bc925dcb6b6519
Part-of: odoo/odoo#79877
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
closesodoo/odoo#79645
X-original-commit: 1c21e2d6fa3c25d2a920902ebecd19f6229b56d8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
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/120c88a6fffc111afba734c60eb06cf0543c1760closesodoo/odoo#79719
X-original-commit: 940ac7a6c0d54e9ef8a89b0dc74b892209e1c125
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
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>
closesodoo/odoo#78645
X-original-commit: 8aa5c39c0ba84a4e5bdb27ff6d70a43ad90ae4af
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
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/77312closesodoo/odoo#78413
X-original-commit: af6785599358d2dcb9ff811afc2e558a94d9704d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When writing on more than one record (e.g. via
_process_mass_mailing_queue cron)
X-original-commit: b18614bf99df47de77650f431e2062b8d2eacd06
Part-of: odoo/odoo#78259
Before this commit:
- UTM campaigns are accessible for all internal users, but with email
marketing related modules installed, if user who does not have rights
for email marketing tries to access the campaign, an AccessError is
raised. It's because few fields related to email marketing are added
in model `utm.campaign` which are accesible only to the marketing
users.
- When the user is having `mass_mailing.group_mass_mailing_campaign`
group enabled but no rights for email marketing, the root menu of
for the 'Email Marketing' app is visible to that user, which is
not correct.
With this commit:
- While adding marketing related fields to the campaign, we provide the
group("mass_mailing.group_mass_mailing_user") at field level whenever
neccessary so it doesn't raise AcessError. Also, we show those fields
on the campaign views only when `mass_mailing.group_mass_mailing_campaign`
group is enabled for the user. To do this, a compute field has been
introduced to make sure that user has rights to access email marketing
as well as the feature to manage mass mailing from campaigns is enabled.
The reason behind introducing a new compute field is, at view level,
it is not possible to check that user is having multiple groups.
- We've applied the group "mass_mailing.group_mass_mailing_user" on the
root menu of Email Marketing app, so if the user has UI only group
"mass_mailing.group_mass_mailing_campaign" and but no rights for
email marketing, the root menu won't won't appear.
TaskID-2417993
closesodoo/odoo#74113
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: mass_mailing, website, website_sale
Before this commit, it was impossible to add `fa-fw` directly on a
`we-button` as it would make the icon half invisible, since the whole
`we-button` would have the font-awesome `.fa-fw` css rule applied on it;
width: ~1.28em.
Then, one would need to insert a `<i/>` tag inside the `we-button` for
it to work.
This commit improves that behavior by handling automatically such cases,
and will preserve the purpose of the `fa-fw` class which is to have a
fixed width for those icons.
Note that the util class introduced in [1] (o_we_button_icon renamed
here in o_we_icon_button) is still useful to handle the case of svg
images, they are not allowed to shrink, the same way the fa buttons are.
[1]: https://github.com/odoo/odoo/commit/e4233643b93b521454cc146c6a2ae876781fb9ba
Related to task-2172311
closesodoo/odoo#77980
X-original-commit: e8ab9d76b802e80bb386812e4c8566825cbc2c92
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
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
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
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
This commit is there to be reverted in master. It temporarily restores
templates previously removed so as not to break migrations.
- 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
task-2554899
X-original-commit: d49b1942d33a222ac9159e76f7931cb89a85016f
Part-of: odoo/odoo#77724
This adds a series of CSS styles to the `<head>` of mailings in order to
ensure better mail client compatibility.
task-2554899
X-original-commit: ace475defca0c143d707f7b53d9f19a9db6cfe3e
Part-of: odoo/odoo#77724
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