Commit Graph
2392 Commits
Author SHA1 Message Date
Nicolas Bayet d1d3332152 [FIX] web_editor,mass_mailing: fix history in new mass massmailing
Before this commit
When creating a new mass_mailing and hitting multiples times enter, the
content was reset.

task-2985162

closes odoo/odoo#100284

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-16 14:25:48 +02:00
Nicolas Bayet 63a5822cda [IMP] web_editor: remove useless softUpdate
Remove a line that was not used.

closes odoo/odoo#100233

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-15 16:08:32 +02:00
Gorash 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Pratik Raval cc120c2141 [IMP] various: reduce wizards modal size
With this commit, the size of the following wizards will be reduced to medium:
\1 Schedule mailing (Email Marketing)
\2 Test mailing (Email Marketing)
\3 Lost reason (CRM)

taskID- 2701035

closes odoo/odoo#96500

Related: odoo/enterprise#29746
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-14 19:13:55 +02:00
Nicolas Bayet 3bd7eb1442 [FIX] mass_mailing: reset the content on switchThemes and commitChanges
In switchThemes and commitChanges, the editor was reset by directly
setting the html in the editable. This caused a mutation to potentially
set a truthy value for `odooEditor._toRollback`. As we reset the editor
content, we now use `odooEditor.resetContent` to ensure
`odooEditor._toRollback` be falsy.

task-2980550

Part-of: odoo/odoo#100009
2022-09-12 16:31:05 +02:00
Nicolas Bayet 10af6e83bf [IMP] web_editor,mass_mailing: adapt fields to use owl
- adapt the html field and mass_mailing_widget to be owl components
- adapt the mass mailing view to be an owl view

task-2898432

closes odoo/odoo#94875

Related: odoo/enterprise#30915
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-12 11:38:00 +02:00
Nasreddin Boulif (bon) 533ccf7fb0 [FIX] web[_editor]: Apply RTL position to translate button
Steps to reproduce:

  - Install Inventory
  - Open any product
  - Switch to RTL language
  - Edit the product
  - Try to translate field "Internal Note"

Issue:

  Button is not displayed correctly (nearly hidden).
  Issue also present with wysiwyg or codeview editors.

Cause:

  Applying style `right: 5px` to the button without taking into account
  if layout direction.

Solution:

  On translate button:
  - Apply direction left for side-space if RTL, else right.
  - If wysiwyg is enabled, add it after the buttons in the sidebar.

opw-2962790

closes odoo/odoo#99567

X-original-commit: 56f620ff65ca9c1e5d9a64f5280ea16fd469c87d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-05 23:51:09 +02:00
Pierre-Yves Dufays ac67e6a8df [IMP] base,{fetch}mail,l10n_it_edi,{test}mass_mailing:prevent using arch server
Prevent archiving in-use mail servers by displaying an error message that
lists where it is still used, allowing to easily identify what need to be
updated before being able to archive the mail server.

Additionally,
- prevent the use of archived server as a fall-safe
- when duplicating a mailing with an archived mail server, replace mail
server by the default one

Detailed explanation:
1. A check has been added that raise an exception when trying to connect to the
smtp server or send an email when the server is archived.
With that solution,
- testing the connection of an archived server displays an error telling that
an archived server cannot be used.
- if a mail is still sent with an archived server, mail are in error :
"Connection failed (outgoing mail server problem)"
This fail-safe ensures that no mail will be sent through an archived mail server
and that the user will get some feedback about it.

The same fail-safe for the incoming mail server has been added.

Notes:
- the connection will outlive the archiving of a mail server still allowing
to send email through the archived server until the connection is closed. But
connection are not kept for long so this shouldn't be a problem.
- it cannot be tested because the connect method return immediately in test
mode.

2. When a mail server is archived, an user error is raised if it is in-use.
The implementation relies on each module to override the method
"_active_usages_compute" in "ir_mail_server" to complete the list with
user-friendly message describing the active elements that could send mail
through the mail server. This has been implemented for:
- l10n_it_edi: server used to send e-invoice
- mail: optional server configured for template
- mass_mailing:
-- default mail server
-- active server configured for mailing

