Commit Graph
1089 Commits
Author SHA1 Message Date
Christophe Simonis d4a67bbcf4 [FIX] web_editor: do not try to expose non existant widgets 2018-02-22 11:43:21 +01:00
Christophe Simonis 9a84ba5533 [MERGE] forward port branch saas-11.1 up to e750bb6e11 2018-02-22 10:39:15 +01:00
Christophe Simonis ae6a65753e [MERGE] forward port branch 11.0 up to dbb713c2f8 2018-02-21 20:19:26 +01:00
Christophe Simonis dbb713c2f8 [MERGE] forward port branch saas-16 up to 49f8548557 2018-02-21 19:17:01 +01:00
Christophe Simonis 49f8548557 [MERGE] forward port branch saas-15 up to 085ff2f9c4 2018-02-21 18:36:36 +01:00
Christophe Simonis 085ff2f9c4 [MERGE] forward port branch saas-14 up to 8c692aac88 2018-02-21 18:09:17 +01:00
Christophe Simonis eebc7b6e32 [MERGE] forward port branch 10.0 up to 1512618d3e 2018-02-21 12:42:46 +01:00
Jairo Llopis dd184b26ac [FIX] web_editor: Export classes and methods
Add various classes and methods to allow customization

Closes #23180
2018-02-21 11:50:57 +01:00
Christophe Simonis 1512618d3e [MERGE] forward port branch 9.0 up to e544ec8df7 2018-02-21 11:27:22 +01:00
Martin Trigaux ed62588318 [FIX] web_editor: correct frenglish
Courtesy of e2f translators
2018-02-20 16:24:23 +01:00
Romain Derie bcc088c348 [FIX] web, web_editor: Better email validation with regex (JS)
This commit improves link creation in web editor.

Before this commit, anything with a @​ would be considered as valid email which
is obviously not the case. It would then be prefixed by 'mailto:'.
This was causing 2 issues:
  - URL with @​ symbol in it would have 'mailto:' added as prefix, like google
    maps coordinates.
    eg: mailto:http://www.google.com/maps/whatever/@​312211.22,321321
  - Incorrect emails would go through (eg: @​@​@​, ko@​k@​k@​, mail@​mail)

Now, we will try to detect and identify valid emails from invalid emails from
URLs. It will also handle 'mailto:' directly typed in the input.

This commit comes with it's counterpart in enterprise https://github.com/odoo/enterprise/pull/1859

This closes #11984, closes #22936

Note that there is a WIP in master to use this new is_email function
everywhere we try to validate emails. It will aim to uniformize email
validation in odoo's javascript that are often performed with different mean
here and there, some more permissive than others, some only checking for @​.
2018-02-20 12:30:13 +01:00
Nicolas Lempereur 64be3521ce [FIX] web_editor: don't format xml with script tag
It happens from time to time that someone use "Format" on the
web.layout template. Thus:

```
<script type="text/javascript">
  var odoo = {
      csrf_token: "<t t-esc="request.csrf_token(None)"/>",
  };
</script>
```

becomes:

```
<script type="text/javascript">
  var odoo = {
      csrf_token: "
  <t t-esc="request.csrf_token(None)"/>",
  };
</script>
```

breaking a number of things on the frontend and everything on the
backend.

On a pure javascript content, we could wrap it with:

```
//<![CDATA[
/* javascript content */
//]]>
```

but in this instance we still want the xml to be processed.

This commit avoids formatting XML containing a script tag.

opw-815865
closes #23164
2018-02-20 12:25:54 +01:00
Odoo Translation Bot 54670bb149 [I18N] Update translation terms from Transifex 2018-02-20 09:46:32 +01:00
Martin Trigaux 5b88b1a961 [I18N] export 11.0 source terms
To reflect recent code changes
2018-02-19 15:46:33 +01:00
Odoo Translation Bot 0be75775de [I18N] Update translation terms from Transifex 2018-02-18 04:28:35 +01:00
Christophe Simonis 3b959c313d [MERGE] forward port branch saas-11.1 up to a277b58507 2018-02-15 11:52:10 +01:00
Christophe Simonis a277b58507 [MERGE] forward port branch 11.0 up to 259686ba78 2018-02-15 10:58:08 +01:00
Christophe Simonis 72508cc241 [MERGE] forward port branch saas-16 up to 7792755946 2018-02-14 18:26:57 +01:00
Christophe Simonis 7792755946 [MERGE] forward port branch saas-15 up to d24bdbde81 2018-02-14 17:18:59 +01:00
Christophe Simonis d24bdbde81 [MERGE] forward port branch saas-14 up to 9d0de61114 2018-02-14 16:34:13 +01:00
Christophe Simonis 9d0de61114 [MERGE] forward port branch 10.0 up to 73c2ac451a 2018-02-14 16:04:23 +01:00
Odoo Translation Bot 91f2209216 [I18N] Update translation terms from Transifex 2018-02-14 11:53:12 +01:00
Christophe Simonis 19a37782fb [MERGE] forward port branch 9.0 up to 2d73ea9bed 2018-02-13 19:02:37 +01:00
qsm-odoo 5e6c5d24be [FIX] mass_mailing, *: duplicating two-columns snippets
* web_editor, website

