Commit Graph
7710 Commits
Author SHA1 Message Date
Jinal Patel 8f44c85932 [IMP] mail: increase font size of exception warning
task-2071103

closes odoo/odoo#36814

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-13 07:36:36 +00:00
Julien Castiaux 760ab74f83 [FIX] *: replace openerp addons import by odoo
Importing addons using the `openerp` anchor is depreciated by #36597
2019-09-16 09:31:38 +00:00
Odoo Translation Bot e80b81dca1 [I18N] Update translation terms from Transifex 2019-09-15 01:30:37 +02:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
Thibault Delavallée 93c6f77799 [FIX] mail: remove channel and partner default context keys when creating followers
Purpose of this commit is to avoid conflicts when creating new followers
with existing context keys. Indeed some actions may propagate a default
partner id or channel id that is not wanted. Example if when inviting someone
on a slide.channel in eLearning, a default_channel_id is set in context
that clashes with follower creation, thinking it is a mail.channel.

Task 2067872 (eLearning internal testing)
PR #36756
2019-09-13 10:05:15 +00:00
Sébastien Theys c8f2924c66 [IMP] mail: use _message_log_batch in create
For 1000 records, these specific lines take:

- 2.1s before the commit
- 1.2s after the commit

Almost 2 times faster.

PR: #36654
Part of task-2070602
2019-09-12 08:45:51 +00:00
Sébastien Theys 665c1035fc [IMP] mail: call _add_default_followers only once in create
There was no reason to call the method many times in the loop as its result
does not depend on `vals_list`.

PR: #36654
Part of task-2070602
2019-09-12 08:45:50 +00:00
wan ef94a64754 [FIX] mail: bad indentation
The indentation leaded to
UnboundLocalError: local variable 'attachement_values_list' referenced before assignment
2019-09-06 11:50:23 +00:00
Denis Ledoux 0e028de72e [IMP] api: lazy_property for user, company, companies
These variable are not supposed to change within a same
environment.

The lazy property will compute these variables only
once, then store the result,
while the property were computing these variables
each time they were called.

e.g. for a 1000 iteration loop,
with `env.company`,
the company was computed 1000 times.
With a lazy property, the company will be computed one time only.
2019-09-11 07:55:17 +00:00
Martin Trigaux 6c7c97a6b6 [FIX] mail: add missing sports
If you accept soccer, accept running and biking

closes odoo/odoo#36627

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-10 12:56:08 +00:00
Martin Trigaux 68c753af55 [I18N] *: export saas-12.5 source terms
Still without demo data

closes odoo/odoo#36559

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-10 08:58:33 +00:00
Martin Trigaux 27a59776ca [FIX] mail,website_twitter: typos, wording
Courtesy of translator team
2019-09-10 08:58:33 +00:00
Shreya Modi b7c717d959 [IMP] mail: change in mailing failure icon
Currently, mailing failures are using 'fa-envelope-o' (light design)
while SMS failures are using 'fa-comment' (solid icon). To align them,
and make the mailing failures more visible,  we change fa-envelope-o
to fa-envelope.

task-2063188

closes odoo/odoo#36397

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-04 05:27:47 +00:00
Odoo Translation Bot 0d51520083 [I18N] Update translation terms from Transifex 2019-09-08 01:29:12 +02:00
Alexandre Kühn 66a0836974 [FIX] mail: odoobot onboarding canned_response_ids
Before this commit, when user follows odoobot chat onboarding and
sends a canned response at the canned response step, odoobot did
not validate the message with the canned response.

This is caused by RPC `message_post` that filters out values that
are not message fields, such as `canned_response_ids`.

This commit fixes the issue by adding a non-stored field
`canned_response_ids` to `mail.message`. This requires the reverse
relation too, `message_ids` in `mail.shortcodes` (= the model for
canned responses).

Task-Id 2058455

closes odoo/odoo#36411

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-04 13:03:20 +00:00
Alexandre Kühn e7aff236b8 [FIX] mail: no message attachment delete in discuss and chat window
Delete attachment from message makes only sense from chatter.

