Commit Graph
2688 Commits
Author SHA1 Message Date
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 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +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
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
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
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
Dharmang Soni 840442a24f [IMP] *: hide all activity related filters
All activity filters are now invisible in the corresponding search views.

These filters were only used by activity redirection (when clicking on
the activity item in the systray) so we hide them to reduce the noise
for the user.

"My Activity" filter has also been removed, its corresponding domain is
now directly set in the action where it was used.

Task 2036392
2019-08-07 07:31:32 +00:00
Alexandre Kühn 3c134293b6 [FIX] mail:tests: restore unintentionally remove test
Revision on https://github.com/odoo/odoo/commit/ff7ea6b654175e3138f5f36d2e5b4214cebef499

Due to some git conflicts, it duplicated history tests and removed
the previous test 'input not cleared on unresolved message_post rpc'.

closes odoo/odoo#35502

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-08-06 14:52:28 +00:00
Nikunj Ladava 0c37b9fb39 [IMP] mail, test_mail: new 'History' mailbox in Discuss
This commit adds a new mailbox in the Discuss app called 'History'.
Messages that have been marked as read are moved to 'History'.

Notifications are required to link history messages to users. So
notifications are now deleted after they are more tha 6 months old.
This means History mailbox keeps less than 6 months old messages.

Note that this feature only works when user notifications are handled
in Odoo. This can be set in the user preferences, under the
"Notification Management" section.

Task-ID 402597
2019-08-05 11:50:19 +00:00
Christophe Simonis 1d6d790513 [FIX] mail: adapt test to new version
Oversight of previous forward-port.
2019-07-26 10:36:18 +02:00
Christophe Simonis a4b1b532ea [MERGE] forward port branch 12.0 up to b82df99d7a 2019-07-25 20:01:05 +02:00
Julien Castiaux ceeb5b51d5 [FIX] mail: form activity widget: do not close activity popover on click
Create an activity in a chatter, mark it as done, click inside the
textarea, the popover is automatically closed.

The `click` trigger both opens and closes the popover on click.

opw-2028399

closes odoo/odoo#34982

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-07-22 15:08:15 +00:00
Sébastien Theys f0ffbea173 [IMP] *: remove unnecessary image sizes
The big images are probably never going to be used for the following models:

- pos category
- fleet brand
- livechat channel
- mail channel
- payment acquirer

And if big images are needed some day the model should use image.mixin instead.

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00
Martin Trigaux e266c7c98a [MERGE] Forward port of 12.0 to saas-12.2 up to 5e4c1b3701 2019-07-23 13:41:00 +02:00
Christophe Simonis bfd34e14b1 [MERGE] forward port branch saas-12.3 up to 40e8b67179 2019-07-26 15:12:29 +02:00
Christophe Simonis 40e8b67179 [FIX] mail: add missing requirement in test
Oversight of previous forward-port.
2019-07-26 14:34:48 +02:00
Christophe Simonis e0f9c092cc [MERGE] forward port branch saas-12.2 up to 1d6d790513 2019-07-26 11:32:43 +02:00
Martin Trigaux a98427834e [MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c2
closes odoo/odoo#35119

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-24 10:32:23 +00:00
karol1985 433d01972d [FIX] mail: use correct translation method
_() is in python
_t() is for javascript

closes odoo/odoo#35329

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 06:25:26 +00:00
Julien Castiaux df7dfbfdf3 [FIX] mail: scrollbar for emoji
Open discuss on mobile phone, click on the smiley icon, not all smileys
are visible on screen.

opw-2030315

closes odoo/odoo#35146

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-24 13:43:03 +00:00
David Beguin 3a804ecac8 [FIX] mail : fix post message callback error
When posting a message (here is the livechat use case),
the _postMessage function can call the callback function.
but this parameter is not mandatory.

If the caller of this function doesn't need a callback function
to be called after execution, the _postMessage function was crashing
as callback is not defined.

This commit fix this _postMessage function by checking that
callback is defined before calliing it.

Pre-required for Task ID: 2028059
Fix Task : 2037048
PR #34917

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-16 13:49:14 +00:00
Martin Trigaux 1f5a4649a6 [MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 13:59:35 +00:00
Nicolas Seinlet 80fa405af5 [FIX] mail: message_unsubscribe takes 3 parameters
don't know why you try to use 4 parameters with a function that requires
3 of them:
https://github.com/odoo/odoo/blame/saas-12.3/addons/mail/models/mail_thread.py#L2283

closes odoo/odoo#34639

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-12 09:09:27 +00:00
Martin Trigaux c962b2cd11 [MERGE] Forwardport of saas-12.2 to saas-12.3 up to 01365a3f62
closes odoo/odoo#34747

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 07:22:41 +00:00
Thanh Dodeur 01365a3f62 [FIX] mail: removes unsupported usage of formData.delete
This commit replaces the usage of `formData.delete()` as it is not supported
by Internet Explorer and Safari Mobile.

closes odoo/odoo#34787

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-07-11 09:39:54 +00:00
Nicolas Lempereur 545437b899 [FIX] mail: show old messages /leave w/o reload
Before this commit, if we had a livechat channel with a user and:

- in backend use command "/leave" to leave and unpin conversation
- [do not reload the page (or there is no issue)]
- then the user sends a new message

The chat window opens just with the new message. Fetched previous
messages are ignored due to being already in the mail manager, and
links between these messages and the threads were never updated.

With this commit, when fetching messages that are already in the mail
manager, these messages are linked again to threads.

This commit also fixes an issue in which messages moderated with
status "accepted" were not correctly removed from the moderation
mailbox. This problem occurred after the fix on re-linking messages
to threads.

opw-2031270
closes #34761

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-07-10 16:46:22 +00:00
Alexandre Kühn f9ead39f5f [FIX] mail: rename direct message chat
Before this commit, when a direct message chat was renamed, it
crashed with the following error:

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

This occurs because the name of the dm chat changed from the RPC
response. However, no new name was provided, thus it sets its
name to `undefined`.

Test has been adapted in order to reflect that the server does not
response with new name after RPC `channel_set_custom_name`.

closes odoo/odoo#34641

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-07-09 12:37:07 +00:00
Romeo Fragomeli 37edde1773 [FIX] mail: close thread window button isn't clickable easily
Before this commit, the close button on the thread window was
too small to click on it. The padding of the button wasn't over
the all available area.

After this commit, the padding of the close button is higher and
so the user can target it more easily on a small screen.
We had to reduce the padding of the parent.

Step to reproduce:
- Open the "Discuss" app
- Go to the "Channels" tab
- Open a channel
- Try to tap on the close button on the top left window

Task ID : 2033828

closes odoo/odoo#34977

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-07-18 13:00:28 +00:00