Mail server are referenced in other elements but are not active anymore, it is
just for temporary or history purpose. Those references doesn’t prevent the
archiving of the mail server:
- mail_message
- wizard survey_invite and compose_message
- res_config_settings

Task-2821516

closes odoo/odoo#91240

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-01 15:32:44 +02:00
Yannick Tivisse 20adbf2034 [IMP] mass_mailing: Migrate mailing contact list/kanban to owl
closes odoo/odoo#99153

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-30 12:44:33 +02:00
Denis Ledoux 8b91cab67f [IMP] base: remove groups_id from ir.ui.view
The goal of this revision is to get rid of the `groups_id` field of the model `ir.ui.view`.

- This feature wasn't really known or used by most developers,
   and not straight-forward to understand.
   Removing it allows one less complicated thing to learn for developers.
   Besides, thanks to odoo/odoo#95729,
   changing the behavior of the `groups=` attribute,
   we can easily get rid of this `groups_id` feature
   by simply adding `groups=` in the elements of the views
   using the `groups_id` field, it will have the same effect:
   adding the elements in the view only for the users part of the specified group.

- By getting rid of the groups_id many2many field on ir.ui.view,
   it makes possible to cache the view architecture without
   requiring to use the groups in the cache key.
   Currently, if we want to cache the view architecture,
  it would be required to use the intersection of the user
  groups with the groups_id groups of the view,
  making it costly to compute the cache key,
  therefore altering the performance point to cache the view
  architectures.

Part-of: odoo/odoo#98551
2022-08-29 22:42:50 +02:00
Sébastien Geelen (sge) d32a8c53c2 [IMP] web,web_editor,mass_mailing,sms: new dynamic placeholder
Introduce a new Dynamic Placeholder Generator
in mass mailing and SMS creation.