This commit fixes a bug with table duplication in mailing template:
- Click on a snippet with two columns
- Duplicate it
-> the snippet is duplicated but the two columns are transformed in two
   rows.

This was because there is an implemented behavior for column
duplication: if we duplicate a column which was alone on its row, we
duplicate the row instead. This code should however be triggered when
duplicating the column alone to be working, not the snippet that
contains it.

Note: this required a backport of a33ec972ab
which was fixing a non-critical "bug" for 11.0. This non-critical "bug" is
therefor fixed here too.

opw-807105
2018-02-13 14:19:07 +01:00
qsm-odoo 32bdadad13 [FIX] web_editor, mass_mailing: better transcode alignment inheritance
Browsers' default alignement of <td/> is 'inherit'. Some mail clients do
not set this value properly though and even if it is explicitely set,
they do not compute the final value well.

As a fix, this commit forces the 'inherit' value on <td/> and computes
the real alignment for 'inherit' values when transcoding.

opw-813688
2018-02-13 13:37:50 +01:00
Nicolas Lempereur a6e66131ce [FIX] web_editor: error on cross domain stylesheet
On latest chromium (as of version 64), accessing rules of a stylesheet
is forbidden for cross-domain.

This commit catch and ignores the error when that happened.

chromium commit: https://chromium.googlesource.com/chromium/src/+/a4ebe08c91

opw-813480
opw-815860
closes #23009
2018-02-12 18:21:00 +01:00
Christophe Simonis 0f02dcb639 [MERGE] forward port branch saas-11.1 up to c69d00157e 2018-02-12 18:08:27 +01:00
Alexandre Kühn 0de5c1f076 [FIX] web{_site,_editor}: transparent root instance 'root widget'
With this commit, any component that needs an instance of the
root widget can simply require the module 'root.widget'. Based on
the context (backend, frontend, iframe), the real root.widget
will resolve to either the webclient, the website root instance, or
the iframe root instance.

This is desirable in order for the tour_manager to become a child
of the root widget, as tours are enabled in any of the above contexts.

This commit is a requirement in order to solve an issue with JS services,
in which there should be only one service provider at any given time.
2018-02-12 16:09:37 +01:00
Christophe Simonis c69d00157e [MERGE] forward port branch 11.0 up to 169f899e29 2018-02-12 13:15:06 +01:00
Nicolas Lempereur 1c5bb8564b [FIX] web_editor: regression less editor 5af122387
In 5af12238 a change was made to have the correct hierarchy levels, but
this can cause an issue when editing less files.

This is because we now had "undefined + 1" which gives NaN which breaks
Array constructor.

opw-814579
opw-815397
opw-814322
opw-815265
opw-814021
closes #23006
2018-02-12 11:57:39 +01:00
Odoo Translation Bot 09923c7bf6 [I18N] Update translation terms from Transifex 2018-02-11 07:05:39 +01:00
Odoo Translation Bot 26468bfaba [I18N] Update translation terms from Transifex 2018-02-11 04:26:28 +01:00
Christophe Simonis 5f3301e5cb [MERGE] forward port branch 11.0 up to 20e4cd5bcd 2018-02-09 16:13:08 +01:00
Christophe Simonis 4b43803dc6 [MERGE] forward port branch saas-16 up to e2ae51c4b0 2018-02-09 15:02:31 +01:00
Christophe Simonis e2ae51c4b0 [MERGE] forward port branch saas-15 up to 6d0f63ec4e 2018-02-09 12:41:15 +01:00
Christophe Simonis 047796817c [MERGE] forward port branch saas-14 up to 3a1df2cf22 2018-02-08 18:08:52 +01:00
Christophe Simonis 3a1df2cf22 [MERGE] forward port branch 10.0 up to 1b5ecbb047 2018-02-08 17:30:08 +01:00
Christophe Simonis 1b5ecbb047 [MERGE] forward port branch 9.0 up to ce51ad7e69 2018-02-08 16:43:44 +01:00
Christophe Matthieu ae39a89a09 [FIX] web_editor: add thumbnail image to send attachment 2018-02-08 11:25:51 +01:00
Christophe Matthieu 6494f51171 [FIX] base/mail: Added an access_token on the attachments url
The access_token is automatically added by the media editor. It's added
on the website and by the html editor to send by email. The widget display
the attachments from 'ir.ui.view' (public attachment) and the attachment
from the current record.

