Commit Graph
508 Commits
Author SHA1 Message Date
qsm-odoo a83f812357 [FIX] mass_mailing, web_editor: increase mail clients compatibility
Following bee3253b44, this commit is made
to increase the mail clients compatibility for the mails that are
created with the odoo mail editor.

Three new problems are handled:

- Font family of titles had to be forced too as outlook was not
  inheriting parent font family on those either.

- Default text font-size had to be forced as was not detected in
  transcoding correctly.

- text-decoration rule was decomposed in text-decoration(-line,
  -style and -color) in transcoding. Outlook is ignoring those
  three rules for some reason. As the decomposition is useless,
  the transcoder now forces the recomposition of these three rules.
2017-05-17 11:29:24 +02:00
Olivier Dony 5afe894f44 [MERGE] Forward-port saas-15 up to 878fbc75ff 2017-05-16 17:09:45 +02:00
qsm-odoo bee3253b44 [FIX] mass_mailing: increase email clients compatibility
Creating a mail template which is complex and compatible with all mail
clients is a very difficult task as each mail client supports a
different subset of basic CSS rules.

This commit fixes 3 problems which were occuring in outlook and/or
thunderbird but not in gmail:

- Main layout horizontal overflow
    -> change 24px horizontal padding of main layout to 3% and set the
       width to 94% (so that the sum is 100%)

- Fixed 600px content was full width instead
    -> Change the .o_mail_wrapper to be a <table> element instead of a
       <div> element. The table is full-width and contains one row of 3
       cells: an empty left one, a fixed 600px-width center one and an
       empty right one. This allows to have the same layout as before but
       without using the unsupported max-width css rule.

- Texts were not using the right color and font-size
    -> <p> elements were not properly inheriting the color and font-size
       properties, so force the style on <p> elements.

opw-743156
2017-05-15 15:26:05 +02:00
Aaron Bohy fc08507fdb [REF] web,*: convert Kanban widgets to new style
The remaining widgets were KanbanRecord and the two quick create
widgets. Now, all kanban files have been converted and refactored.
2017-04-11 19:44:38 +02:00
qsm-odoo b34279c89a [IMP] web, *: let kanban column and record know about modelName
* hr_attendance, hr_gamification, hr_recruitment, mass_mailing,
  project, sales_team

Before this commit, the kanban column did not know about the model
name which make customization impossible without a getParent. Kanban
records were supposed to know about this thanks to the options
parameter but this was broken. Now the model name is automatically
initialized from the given state.

Adapt all extensions which relied on this.
2017-04-11 19:44:38 +02:00
qsm-odoo 19e86c8388 [IMP] *: remove deprecated view extensions
* account, mass_mailing, sales_team

These view extensions have already been ignored for around two years.
The new views development is a great opportunity to remove them.
2017-04-11 19:44:38 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00
Jairo Llopis f1bf457803 [FIX] mass_mailing: do not remove image with link
If you followed these steps, Chrome deleted the link and image:

1. Create a new mass mailing, fill the subject.
2. Drag & drop any snippet with pictograms.
3. Change a pictogram for an image.
4. Add a link to the image.
5. Save the record.

This happen in chrome if the image was for example floating in
the link, so this change check if an element is a contained element
is visible before removing it.

This issue doesn't happen with [jQuery 3][1] and may be linked to
[this][2].

[1]: http://api.jquery.com/visible-selector/
[2]: http://stackoverflow.com/a/8337382/1468388

closes #15623
opw-710237

