Commit Graph
2711 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
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
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
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
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
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
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
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
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
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
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
Alexandre Kühn 9ea5aecee8 [FIX] mail: receive message then delayed needaction notifications
Before this commit, when a user received a needaction notification
on a message already stored locally, it crashed with this error:

`TypeError: Cannot read property 'getThreadIDs' of undefined`

This is caused by `addMessage` returning a Promise not resolved with
the message when the message is not new. The returned promise should
always be resolved with the message, in order to be consistent.

closes odoo/odoo#35724

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-14 12:56:27 +00:00
Alexandre Kühn 52ad807817 [FIX] mail: no crash on opening chat window twice
Revision on https://github.com/odoo/odoo/commit/e8f7770a13d6ddc1cb8ec1bcebcb22e21962ba52

Commit above fixes an issue with chat windows being open twice.
It fixed the issue by aborting opening a chat window in case a
chat window is already being open.

Opening chat window may be a slow process, due to requiring fetching
some messages beforehand. This operation is necessary in order to
check whether the user has access to messages or not, and prompt an
error message without opening the chat window in the latter case.

The fix did not respect the specs of the method `openThread`: it
pre-emptively returned nothing, instead of returning a resolved
promise. Because of this, it crashed on `undefined.then()`.

Task-ID 2053095

closes odoo/odoo#35722

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-14 12:03:46 +00:00
Kaushalya Mandaliya 2ba725df61 [FIX] mail: hide activity menu dropdown on activity icon click
Before this commit, The dropdown menu remained open after clicking on
activity icon.

After this commit, The dropdown menu is closed whenever the activity
icon is clicked.

Task-Id: 2047408

closes: #35568

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-14 12:16:28 +00:00
asa-odoo dad863d305 [FIX] mail: send message button not working in channel
Before, If direct chat or channel has no any message in chat history, then
send button is not clickable in discuss.

Now, fix in scss file will allow to click send button for channel and chat.

Task : 2037292

Closes #35570

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-14 11:00:19 +00:00
Christophe Simonis b2872e9bab [MERGE] forward port branch saas-12.3 up to 499d3efa7c 2019-08-13 10:08:12 +02:00
Alexandre Kühn a72b23f6b5 [FIX] mail: register thread window after append in DOM
Before this commit, we may have the following error:

`TypeError: Cannot read property 'html' of undefined`

This happened in the following scenario:

Terminology:
- in multi-tab environment, there is a master tab and slave tabs
- master tab fetches notifications from the server and forwards them
to slave tabs

State:
- 2 logged-in users: Michell & Marc
- Mitchell has open 2 browser tabs
- Mitchell has a pinned private conversation with Marc

Steps:
- Mitchell has focus on a slave tab
- Marc posts several messages to Mitchell in very quick succession

=> Mitchell gets crash error above.

This issue is caused by chat window being registered in mail manager
while it has not been mounted to DOM. On receiving 2nd new message,
it has to re-render chat window header in order to update displayed
unread counter. However, this fails due to chat window having no DOM
node yet.

This commit solves the issue by mounting chat window to DOM before
being registered in mail manager. That way, on receiving 2nd new
message, it does not trigger a re-render on chat window that
is about to be mounted to DOM, since it has not been registered yet.
Note that the displayed unread counter will be correct, because it
uses the up-to-date unread counter on mount.

Task-ID 2050108

closes odoo/odoo#35601

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-12 08:31:15 +00:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Alexandre Kühn 964efa3026 [FIX] mail: keep notification on receiving new messages from document
Revision on https://github.com/odoo/odoo/commit/17bb0ca443f54bc231b03794e776bbc6992ffdfa

closes odoo/odoo#35497

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-06 13:06:42 +00:00
Debauche Stéphane 2450a36108 [FIX] mail: mention a channel from a channel
Before this commit, when mentioning a channel from a channel,
it crashed with following error:

```
TypeError: unhashable type: 'list'
```