Task-Id 2058455
2019-09-04 10:29:07 +00:00
Thibault Delavallée 3d034dafc6 [FIX] test_mail: fix some ordering issues in tests
In resend wizard tests

In some cases tuple comparison of states seems to fail. Indeed order seems
to change in some cases depending on installation order. With this commit
we correctly check partner / notification status one by one, avoiding
to rely on order / set length that is not guaranteed.

In mail gateway tests

Add a specific order on name to be clearer about what we mean when fetching
users as a fallback, until better heuristic. Using name is sufficient as
we have no need to rely on complex partner display_name.

Task 2060220 (testing SMS integration)
2019-09-04 08:34:24 +00:00
Christophe Simonis 51354fadb0 [MERGE] forward port branch saas-12.3 up to 50e571acf7
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-11 09:39:33 +00:00
Odoo Translation Bot 71cc792c94 [I18N] Update translation terms from Transifex 2019-09-08 06:21:59 +02:00
mgh-odoo 1086b6403c [FIX] mail: activity type "Default User" field shown twice
Also moved "Default Description" before "Scheduled Date"

Task-Id 2056407

closes odoo/odoo#35882

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-03 08:22:33 +00:00
Odoo Translation Bot 4af010bdec [I18N] Update translation terms from Transifex 2019-09-01 06:24:20 +02:00
Jorge Pinna Puissant 92990ad30e [FIX] i18n: missing Slovenian translation
Slovenian language, as many others languages, is not present in the
beta/master projects in Transifex.

For some reason, Transiflex removed all current translations, this was
already fixed in 12, but as there are not automatic forward-port for
translations, this is a manual forward-port.

opw-2060055

closes odoo/odoo#36374

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-03 11:32:39 +00:00
Christophe Simonis 7a548569c6 [MERGE] forward port branch 12.0 up to 638eac9bae 2019-09-04 19:32:26 +02:00
Christophe Simonis 4528f75cb0 [MERGE] forward port branch 12.0 up to 82c0e9b620 2019-09-03 12:41:08 +02:00
Christophe Simonis 149d782a0e [MERGE] forward port branch saas-11.3 up to 79ff916b59 2019-09-02 19:57:25 +02:00
Christophe Simonis 79ff916b59 [MERGE] forward port branch 11.0 up to 61a85ccf8f 2019-09-02 19:37:06 +02:00
Richard Mathot ed90ad0a01 [FIX] mail: restore "pencil" icon behaviour in Followers widget
When editing the followers, the "pencil" icon that leads to the edition
of subtypes should be displayed only when "debug" mode is activated.
This commit restores this behaviour, as it was not the case anymore.

`has_group()` looks for static groups stored in database, whereas
`base.group_no_one` is dynamically added/removed depending on the flag
`debug` of the request.

We thus use `models.user_has_groups()` that adapts on the `debug` flag.

opw-2055848

closes odoo/odoo#36327

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-09-02 11:57:54 +00:00
Odoo Translation Bot 432b50bd1b [I18N] Update translation terms from Transifex 2019-09-01 03:48:01 +02:00
Alexandre Kühn ad03cac07a [FIX] mail: channel notification messages are never marked as unread
When a user either joins and leaves a channel, it posts a message of
type 'notification' with either action as content.

Before this commit, such messages above were incrementing the unread
counter of the channel. As a result, the messaging menu was showing
this channel as unread with this message.

Messages of type 'notification' should never increment the unread
counter of channel.

This commit fixes the issue by preventing new messages of type
'notification' to increment the unread counter of a conversation.
This should also prevent increasing the counter of the messaging
menu, in addition to highlighting this channel as unread from the
messaging menu.

Task-Id 2059515

closes odoo/odoo#36293

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-30 15:18:05 +00:00
Christophe Simonis 641358892f [FIX] mail: adapt mobile test to new version
Oversight of previous forward-port.
2019-09-02 13:36:19 +02:00
Christophe Simonis 545e6d2034 [MERGE] forward port branch 12.0 up to 52f6e38cea 2019-08-30 17:20:28 +02:00
Alexandre Kühn 1d766c067d [FIX] mail: keep ratio of img in message with inline dimensions
Before this commit, when a message body contains a big image with
inline dimensions, the image was stretched.