note: this is only needed in 9.0 and saas-11 because this features
doesn't seem present in version 10.0
2017-03-21 12:47:09 +01:00
Christophe Simonis 45045bb7a1 [MERGE] forward port branch saas-15 up to c8f01e3b62 2017-03-17 18:06:16 +01:00
Christophe Simonis b2fa9f2ad1 [MERGE] forward port branch 10.0 up to 31ebb07773 2017-03-17 17:57:52 +01:00
Christophe Simonis 31ebb07773 [MERGE] forward port branch saas-11 up to aefdf96c25 2017-03-17 17:55:30 +01:00
Christophe Simonis 5f9d382ed4 [MERGE] forward port branch 9.0 up to e542b450a3 2017-03-16 16:01:56 +01:00
Nicolas Martinelli a873890f28 [FIX] mass_mailing: link in kanban
- Go to Mass Mailing > Configuration > Mail Templates
- In the Kanban view, find a template which contains a link (http,
  mailto, whatever)
- Click on the link

You are redirected to the link instead of being redirected to the
record.

opw-706047
2017-03-14 16:19:04 +01:00
stefanorigano 707eb645ef [IMP] mass_mailing: add "basic" theme for plain text mailing
Sometimes, there is a need for mass mailing "basic" mails with no
image or style. The "basic" theme is designed for this (note that
there still is the possibility to add style and images, default
images are just gray placeholder).
2017-03-13 10:55:30 +01:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Nicolas Martinelli 2a08cbb8c6 [FIX] mass_mailing: Kanban crash on mobile view
In mobile view, the mass mailing kanban view crashes.

Commit eee1d8c159 aims to prevent drag and drop for mass mailing.
However, in mobile view, the the drag and dropd is by default
deactivated, and "sortable" is not initialized.

opw-708140
2017-02-13 08:53:36 +01:00
Christophe Matthieu d0d1c93500 [FIX] web_editor: don't remove icon from mass mailing
The witdh and height auto has apply on image, when the mass_mailing
clean_for_save is called, the image is considered as invisible because
the with is temporary null.

opw-692805
2017-01-16 11:20:30 +01:00
Christophe Simonis b3a1109372 [MERGE] forward port branch 10.0 up to c08a590bb1 2017-01-02 15:31:58 +01:00
Christophe Simonis 81f59cee2c [MERGE] forward port branch saas-11 up to b844d93889 2017-01-02 14:38:59 +01:00
Christophe Simonis b844d93889 [MERGE] forward port branch 9.0 up to 3805eb620a 2017-01-02 12:49:55 +01:00
Denis Ledoux f5d7727e2b [FIX] mass_mailing: crash with Firefox with the breadcrumb
- When opening a mass mailing
 - Editing it and making a change (e.g. add a block)
 - Click on the breadcrumb
 - Click "OK" on the warning popup telling your changes will be discarded
 - Choose another mass mailing

A crash occured. This is basically the same case than in the revision
7bf80d22dd
but for Firefox, for which `window` is still there
`!window` returns False
but is `closed`

opw-702211
2016-12-23 12:10:09 +01:00
Fabien Pinckaers c28743a220 [IMP] mass_mailing: CSS for mobile: avoid horz scrollbar 2016-12-04 20:47:20 +01:00
qsm-odoo a2d05a7087 [FIX] mass_mailing: initialize theme images on re-edition
The mass_mailing editor has a feature which switches the images of the
content and/or the droppable snippets according to the theme.
Unfortunately, this images were only initialized on theme choice and
not when entering in edit mode. So when reediting an already edited
mass mailing (or when duplicating one), the theme images were not
initialized.
2016-11-16 17:06:40 +01:00
stefanorigano 23c6c37c8d [FIX] mass_mailing: vertical alignments & multiline text
* vertical alignment: Keep ‘vertical-align: top’ as default, but
define ‘middle’ exceptions for header and footer snippets.

* ‘comparison_table’: multiline text.
Remove inline style for inner <p/> elements and define default padding
for parent <td/> instead. This will allow to create multiple line of
text keeping a coherent margin between each <td/>.
A css set of rules triggering any kind of elements allow to use
multiline text for any kind of tag (p, h1, etc..)

* Footer snippets padding, minor
2016-11-07 17:08:18 +01:00
qsm-odoo fb363b572b [FIX] *: adapt odoo interface violet
Change color #a24689 to #875A7B

Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).

Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
2016-10-05 10:29:00 +02:00
qsm-odoo 984afdf120 [FIX] mass_mailing, web_editor: set up correct iframe communication
Previous commit tried to handle iframe assets in a more standard way
but instead broke the order followed to install iframe communication.