This commit fixes the issue by providing a list of channel ids,
instead of a list of `[4, channelID]`, when mentioning channels.

closes odoo/odoo#36359

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-03 15:24:17 +00:00
50464f5461 [IMP] web,mail: kanban progressbar: filter on falsy value
This rev. makes the part of the progressbar corresponding to falsy
records 'alive': the user can now click on it to filter on records
whose value is false for the progressbar field.

Task 1952430

closes odoo/odoo#35100

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-09-02 08:53:42 +00:00
Julien Mougenot 91ea5a2ca4 [REF] web,*: native event dispatching in test utils
*: mail,partner_autocomplete: adapted tests

Added a new function to trigger the adequate type of event on
an element (native JS event to DOM Nodes and jQuery event to jQuery objects),
and refactored the generic event-triggering functions to call this new function.
2019-08-26 07:36:28 +00:00
Parth ChoksiandMohammed Shekha 3e12c3251f [IMP] mail: pass systray activity menu in activity preview template
This commit passes systray activity menu as `self` in the qweb
context of the template of activity previews.

Task-Id 2034580

closes odoo/odoo#35248

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


Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-23 15:41:06 +00:00
Christophe Simonis 7d04dc1c7c [MERGE] forward port branch saas-12.2 up to 9e74730a26 2019-08-06 18:48:24 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Martin Trigaux 6ee3950bcf [FIX] mail: display 💔 in messages
The emoji was displayed in the list of choice but was not correctly rendered
when sent to the server.
Similar to 0e3d5941da but for broken heart

closes odoo/odoo#35367

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 07:22:03 +00:00
Christophe Simonis 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +02:00
jem-odoo dc066a54f1 [FIX] mail: context to read follower
As the 'allow_company_ids' are now depending on the context and impact
the access to some data, we need to provide them to some controller
(route). Json route auto-pop the context when given (0322f77279)
into the environment. In the 'read_follower' route, the `check_access_rules`
raises when you want to access a document of another company (even if
this one is in your allowed companies), simply because their is no
'allowed_company_ids' key in the context. This context key is automatically
added when calling the `rpc` method in JS (as explain in session.js
of a5b6f31cf2).
To fix the wrong access error on followers reading, we simly have to give
an empty context when calling `_rpc` in the follower widget.

Task-1999686

closes odoo/odoo#35705

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-08-20 06:51:55 +00:00
Romain Estievenart 3ad7706560 [IMP] mail: adapt responsive rules to allow swipe
Removing these margins makes swipe on 'o_mail_preview'
nicer in enterprise without having blank spaces.

Note that these rules should be in enterprise.

Task ID : 1895453
2019-08-19 13:01:30 +00:00
Romain Estievenart f7fa3b7677 [REF] mail: MessagingMenu: extract "mark as read" code to dedicated method
This allow us to reuse this logic in enterprise when you swipe.

Note that we could have directly called the handler but the name
wasn't appropriate. So we preferred to extract some code in a
well named function.

Task ID : 1895453
2019-08-19 13:01:30 +00:00
Romain Estievenart dfa64cb7fe [MOV] mail: move dedicated mobile file 'discuss_mobile.js' to mail_enterprise
These files are moved to be able to add some new responsive features
implemented in enterprise.

Task ID : 1895453
2019-08-19 13:01:30 +00:00
David Beguin 78e6ce3c3f [IMP] website_livechat : allow to send chat request to a website_visitor
This commit allows a livechat operator to send a chat request to a
connected and available website_visitor.

A visitor is considered as connected if his last tracked website.page request
was within the last 5 minutes.
A visitor is available if he doesn't have an active livechat conversation
(mail_channel with type = livechat).
  - If another operator sent him a chat request
  - Or if the visitor asked himself to speak with an operator
    (via the normal and existing flow)

A livechat conversation is active while the visitor haven't left the conversation.
An operator cannot leave a livechat conversation, only the visitor can.