Using a specific character (#) in subject or via the PowerBox in body
we open a field selector popup, which can be use to select
the wanted field and enter a default value. on validation, the dynamic
placeholder will be inserted in the corresponding input/editable.

task-2154624

closes odoo/odoo#71878

Related: odoo/enterprise#30333
Related: odoo/upgrade#3766
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-26 17:16:10 +02:00
Sébastien Geelen (sge) 1a82c91524 [IMP] mail,sms,mass_mailing_*: remove dynamic placeholder tab
We remove the existing dynamic placeholder generator tab,
in mail and sms creation views.
In preparation of the implementation of a new way to generate
the dynamic placeholders

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:09 +02:00
Denis Ledoux 0501bbd62e [IMP] base: uniform "groups" in back-end view
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.

Before this revision,

in a back-end view:
 - In the Python model, if a field has the `groups` attribute set
   and the user is not part of
   the groups, the field is removed, completely, from the view.
 - In the view architecture, if a node has the `groups` attribute set
   and the user is not part of
   the groups, the node is made invisible (not completely removed, just
   made invisible).

in a front-end view:
 - if a node has a "groups" or "t-groups" set and the user
   is not part of the groups, the node is removed from the view.

So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.

In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.

closes odoo/odoo#95729

Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-08-19 19:10:39 +02:00
Nicolas Bayet 209cf112f1 [FIX] web_editor: properly remove image loading attribute
The fix that removed the loading attribute of images was targeting
the wrong method `_createWysiwygInstance`.
In 15.0, the method does have a typo (`_createWysiwygIntance`).

closes odoo/odoo#98363

X-original-commit: 7a352330094ee2e267f29d9f479b4e31e90dbec6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-18 13:47:00 +02:00
David Monjoie 4b31c2f065 [FIX] mass_mailing: update showcase snippet to bs5
closes odoo/odoo#98247

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-17 12:45:17 +02:00
Antoine Guenet 12e2f2d852 [FIX] mass_mailing: ensure no lazy loaded images on edit start
If images are lazy loaded in mass_mailing they risk not being converted
properly. This removes the loading attribute from all previously added
images when the editor loads.

opw-2850967

closes odoo/odoo#98107

X-original-commit: 3cb0f466cfa982aeb802e08ded8bdbf7b8f01220
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2022-08-12 23:37:59 +02:00
Dharmraj Jhala 3d8faf9b9d [IMP] mass_mailing: do not reset campaign while enabling a/b testing
Right now, on an existing mailing, if we enable the a/b testing and there's
already a campaign set, we remove it and add a newly create campaign that
matches the name of current mailing. Also, while duplicating a campaign, the
`ab_testing_completed` field should not be copied over.

This commit improves the behavior and only creates a new campaign if there's
not one already set on a record, and by preventing `ab_testing_completed`
from being copied.

TaskID-2653806

Part-of: odoo/odoo#77768
2022-08-12 11:28:32 +02:00
ijas ahammed 080efbb9d2 [IMP] mass_mailing: shorten action button string
This commit shortens the action button string from 'Send new Mailing'
to 'Send Mailing' in campaign form view

TaskID-2653806

Part-of: odoo/odoo#77768
2022-08-12 11:28:31 +02:00
ijas ahammed 0714966042 [IMP] {mass_mailing}_sms: add A/B Test related info in campaign
This commit adds a new group `ab_test_group` after notebook of campaign form
view, which displays A/B test related information. Below are the fields
displayed within the group:

 - ab_testing_winner_selection
 - ab_testing_schedule_datetime

They will become readonly as soon as the the A/B testing is completed.

Apart from that, this commit makes the mailing/sms mailing lines editable.

TaskID-2653806

Part-of: odoo/odoo#77768
2022-08-12 11:28:31 +02:00
ijas ahammed 87e538dd1d [IMP] {mass_mailing}_sms: update the embed tree view on campaign
This commit improves the embedded tree view of mailings, sms within
a campaign, and makes it uniform with the original tree views.

However, due to lack of space, we display the stats simply in
numeric format instead using progressbar widget.

Also, to save a bit space, if no mailing, sms has A/B testing
enabled, we hide that column.

Apart from that we have added sum for the field `sent` and average
for these fields,

- recieved_ratio
- opened_ratio
- clicks_ratio
- replied_ratio
- clicked
- bounced

TaskID-2653806

Part-of: odoo/odoo#77768
2022-08-12 11:28:31 +02:00
David Monjoie 1898b2dba1 [FIX] mass_mailing: remove noupdate on mass_mailing attachments
Part-of: odoo/odoo#95940
2022-08-11 17:56:27 +02:00
Elisabeth Dickinson 715e73b01e [IMP] mass_mailing: add padding-x option to snippets
An extra option is added in order to have control over the paddings.
Snippets using the `px-3` class have had it replaced with inline styles
and now have the padding option in the builder.

This was initially done for the media_list snippet, but it seems it's
useful for many more snippets.

Part-of: odoo/odoo#95940
2022-08-11 17:56:26 +02:00
Elisabeth Dickinson fcbcd9f2b7 [FIX] mass_mailing: properly allow global customize separator styles
This is an addition to commit 098202ba584ca6ba3544ccd00397578f5deb12ad
The design tab allows the customization of the separators' border-style
and width as well as color, but this is currently broken because it gets
overridden by the default styles of the snippet, which has higher
specificity.

Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson a559fe4aae [MOV] mass_mailing: rename, move and remove images
Old thumbnails for deprecated snippets have been removed. The
other snippet thumbnails have been grouped together in same folder.

Some images are unnecessary since the new mail builder, some are simply
not used anywhere.
The references snippet is limited to four images, adding more columns
will copy the last column's image, so no need for images 5 and 6.

The basic template doesn't allow snippets - the editor doesn't even
appear - since no snippets can be added, their images are unnecessary in
the templates image folder.
In all cases, the drag&dropped snippets, even from other templates,
use the theme_default images and not the templates' images.

Move all images in snippets_demo folder to theme_default folder

For more consistency, default images have been renamed according to
their snippet names

Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson 73160feed7 [IMP] mass_mailing: revamp of the event snippet
This snippet is now similar to the one being used in the web editor.
What was once a single event on three columns is now two events on
two columns.
The snippet's thumbnail has been redesigned to correspond to the
snippet's new design.

Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson 2815fe0807 [IMP] mass_mailing: remove data-snippet attribute on snippets
We shouldn't add a data-snippet in the declaration of a snippet,
as they are meant to be drag & dropped, the editor/right panel is going
to add that for you. We generally add them when we copy paste a snippet
definition into another view directly in our sources (ie: template)

Ref: https://github.com/odoo/odoo/pull/87059#discussion_r866903584
Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson d5c7f2b208 [IMP] mass_mailing: title snippet improved
Bootstrap text align class is replaced with inline style

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson 128e3baca8 [IMP] mass_mailing: text_highlight snippet improved
Replace bootstrap class for text alignment with inline styles
Remove Horizontal alignment on whole snippet to allow individual 
alignment on <h3> and <p> elements.

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson 14ee23fa0a [IMP] mass_mailing: text_block snippet improved
Remove unnecessary classes

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson bffada1463 [IMP] mass_mailing: showcase snippet revamped
There used to be a middle column to allow for a border between
the two columns, but this was selectable (not editable) with the mailing
builder.
`.o_no_editable` or other similar classes didn't seem to work.
Instead, the snippet has been revamped by removing the middle column and
adding a right border to the second column on each row.
This border is not yet editable in the builder, so the user cannot
adapt the width/color/style yet.

Bootstrap classes for text alignment have been replaced w/ inline styles

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson b52806fcf0 [IMP] mass_mailing: references snippet improved
Replace bootstrap class for text alignment with inline style

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson f6c49e8c40 [IMP] mass_mailing: rating snippet improved
Changed `h4` to `h3`.
Removed padding when inside another snippet which already has its own
padding.

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson 2a29f373f0 [IMP] mass_mailing: product_list snippet improved
Replaced bootstrap classes by inline styles and removed
`.o_default_snippet_text`.
Wrapping the `<a>` in a `<p>` allows the user to align the button
separately from the text.
On mobile, the columns are stacked, the paddings top and bottom are thus
moved to the columns to allow top and bottom spacing between them.

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson fd22c5f974 [IMP] mass_mailing: picture snippet improved
Replaced bootstrap classes by inline styles and removed unused
`.figure-caption` class.

Allow columns and give image `max-width: 100%`

As the "thumbnail" option (in the image's Style option) is to be removed,
the `.img-thumbnail` class has been removed from the image.

The result can be done with the "padding" option already available on
images and the "border" widget that is to be added for its border-radius
option.
It is only missing a background-color to get the same result as the
styling given with the removed `.img-thumbnail` class.

Note: The styles are directly applied to the image element but Outlook
would need the styles to be applied to a wrapping element instead.
Outlook doesn't support styling directly on images.

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson 125bf5552e [IMP] mass_mailing: numbers snippet improved
Replaced bootstrap classes by inline styles and removed
`.o_default_snippet_text` and `.s_number` classes which aren't needed.

`<h5>` is no longer supported, it's been changed to `<p>`.
Added `.o_cc` on columns to allow background color edition with builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson e4cb8959cb [IMP] mass_mailing: media_list snippet improved
Padding improvements and removal of margin-bottom as this can't be done
with the builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson cd65d800b4 [IMP] mass_mailing: image_text and text_image snippets improved
Replaced bootstrap classes by inline styles.
Added .o_cc on columns to allow background color edition with builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson 46b527f9f7 [REM] mass_mailing: footer_tag_line snippet removed
This snippet is already no longer in use.
The snippet is very similar to the call_to_action snippet

[REM] mass_mailing: title_text snippet removed

This snippet is already no longer in use.
In order to get the same result, we can use a combination of the title
and the text snippets.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson 66cc95830d [IMP] mass_mailing: features snippet improved
Replaced bootstrap classes by inline styles. Added .o_cc on columns to
allow background color edition with builder.

Mobile stacks the columns, the paddings top and bottom are thus moved to
the columns to allow top and bottom spacing between them.

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson 1789d2d505 [IMP] mass_mailing: features_grid snippet improved
Replaced bootstrap classes by inline styles and removed unused classes.
`<h4>` and `<h5>` are no longer supported, these have been changed to
`<p>` or `<h3>`.
Added .o_cc on columns to allow background color edition with builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson 577e3fc1b5 [IMP] mass_mailing: coupon_code snippet improved
Replace bootstrap classes by inline styles.
Added a <p> around the ENDOFSUMMER20 text so it can be edited with the
design-tab along with other text.
A `.o_mail_no_margin` class is added to the <p> element otherwise the
text isn't vertically centered inside the the table cell.

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson b0ba58ede3 [IMP] mass_mailing: comparisons snippet improved
Removed unnecessary classes and replaced bootstrap classes with inline
styles.
Removed `.btn-block` classes because it isn't an option supported
by the builder.
The `<li>`'s `.list-group-item` class overrides the design-tab's text
color. For this particular case, the list elements have a `<p>` added
around the text.

When selecting text inside the second block's list and backspacing,
the line would become purple and impossible to remove. This was probably
due to the text being inside a <span> inside a <p> (this issue isn't 
present in the first block which only contains <p> elements).

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson 9bdbb4440d [IMP] mass_mailing: company_team snippet improved
Placed all the columns in a single row, litmus tests approve.
Removed unnecessary classes which prevented to move columns around and
add background colors to the columns.
Also changed all `<h4>`s into `<h3>`s

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson f2cb22cab0 [IMP] mass_mailing: color_blocks snippet improved
Replace bootstrap class for text alignment with inline style

Wrapping the `a` inside a `p` and placing the text alignment on the `h2`
and `p`s allows the user to align the elements individually.

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson f8b3782b44 [IMP] mass_mailing: call-to-action snippet improved
General improvements and removal of btn-block class as this is not
an option with the builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson 9c7264fb48 [IMP] mass_mailing: blockquote snippet improved
Removed unnecessary classes and placed necessary styles as inline styles
for better support by the builder.

Removed options.js which allows to change the blockquote's style as in
the web editor, but none of the other options is well supported in
emails. Due to this change, the blockquote's cover image is removed.

Changes to text done via the Design tab in the builder weren't being
applied to text inside `<span>`, so this has been changed to a `<p>`
element in order for the changes to be applied.

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson 7eda17fd4d [IMP] mass_mailing: alert snippet improved
Structure and styling changed to allow padding X when this snippet is
not inside another snippet. Otherwise the alert block, in w-100, didn't
have any space between the edge of the email template and the block.

The "Type" option wasn't working: as all the elements can be changed
with other options anyway, the code for this one has been removed
instead of trying to fix it.

Part-of: odoo/odoo#95940
2022-08-11 17:56:19 +02:00
Elisabeth Dickinson bc48e48528 [IMP] mass_mailing: o_discount1 snippet improved and updated
Column classes have been updated and outdated classes ones have been
removed.
Paddings have been improved for better display on mobile.

Part-of: odoo/odoo#95940
2022-08-11 17:56:19 +02:00
Elisabeth Dickinson 2e3ecc52b5 [IMP] mass_mailing: header snippets improved
Previously, the social icons column could not be resized and we couldn't
change their alignment. This is now possible by removing the extra div
surrounding the social links.

A general cleanup has been done.
The order of the classes is more consistent.
Unused classes (ie: `o_mail_table_styles`) have been removed.
Text-align classes have been replaced by inline styles.

Part-of: odoo/odoo#95940
2022-08-11 17:56:19 +02:00
Elisabeth Dickinson 8db441a283 [IMP] mass_mailing: improve theme_default and default SCSS
In previous versions of templates, all the styles were needed in every
template in `<styles id="design-element">`. This is no longer the
case and it has been cleaned up to only use the styles that differ from
the "default" ones found in the  `mass_mailing_design_constants.js` file.

There was a priority problem (ex: `a.btn` inside `p` takes
`p`'s text color instead of `.btn`), this is resolved by placing the
default styling in `theme_default.css`

`theme_default.scss` contained classes that were no longer necessary or
would override styles from the builder. These have been removed from the
SCSS file and from snippets and templates where these were applied.
If the styles are needed, they should be added as inline styles.

The theme_default template was calling snippets with `t-call`
which prevented customization of the theme.
Snippets have been added in full with further customization.

task-2835454

Part-of: odoo/odoo#95940
2022-08-11 17:56:18 +02:00