While waiting for a more clean way to handle iframe assets and
communication, revert to old set up.
2016-09-30 12:19:46 +02:00
qsm-odoo c7e837d962 [IMP] mass_mailing, web_editor: propose installation of mass_mailing_themes
When an user starts a new mail template, he is now proposed to upgrade
to enterprise to install mass_mailing_themes.
2016-09-30 12:19:46 +02:00
qsm-odoo 8320a9aaf5 [IMP] mass_mailing: only keep one theme in community module
Only keep default theme in community module and replace old enterprise
ones with new ones.
2016-09-30 12:19:39 +02:00
qsm-odoo eee1d8c159 [IMP] mass_mailing: prevent drag and drop in kanban for mass mailing
The mailing flux is done thanks to the action buttons in form view.
2016-09-30 12:15:50 +02:00
qsm-odoo 6ee87f74f5 [FIX] mass_mailing: properly switch to right theme images
The default image inside undropped snippet had to be switched everytime
a theme is selected, even on first theme choice as the switch_theme
method only switch images of snippet already dropped in the page.
2016-09-23 11:16:16 +02:00
qsm-odoo 05205a277e [FIX] mass_mailing: force vertical align top on td/th element 2016-09-23 11:16:16 +02:00
stefanorigano 4ffe3f57a3 [FIX] mass_mailing: fix layout issue of o_mail_header_social links
Fix an issue causing a wrong icon alignment on save.
2016-09-23 11:16:16 +02:00
stefanorigano 194f13beaf [FIX] mass_mailing: refactore o_mail_block_footer_tag_line snippet
* Remove the ability to change bg-color (colours are applied to
children elements)
* Fix a layout issue in theme_resto
2016-09-23 11:16:16 +02:00
stefanorigano 3b4f976f93 [FIX] mass_mailing: review colors in snippets
* Trig default ".btn.btn-link" rather than custom ".o_mail_link" (not
used anymore)
* Define variations when a button is inside bg-beta or bg-delta
2016-09-23 11:16:16 +02:00
qsm-odoo 3f5a27e286 [FIX] mass_mailing: properly manage td/th elements
Refactore width-x snippet option and create another option to handle
cloning and removing td elements properly.

* on_focus: the handle to resize are now hidden when the td/th is alone
on its row

* on_clone: when cloning a td element which is alone on its row, it is
instead cloned in a new row. If not, empty td are added on the whole
column to maintain table integrity.

* on_remove: handle removing td in complex table
2016-09-23 11:16:16 +02:00
qsm-odoo b51e8a8a03 [FIX] mass_mailing, *: allow to auto select default text of templates
* + web_editor

The feature was only activated in the web_editor in snippet contents
(before they are dropped in the page). Now, on first theme selection,
the feature is activated in the template content.
2016-09-21 13:16:59 +02:00
qsm-odoo a430c81b79 [IMP] mass_mailing: review theme style location and convention
* Use the theme class selector as root for the less file
-> Allow to style the editor as applied to the body
-> Split in editor/color/layout/snippets

* Create an assets to contain all mm themes so that the compilation is
made by the odoo system, and allow minification and variable sharing
between themes
-> Remove css files

* Reformat the LESS files content
2016-09-20 13:52:29 +02:00
qsm-odoo edb58e6beb [IMP] mass_mailing: automatically include the o_mail_wrapper element 2016-09-20 13:52:29 +02:00
qsm-odoo 9749b93250 [IMP] website, web_editor, mass_mailing: move margin and size options
website -> web_editor so that they are available for mass_mailing.

To allow setting margins on td elements:

As the above mentionned option allows to control the mt and mb classes
on the mass mailing items, the problem is that we would ideally want it
to be functionnal on td element as they are the main part of a mail.
As they don't support margins, there were many options to fix the
problem:
- Add more JS to place the mt and mb classes on children of td element
- Place the option on children of td element and not td element itself
but in that case, the width control of td would imply a lot of parent
option hierarchy, or the width control had also to be adapted to control
children
- Control padding instead of margin. This forces to add lots of
css rules like pt4 pt8, ... (or td.mt4, td.mt8, ...).

The last solution has been chosen. Padding is more supported than
margins in mail client anyway and the css rules will be isolated in
the mail editor anyway. Using td.mt4 instead of pt4 had the advantage
to not require any JS modification.
2016-09-20 13:52:29 +02:00
stefanorigano 4f93d5c687 [IMP] mass_mailing, web_editor: improve themes/snippets/templates 2016-09-20 13:52:29 +02:00
qsm-odoo e3635494ea [IMP] mass_mailing: add default layout for mail themes
When there is no content in the mail, the user is now forced to choose
a theme. Once the choice is made, the theme introduces default content
(series of snippet to simplify user edition).

The default images are also changed when the theme is switched. To do
that, JS code was implemented so that on theme switch, all the images
are changed to check for images in the static theme folder or use a
theme related xml_id.

+ Refactore theme data management.
2016-09-20 13:52:29 +02:00
qsm-odoo 61e48b09fb [REF] mass_mailing: convert templates to themes and clean code
* Remove mass mailing template switching system (lemon, airmail, ...)
and replace it with a theme selector which only toggle a different
class on the body.
* Lint JS files.
* Change the way the editor is overridden by mass_mailing in a more
odoo way (put the JS in assets and check on runtime if it must be
applied.

+ fix editor style
+ remove useless code
+ remove odoo template
2016-09-05 17:07:31 +01:00
qsm-odoo 71b8bc7570 [IMP] mass_mailing: correctly define snippets toolbar template
* Split snippets into templates and use the t-snippet directive
* Correctly handle snippet thumbnails thanks to t-thumbnail and not
with custom css
2016-09-05 17:02:00 +01:00
Csaba Fazekas 9676ceec02 [REF] mass_mailing: change/add snippets/themes layout/design
* Airmail/Lemon/Tech template/Odoo template
* Add bg color option
* Clean snippets
2016-09-05 17:01:50 +01:00
Christophe Matthieu 1501b30c53 [REF] mass_mailing: change theme/template selection and add new snippets
* remove theme/template selection screen for mass_mailing
* allow to use different layout on edition
* add new snippets
2016-09-05 17:00:45 +01:00
Christophe Simonis de0d503421 [MERGE] forward port branch saas-11 up to f0c8224 2016-08-26 16:59:45 +02:00
Christophe Simonis 5c2025a3af [MERGE] forward port branch 9.0 up to c578fb7 2016-08-25 18:23:47 +02:00
Damien Bouvy d7939282e9 [FIX] mass_mailing: avoid too long URIs by blacklisting fields in editor call
The call to the web_editor is made through an iframe with some get
parameters. While not really a problem in itself, this has the
disadvantage of generating long URIs. In some case, since all the
fields in the views are included as a GET parameter, URIs can be
generated that go up to several thousand characters. Most servers will
return a 414 for such URIs, preventing the edition of the mail
template in the view.

To avoid this problem, this commit extends the 'html_frame' widget and
blacklist 2 fields that can get too long once encoded.

Ideally, it would probably be better to stop sending all the fields and
simply add the *needed* fields one by one, but since it's difficult to
know exactly what fields might be needed and this is stable, I'm gonna
go with this 'workaround' but conservative fix.

opw-685646
2016-08-19 17:13:34 +02:00
Christophe Matthieu 025263d3bf Revert "[FIX] web_editor: test jinja content to load editor in codeview"
This reverts commit f38f8930f0.

Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
2016-06-23 11:45:17 +02:00
Christophe Matthieu f38f8930f0 [FIX] web_editor: test jinja content to load editor in codeview
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
2016-06-22 14:26:42 +02:00