For instance:

- `<img width="4096" height="2304">`
- on 1080p screen in the discuss app:
- max-width for image: 1542px
- image ratio: ~ 1,78
- expected height: 867.38px
- actual height: 2304px

This issue had been fixed[1], but was reintroduced[2].

Note that this fix only works when inline dimensions are set as attr
of the `<img>` tag. It won't work with dimensions attached as inline
styles (e.g. `<img style="height: 4096px; width: 2304px;>`), due to
high CSS specificity of inline styles.

[1] https://github.com/odoo/odoo/commit/e7bc4e9703954fa952f24b4f96e75dc4299bbb28
[2] https://github.com/odoo/odoo/pull/15542/commits/46699c5214229ea8aebcc04e08d0786fd2b67f35

Closes #36227

closes odoo/odoo#36243

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-29 14:50:49 +00:00
Christophe Simonis 8bd6a93c74 [MERGE] forward port branch saas-11.3 up to ede253f1b2 2019-08-29 16:45:15 +02:00
Christophe Simonis ede253f1b2 [MERGE] forward port branch 11.0 up to d61873ac4a 2019-08-29 15:22:51 +02:00
Odoo Translation Bot 72fff6ae7e [I18N] Update translation terms from Transifex 2019-09-01 01:39:46 +02:00
Florimond Husquinet (fhu) 55d1c66c8e [FIX] mail: parse message with invalid html as content
Before this commit, when a message contains invalid HTML, it crashed
with error such as: "TypeError: Cannot read property 'childNodes' of
null".

This commit fixes the issue by wrapping the content of messages with
invalid HTML in a `<pre>` tag.

OPW-2048140

closes odoo/odoo#36196

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-29 08:19:57 +00:00
Alexandre Kühn 75e8342e81 [FIX] mail: composer in mass_mailing channel (mobile)
Before this commit, a channel in mobile with option "Send messages
by email" had no composer when opening in mobile.

This issue happened because channel views in mobile are in fact chat
windows. Chat windows with such channels do no display any composer,
which is intended in desktop.

This commit fixes the issue by enabling the extended composer for
chat windows with email channels, just for mobile.

opw-2059468

closes odoo/odoo#36120

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-08-27 14:51:28 +00:00
Alexandre Kühn 40b57ca824 [FIX] bus, mail: correctly synchronize document chat windows
Before this commit, there could be an infinite loop when changing
the chat window state of a document chat window.

This is caused when mutiple tabs overwrite the chat window state
with a different value everytime, resulting to an infinite loop.
Accross multiple tabs, `setItem` and `onStorage` are not synchronous.
That's why tabs should communicate through local storage events
instead of actual value in the local storage.

To illustrate the issue, suppose there are 2 tabs (T1 and T2) with
one document chat windows (C) and the following user interactions:

     -  T1 and T2 both have C open
     -  on T1, user folds C
     -  on T2, user folds C

Now let's add an example of local storage (LS) logics that could
apply from above example:

     -  T1 and T2 both have C open
     -  on T1, user folds C
    [1] T1 writes 'C folded' in LS
     -  on T2, user folds C
    [2] T2 writes 'C folded' in LS
    [3] T2 detects 'C folded' in LS (from [1])
           => T2 writes 'C folded' in LS
    [4] T1 detects 'C folded' in LS (from [2])
           => T1 writes 'C folded' in LS
    [5] T1 detects 'C folded' in LS (from [3])
           => T1 writes 'C folded' in LS
    [6] T2 detects 'C folded' in LS (from [4])
           => T2 writes 'C folded' in LS
     etc...