Issue: can't load image in gmail or mobile because the client mail use a
proxy who avoid ours odoo access.
2018-02-08 11:25:51 +01:00
Christophe Matthieu 152e3f8686 [FIX] web_editor: encoding of the attachment name is missing in image src 2018-02-08 11:25:51 +01:00
qsm-odoo ce51ad7e69 [FIX] web_editor: allow deleting all images in table cells
Before this commit, it was impossible to delete an image which was a
direct child of a table cell using the trash-icon button in the
toolbar.

This commit fixes the behavior by changing the logic quite a lot, so
it is kinda tricky (see https://github.com/odoo/odoo/commit/25849e918651eba080dac3af4e4fcdc8f1280241
for more explaination).

Closes https://github.com/odoo/odoo/issues/22523
2018-02-08 10:48:14 +01:00
qsm-odoo 8dfd6a2507 [FIX] web_editor: fix image deletion and replacement
Deleting/replacing an image through summernote gave unexpected results.
As modifiying the related function may be tricky, this commit instead
wrap them to solve the specific erratic behavior: if the range is in/
matches an image, then simply remove the image and move the cursor to
its previous location.
2018-02-08 10:48:14 +01:00
Christophe Simonis da19a7701e [MERGE] forward port branch saas-16 up to 23752102a0 2018-02-07 17:47:26 +01:00
Christophe Simonis 23752102a0 [MERGE] forward port branch saas-15 up to 830327c66a 2018-02-07 15:18:07 +01:00
Christophe Simonis 830327c66a [MERGE] forward port branch saas-14 up to af8de1a3ed 2018-02-07 14:55:37 +01:00
Romain Derie b2b71efb36 [BACKPORT] website: translation if website default lang is not en_US
Before this commit:
When website default lang was not en_US, the translation of fields* in the
web_editor would not be saved correctly.
Let's illustrate with fr_BE set as main lang:

  The web_editor's RPC calls does not send language in the context when editing
  a page (6ebcc06), but it does in translation mode.
  Note that editing is always performed in the website main lang, fr_BE in this
  case.
  Therefore:
  1. When EDITING:
    The backend suppose the language is en_US as there is no lang in the
    context (hardcoded everywhere).
    It then write in the record itself instead of the ir.translation as it
    should since fr_BE is a translation. (In Odoo, every lang is a translation,
    en_US is  always the main lang)
  2. When TRANSLATING (in en_US):
    It would also write on model as the web_editor send the language to the
    backend when in translate mode. But since en_US is recognized as the main
    lang (which is correct), it also writes in the model, overriding the
    incorrect fr_BE writing which was also wrote on the model.

This has been fixed in 10.0 with these 2 commits:
036ccbe
2955bf2

With these fixes, the lang is correctly added (by the backend) if the website
module is installed.
By ensuring the lang is correctly set, the ORM _write() function will process
the edition and translation datas as it should:

  - If it receive en_US, it will write on the model
  - If it receive another lang, it will write on ir.translation

This closes #10883, closes #22403

*Not the HTML/XML fields which are handled differently by the ORM/translation
2018-02-07 13:35:03 +01:00
Christophe Simonis ae3643ba2a [MERGE] forward port branch 10.0 up to a93a9d43e6 2018-02-07 13:34:03 +01:00
Géry Debongnie a98beb13db [FIX] web_editor: correct check of 'rules' property
see issue #22517
2018-02-05 20:24:23 +01:00
remi-filament 160ddc8567 [FIX] web_editor: correct check of property 'rules'
Port of PR #22603 from v9 to v10
See Issue #22517

 (#22679)
2018-02-05 20:21:45 +01:00