Commit Graph
1183 Commits
Author SHA1 Message Date
Christophe Simonis e70e5b6cf3 [MERGE] forward port branch 11.0 up to 2787de8c68 2018-05-14 16:46:11 +02:00
Christophe Simonis 2787de8c68 Revert "[FIX] web_editor: adapt test"
Was weirdly working in browser...

This reverts commit fb18de745c.
2018-05-14 15:55:53 +02:00
Christophe Simonis fb18de745c [FIX] web_editor: adapt test 2018-05-14 15:12:16 +02:00
Christophe Simonis b44c34865b [FIX] web_editor: correct js code.
Oversight of previous forward-port
2018-05-14 15:10:09 +02:00
Christophe Simonis bd2de7ae78 [MERGE] forward port branch saas-15 up to d818b516c1 2018-05-14 14:37:08 +02:00
Christophe Simonis d818b516c1 [MERGE] forward port branch saas-14 up to 5274a62037 2018-05-14 12:28:37 +02:00
Christophe Simonis 5274a62037 [MERGE] forward port branch 10.0 up to 7b1362ac55 2018-05-14 11:51:18 +02:00
Nicolas Lempereur 5bb7ffa20e [FIX] web_editor: ignore range error on Restricted
In firefox, if we have a range on eg.:

  `<input type="file">`

and we tabulate to get to it, we have the range over:

  `<button type="button" tabindex="0">Browse…</button>`

which seems to be a "virtual" element inside the `<input/>` but this
magic element is "Restricted" and causes error such as:

  `Permission denied to access property "nodeName"`

So this fix ignore errors when getting a range from current selection on
keyup.

opw-1819279
closes #24524
2018-05-14 11:16:20 +02:00
Christophe Simonis 013ce7f889 [MERGE] forward port branch 11.0 up to f2e105eeca 2018-05-08 19:08:18 +02:00
Nicolas Lempereur b739e65940 [FIX] web_editor: optimize big mail transcoding
The browser may throw an error when a big mail such as one with
hundreds thousands of tags is being transformed to have a style
more compatible with mail clients.

The error would be:
 "Uncaught RangeError: Maximum call stack size exceeded"