This scenario could have been easily prevented by not writing on
local storage when the chat window state has not changed. However,
this wouldn't fix this scenario that also introduces an infinite
loop:

    -  T1 and T2 both have C open
    -  on T1, user folds C
   [1] T1 writes 'C folded' in LS
    -  on T2, user folds C
   [2] T2 writes 'C folded' in LS
   -   on T2, user unfolds C
   [3] T2 writes 'C unfolded' in LS
   [4] T2 detects 'C folded' in LS (from [1])
          => T2 writes 'C folded' in LS
   [5] T1 detects 'C unfolded' in LS (from [3])
          => T1 writes 'C unfolded' in LS
   [6] T2 detects 'C unfolded' in LS (from [5])
          => T2 writes 'C unfolded' in LS
   [7] T1 detects 'C folded' in LS (from [4])
          => T1 writes 'C folded' in LS
   [8] T2 detects 'C folded' in LS (from [7])
          => T2 writes 'C folded' in LS
   [9] T1 detects 'C unfolded' in LS (from [6])
          => T1 writes 'C folded' in LS
   etc...

This commit fixes the infinite loop issue:

  - by turning local storage read during cross-tab communication into
    local storage event read instead. This should prevent race
    conditions based on read/write operations in local, since their
    order is not guaranteed accros tabs.
  - by isolating document chat window state to their own local
    storage entry. This should prevent a tab from notifying a chat
    window state that it didn't change, which may also result in
    an infinite loop.

Some tests were adapted from the changes above. Also, some tests did
pass thanks to local storage being mocked by a ram storage: the
handler `_onStorage` should have been called, but it didn't because
it was registered on the actual local storage instead of the ram
storage. In order to make tests pass again, the following additional
changes were required:

  - Cross-tab bus service now exports the unique tab ID with
    `getTabId`.
  - document thread entries in local storage now track the tab ID, so
    that self-tab ignore their own local storage writes.

Task-Id 2034997

Closes #36177
2019-09-03 08:11:27 +00:00
Odoo Translation Bot 156142caf2 [I18N] Update translation terms from Transifex 2019-08-25 06:21:10 +02:00
Varun RavalandMohammed Shekha 18f52a8ffa [FIX] mail: show attachment "uploading..." in chat window
When uploading an attachment from a chat window, the label
"Uploading..." was not visible. This comes from attachment preview
being too small, thus cutting entirely the filename and the upload
progress bar.

This commit fixes the issue by increasing the size of attachment
previews in chat window, so that it takes 50% width. It also provides
more space for labels on attachment preview while uploading, by
removing the right padding for the animated "unlink" feature that
works only for uploaded attachments anyway.

Note that this commit does not entirely solve the issue: half the
width of a chat window being enough to display the icon, the file
extension, and sometimes the label "Uploading..." completely. The
width of the icon and text extension combined is always the same,
but the label "Uploading..." changes with the locale. The extra space
from the padding removal makes this label fully visible in English,
but not necessarily in other languages. The proper fix requires
re-designing the style of attachment preview, which will be done in
master.

Task-Id: 1978640

closes odoo/odoo#33638

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-23 15:09:54 +00:00
Odoo Translation Bot 5a18c8e71b [I18N] Update translation terms from Transifex 2019-08-25 01:16:15 +02:00
Odoo Translation Bot 1dd73aa822 [I18N] Update translation terms from Transifex 2019-08-25 03:08:28 +02:00
Christophe Simonis f26de445e5 [MERGE] forward port branch saas-12.3 up to 6f55fd65da 2019-08-20 12:17:04 +02:00
Christophe Simonis 6f55fd65da [FIX] mail: correct test adaptation to async version
Oversight of previous forward-port.
2019-08-20 10:42:44 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Christophe Simonis aac8e0c960 [MERGE] forward port branch saas-11.3 up to 121034f79a 2019-08-19 16:38:30 +02:00
Christophe Simonis 121034f79a [MERGE] forward port branch 11.0 up to 1e4de19cd4 2019-08-19 14:43:31 +02:00
Christophe Simonis 1e4de19cd4 [MERGE] forward port branch saas-15 up to c43de33643 2019-08-19 13:54:40 +02:00
Christophe Simonis c43de33643 [MERGE] forward port branch saas-14 up to fa26279014 2019-08-19 12:51:26 +02:00
Christophe Simonis b6deb72747 [MERGE] forward port branch 10.0 up to 2fc46a064d 2019-08-19 10:24:42 +02:00