The flow to send a chat request:
  - On the visitor view (tree or form), operator click on 'send chat request'
    (button or livechat icon)
  - A empty conversation with the visitor pops up at operator side.
  - While the operator didn't send a message, the visitor won't see the conversation.
  - The operator can type a message to the user
  - If the operator close the chat without sending any messages,
    the chat request AND the mail_channel are both deleted.
    In this case, the visitor is then available to send him a new chat request.
  - If the operator send a message, at the visitor's next action
    (page navigation on pages that allows livechat, based on livechat rules),
    the conversation will pop up at visitor side, using the livechat button widget.
    The visitor won't be able to request a livechat conversation with an operator until
    he leaves the chat requested by the operator.
  - Once the visitor leaves (with or without rating) the conversation :
        - the operator is notified that the visitor has left the conversation
        - the chat request is deleted to keep the chat request table clean and minimal
        - the livechat conversation if set to inactive.
  - The visitor is now available again to send him a chat request.

This feature uses the already existing livechat_session cookie mechanism,
so no further code modification was needed to make this work.
It's directly integrated is existing livechat flow.

The chat_request model is only useful to quickly check if a visitor has a chat request
and to send the livechat conversation info to the visitor via the livechat_session cookie.

This commit also add a website_visitor banner info on discuss view :

To be able to quickly see all the relevant information of a website visitor
while talking with in discuss view, a fixed banner have been added.
Only the discuss view will benefit from this because detached chatter window
is to small to display such banner.

Task ID: 34624
PR #2028059
2019-08-19 06:33:37 +00:00
Kevin Baptiste d3a6330b2b [IMP] hr_recruitment: improve usability (back2basics)
TaskID: 2053569

closes odoo/odoo#35767

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-16 13:22:29 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Lucas Lefèvreandjbm-odoo 14bb91e9ae [FIX] mail: only show suggested partners once
In the chatter composer, suggested partners were shown more than
necessary.

1. Create a new partner;
2. Open the chatter composer to send a message
(the new partner is suggested as a recipient);
3. Re-open the chatter composer
=> the partner is still suggested, but it is already a follower now!

Task-Id 2050102

closes odoo/odoo#35604

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


Co-authored-by: jbm-odoo <jbm@odoo.com>
2019-08-14 12:11:18 +00:00
Alexandre Kühn 9269e876fd [FIX] mail: notify other tabs on document thread message post
Before this commit, most new messages added to the mail manager were
handled as if recently posted from a document thread. As a result, it
was frequently setting a new item in the local storage to notify
other tabs from these new messages.

The intent of this behaviour is to notify other tabs of newly posted
messages in a document thread, without using a longpolling
notification. That means this logic should only apply on messages
that have been recently posted on a document thread.

Sometimes, this issue was breaking the local storage on Firefox.
It showed the error message "Quota Exceeded Error" whenever `setItem`
was used, even when items were removed beforehand. The capacity of
the storage was only a few Kbs on this domain, far from reaching the
maximum capacity. We think that this error comes from the concurrent
`setItem` on multiple tabs, but this is very hard to reproduce.

This commit fixes the issue by limiting the `setItem` to the tab
that really posted the message. Tests have been adapted in order to
pass only with this fix.

note: backport of 12.2 4bde721f9

opw-2031960
closes #35588

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-09 09:21:19 +00:00
Mitali Patel a54457e04d [IMP] mail: better exception activity handling in kanban and tree
The purpose of this task is to add a visual indicator on kanban and list
views when there is an exception activity on a record. To do so, two
fields have been added on the activity mixin that determine if the record
has an exception activity and its corresponding icon.

When there's an exception activity, the next activity icon is different
in the kanban and in the list view, the icon is displayed at the end of
the column with no label.

Prefetching all activity_type_ids in compute will allow to lessen
queries (3 query for this compute) and cache may benefit to other
mail.activity.mixin computed field, like activity_state in kanban view

Task 1889379
2019-08-07 15:41:05 +00:00
mreficent 355a5dfc36 [IMP] *: fix typos in comments
closes odoo/odoo#35404

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 10:28:33 +00:00