This happens in jquery because we hare too many nodes (there is an
ongoing issue at https://github.com./jquery/sizzle/issues/403) so this
commit replace that part by a DFS traversal over DOM nodes.

There was also an issue that not having the option "style-inline" would
still cause some style code to be ran albeit it was intended not to be
solved in 55c7d2d5b0.

opw-1841107
closes #24550
2018-05-09 12:35:40 +02:00
Nicolas Martinelli 5a1c789861 [FIX] web_editor: drag and drop
Commit 6494f51171 introduces an access token to read images inside an
email. This avoids access errors when accessing the email through a
proxy (e.g. Gmail). That implies that all images are added as
attachments.

When going through the usual media dialog, the form is submitted to
action '/web_editor/attachment/add', creating the attachment. However,
the copy or the drag and drop of an image completely fails. Indeed,
the same method `_onImageUpload` is called, but with a completely
different argument type: `attachments` is a `FileList`, not a list of
attachments.

To solve this, we only call `_onImageUpload` on a the custom `onUpload`
callback, which is not triggered during a drag and drop or a copy. Any
image included thanks to these methods will be post-processed in the
`create` method of `mail.message` (`base64_to_boundary`).

Unfortunately, it's not possible to simulate an actual drag and drop or
a copy, so we cannot add a test.

opw-1840237
opw-1840411
2018-05-08 08:58:22 +02:00
Odoo Translation Bot 71419844b3 [I18N] Update translation terms from Transifex 2018-05-06 07:03:46 +02:00
Odoo Translation Bot 98a74c613b [I18N] Update translation terms from Transifex 2018-05-06 04:11:15 +02:00
Odoo Translation Bot 370ed2b66f [I18N] Update translation terms from Transifex 2018-05-06 00:26:43 +02:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Christophe Simonis 320b631c81 [MERGE] forward port branch saas-15 up to 810603f4ef 2018-05-02 15:34:42 +02:00
Christophe Simonis 810603f4ef [MERGE] forward port branch saas-14 up to 55ce6aff10 2018-05-02 14:49:58 +02:00
Christophe Simonis 55ce6aff10 [MERGE] forward port branch 10.0 up to 79bbd1dcb8 2018-05-02 13:52:12 +02:00
Christophe Simonis a33362bb51 [MERGE] forward port branch 9.0 up to 532b11ce41 2018-05-02 11:01:38 +02:00
Lucas Perais (lpe) 472c5a4f9f [FIX] web_editor: disable button when html field loading
Commit bed33e1ca2 forgot to include the case
where the html field is in a modal

This commit accounts for that case

closes #24500
2018-05-02 09:58:04 +02:00
Odoo Translation Bot 532b11ce41 [I18N] Update translation terms from Transifex 2018-05-01 02:39:26 +02:00
Odoo Translation Bot b8112869f0 [I18N] Update translation terms from Transifex 2018-04-29 04:12:39 +02:00
Odoo Translation Bot 5ff3c03410 [I18N] Update translation terms from Transifex 2018-04-29 00:28:03 +02:00
qsm-odoo ce6f8632cc [FIX] web_editor: update summernote copy-paste feature
The copy-paste feature of summernote was messy and led most of the time
to breaking the template you were trying to edit. While it is difficult
to solve as it mostly comes from the lib itself and that the lib is in
a complicated state as Odoo had to overridde part of its internal code
for its own purposes, this commit hopes to solve the problem by updating
only the copy-paste feature to the latest summernote version.

Of course, as summernote changed a lot meanwhile, it was not possible to
just take the up-to-date summernote file. This commit refactores the
up-to-date summernote clipboard code so that it fits the old summernote
version Odoo is using.

Note: the main problems occurred while using Windows/Mac and not Linux.

opw-1837818
2018-04-27 12:28:57 +02:00
Nicolas Lempereur b6a1389b8c [FIX] web_editor: firefox remember CTRL+A selection
In firefox the range when doing CTRL+A is the first level content of the
contenteditable element, but this was not taken into account when
"remembering" the range after clicking on buttons or features of the
editor.

In chrome the selection begin with the first displayed element (so it
may not be a direct child of the editable and is taken into account in
the code).

opw-1824017
closes #24424
2018-04-26 17:06:05 +02:00
Christophe Simonis e8bf128318 [MERGE] forward port branch 11.0 up to 3ab25b60bc 2018-04-23 18:15:25 +02:00
Christophe Simonis 3ab25b60bc [MERGE] forward port branch saas-15 up to cae950e826 2018-04-23 17:59:59 +02:00
Christophe Matthieu e94702d8b9 [FIX] web_editor: wrong display of the link buttons (btn) in outlook 2013
The css generates all the attributes separately and not in simplified form.
In order to have a better compatibility we simplify the css tags.
e.g. border-left-style: none; border-bottom-s .... will be simplified in border-style = none

We convert the link.btn into a table to have a good rendering in outlook, and revert the
change when the user edit the content.
2018-04-23 16:44:57 +02:00
Christophe Matthieu db37f9c4ef [FIX] web_editor: wrong display for td in Apple Mail
the td are displayed with wrong background color if the td tag is empty
2018-04-23 16:44:57 +02:00
Christophe Simonis 0bf642cb27 [MERGE] forward port branch saas-14 up to 2bc3fd89f2 2018-04-23 14:47:23 +02:00
Christophe Simonis 2bc3fd89f2 [MERGE] forward port branch 10.0 up to 2d12ae3202 2018-04-23 14:39:41 +02:00
Christophe Simonis 2d12ae3202 [MERGE] forward port branch 9.0 up to c9e7433c23 2018-04-23 14:07:12 +02:00
qsm-odoo 61c32429a6 [FIX] web, web_editor: restore report edition feature
Since 11.0, reports could not be edited at all anymore. This is due to
the fact the editor files were refactored but the report feature is not
correctly organized since it was merged with the 'web' app. Indeed, the
'web' app is still calling files and assets of the 'web_editor' app which
is not a dependency (but it is working as 'web_editor' is auto-installed
with 'web').

opw-1826599
opw-1834971
Closes https://github.com/odoo/odoo/issues/24034
2018-04-23 12:57:51 +02:00
qsm-odoo c9e7433c23 [FIX] web_editor: prevent crash on outside-iframe click
The editor is performing text selection check when clicking on the
window. However, when clicking outside the iframe an editor is running
in, a crash may occur as the editor was trying to check a range outside
of its environment (the iframe).

Related to opw-1837818
2018-04-23 12:56:34 +02:00
Odoo Translation Bot bc4ed6fee5 [I18N] Update translation terms from Transifex 2018-04-22 07:03:20 +02:00
Odoo Translation Bot 379b735962 [I18N] Update translation terms from Transifex 2018-04-22 04:11:42 +02:00
Odoo Translation Bot 851356bf23 [I18N] Update translation terms from Transifex 2018-04-22 00:28:35 +02:00
Odoo Translation Bot 6ff8eeea36 [I18N] Update translation terms from Transifex 2018-04-20 11:22:41 +02:00
Christophe Simonis fed775bc0c [MERGE] forward port branch 11.0 up to 8c64159b88 2018-04-18 18:20:40 +02:00
Christophe Matthieu b26ad79a8c [FIX] web_editor,mail: send email's attachments without write access
Before this fix, when a user don't have write access on a document, he
can't send an email with attachment because, the attachments is added on
the document.

The change improving security was introduced by the commit:
https://github.com/odoo/odoo/commit/6494f511718893eec3573c60c0a62e04d386359d

With this fix, for mail, the attachments is added on the
'mail.compose.message' and re-render the fields attachments displayed in
the current view. This change respect the access rules like all others
attachment of 'mail.compose.message' (can send an email when the user have
read access on the document).
The media dialog of the html widget display all documents attachments and
the added attachments Allowing users to use these in the body of their
message.
2018-04-17 09:26:06 +02:00
Christophe Simonis 5f2d080cf8 [MERGE] forward port branch 11.0 up to ad825b673b 2018-04-16 18:34:56 +02:00
Christophe Simonis ad825b673b [MERGE] forward port branch saas-15 up to bfa5af45df 2018-04-16 17:10:23 +02:00
Christophe Simonis bfa5af45df [MERGE] forward port branch saas-14 up to aab0908818 2018-04-16 14:21:00 +02:00
Christophe Simonis 412501a5dc [MERGE] forward port branch 10.0 up to 7147622665 2018-04-16 11:18:08 +02:00
Odoo Translation Bot 4bc2581521 [I18N] Update translation terms from Transifex 2018-04-15 04:12:33 +02:00
Odoo Translation Bot 2901c0f0e5 [I18N] Update translation terms from Transifex 2018-04-15 00:29:26 +02:00
Nicolas Lempereur 2b380e4e39 [FIX] web_editor: indent just a line inside table
Inside the cell of a table, indenting had several behaviors:

- if the selection is contained in several nodes elements: indent the
  element child nodes of common ancestor

- if the selection is contained in one or more list items: indent these
  list items

- if the selection is contained in one 'content block': indent the whole
  cell content

The two first behaviors are expected, but the third one is a little odd
and unexpected next to other existing editors behaviors.

With this commit, the third behavior becomes:

- if the selection is contained in one `content block`: indent this
  content block

note: 'content block' is defined as p, pre, h1, h2, ..., blockquote, td

opw-1824647
closes #24182
2018-04-12 10:10:05 +02:00
Martin Trigaux 8b8815f44c [FIX] http_routing: translate without website
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).

In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`

This commit fixes two bugs:

1. Install `website_sale`, activate discussion on products
  -> the chatter is not translated as the portal translations not loaded in the
     `/website/translations` controller

2. Install `helpdesk` but not `website`, go to portal view of a ticket
   -> the heldesk chatter is not translated as the `/website/translations`
      controller is not called (only provided by the website module)

This patch implements a modular approach to translate the web resources of the
right modules only.

The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module

Closes #23618
Fixes #23610
2018-04-11 16:55:14 +02:00
Romain Derie 474f6cfdd8 [FIX] web_editor: changes lost on forward port of 744af2db
Fix of 744af2db that got lost during forward port, this is just rewriting the
diff for the new widget syntax.
2018-04-11 15:02:11 +02:00
Odoo Translation Bot d9f7490f55 [I18N] Update translation terms from Transifex 2018-04-08 04:13:24 +02:00