Commit Graph
2722 Commits
Author SHA1 Message Date
Jairo Llopis e5f673087b [FIX] mail: Support nameless attachments
`ir.attachment` records do not require to have a filename set.

In `AttachmentBox`, a filename is always set, although in case it's missing it was untranslated. I fixed that.

In cases where `AttachmentBox` is not used but its underlying templates are rendered using other means, a user could get a client-side error like this one when browsing a record that had an attachment without filename:

<details><summary>Error</summary>

```
Error:
TypeError: dict.attachment.filename.split is not a function

https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:26
Rastreo de error:
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:26:45
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous/<@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:340:33
foreach@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:180:25
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:338:25
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous/<@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:27:31
foreach@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:180:25
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:11:23
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:20:30
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:15:31
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:11:31
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
render@https://www.tecnativa.com/mail/static/src/js/thread_widget.js:183:28
_fetchAndRenderThread/<@https://www.tecnativa.com/mail/static/src/js/thread_field.js:124:36
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3283:104
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3283:104
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
rpc/<@https://www.tecnativa.com/web/static/src/js/services/ajax_service.js:16:29
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
genericJsonRpc/<@https://www.tecnativa.com/web/static/src/js/core/ajax.js:65:18
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3283:104
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
done@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:9275:42
callback@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:9685:57
```

The error is produced when trying to render this line: https://github.com/odoo/odoo/blob/66c5053a3d1f8cb456929453a62869c95eccf86a/addons/mail/static/src/xml/thread.xml#L506

</details>

This patch ensures all attachment has a filename, and fixes that problem.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
@Tecnativa TT19555

closes odoo/odoo#37546

Forward-port-of: odoo/odoo#37253
X-original-commit: ebba3c9fa709dccf4cab91e9f37aa3eaa24c7d21
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-27 17:14:07 +00:00
Priyanka KakadiyaandMohammed Shekha 9b57bfb6a2 [FIX] web, *: button special not working to close dialog
*: event_sale
   mail
   sale_product_connfigurator
   stock

Before this commit: if we open dialog from acitivity view and try to
discard it (i.e. close it), it throws traceback.

Issue arises from following commits:
https://github.com/odoo/odoo/commit/d3d576cf8ec9e5b5f6ae5f9d8845cf384435f12d
https://github.com/odoo/odoo/commit/3210f108272be89f1a7b01f4e1816b7f04ae0a3b

Previously, special attribute was passed directly, but now `on_close`
gets action info as an object.

After this commit, it passes special key as an object for `on_close`,
also changed special action based logic in other modules.

Task-Id 2072181

closes odoo/odoo#37078

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-09-27 14:45:51 +00:00
Christophe Simonis f1c0b08504 [MERGE] forward port branch saas-12.4 up to bef26222b8 2019-09-25 16:53:26 +02:00
Christophe Simonis 257a382b5c [MERGE] forward port branch saas-12.3 up to dd627b9698 2019-09-25 13:43:26 +02:00
Alexandre Kühn af26c70469 [FIX] mail: remove "Please wait..." in Discuss when ready
Revision on https://github.com/odoo/odoo/commit/9a66619db33fca5f0cb81d9f6bfeb0fb0290cf68

Commit above improved webclient loading by not having to wait for
the RPC `/mail/init_messaging`.

It introduced an issue in which Discuss app was indefinitely showing
"Please wait...". This commit fixes this issue.

closes odoo/odoo#37337

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-24 12:23:22 +00:00
Christophe Simonis ac4fc6e7c7 [MERGE] forward port branch saas-12.3 up to bd3e510edb
closes odoo/odoo#37314

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 09:44:56 +00:00
Christophe Simonis d67b2483e5 [MERGE] forward port branch saas-12.4 up to 9ed4872ea0
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 17:45:37 +00:00
Alexandre Kühn 9a66619db3 [FIX] mail: no wait init_messaging before loading webclient
Before this commit, discuss widgets had to wait for the route
`mail/init_messaging`. This behaviour slowed down the loading of the
web client.

This commit solves the issue by rendering discuss widgets even when
`mail/init_messaging` hasn't been resolved. For instance, the
messaging menu displays a spinner until messaging becomes ready.

Task-Id 2072835

closes odoo/odoo#37031

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-18 10:07:20 +00:00
Juhil Somaiya ececa1f7bf [FIX] *: hide technical field widgets in non-debug mode (Studio)
*:
- account
- barcodes
- calenndar
- hr_timesheet
- mail
- mass_mailing
- partner_autocomplete
- web
- website_slides

This commit removes description of fields that should not be shown in
non-debug mode Studio. Only field widgets whose own description is
set are displayed in non-debug mode Studio in "Widget" of sidebar.
In other words, even if any ancestor has a description but not the
current widget, it won't be displayed in the sidebar in non-debug
mode.

Task-Id 2056992

closes odoo/odoo#35902

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-23 15:00:44 +00:00
Jinal Patel 59c90e9b1d [FIX] mail: pass context from schedule activity
Problem is that while creating Opportunity from schedule activity at the
bottom of the activity view, context was not applied.
For Example, CRM > Pipeline, while creating opportunity that will create
a lead because context was not applied.
In this commit, context should be applied.

task-2072491

closes odoo/odoo#37139

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-19 11:28:00 +00:00
Sébastien Theys b6288e5446 [IMP] *: remove image_64 and clean views
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...

64px is close enough to 128px that it can be removed without a big impact on
download size.

It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.

The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.

If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.

Views
=====

- remove width and height attributes when existing CSS rules are overriding them
  (eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
  of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
  image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules

task-2060865

closes odoo/odoo#36147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-19 10:23:39 +00:00
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 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 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 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 f26de445e5 [MERGE] forward port branch saas-12.3 up to 6f55fd65da 2019-08-20 12:17:04 +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