Commit Graph
826 Commits
Author SHA1 Message Date
Sébastien Theys 7e0c68bf2b [REF] mail, im_livechat: move typing to discuss WIP
closes odoo/odoo#120851

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-11 12:01:43 +02:00
Pierre-Yves Dufays b3d9fbd3d5 [IMP] mail: allows unfollowing record from inbox
Allow users to unfollow easily document from the inbox for which he/she doesn't
want to be notified anymore.

When hovering on a follow up message with a related document followed by the
user, the interface displays an action to unfollow it that allows the user to
remove himself/herself as follower of the document. As a result of performing
that action a toast is displayed as a feedback.

Technical note:
The unfollow link is displayed on a message.canUnfollow is true which check
that the thread related to the message is followed by the user.

In order to know if the user follows the record related to the message, we now
transmit with each message the id of the follower table that link the user to
the related record if it follows it. This allows to insert the follower on
client side so that the unfollow action can use the standard mechaism already
developed to unfollow a record.

Unfortunately, that information coudn't be added in the already public method
message_format of mail message because that method is not always called on the
user retreiving the message but also by the one posting message. We didn't want
also to include all followers in the formated message so we rely on additional
method that add that information per partner.

To support unfollowing a document in the inbox no matter the current company,
we have modified message_unsubscribe in mail_thread to allow internal user to
unsubscribe themself without checking any rights. Indeed, some document have
record rule that prevents reading it if the user is not in the right company
(ex. crm.lead) and then was preventing the user to unfollow the document using
that method.

Task-3061864

Part-of: odoo/odoo#107978
2023-05-10 13:21:06 +02:00
tsm-odoo 8f399a270c [FIX] mail: indeterministic discuss test
This PR fixes the `Posting message should transform relevant data to emoji`
test that sometimes failed due to a race condition.

The assertion was too strict, this test just needs to check that the
emoji are properly parsed when posting a message.

Fixes runbot error: 20934.

closes odoo/odoo#120769

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-09 06:07:30 +02:00
Didier (did) 25f7da6c0b [IMP] mail: remove discard on external click
Before this PR, when you reply to a message or edit a message, the action would
be cancelled when you click somewhere else than in the composer or emoji picker.
This PR remove this behavior.

closes odoo/odoo#120753

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-09 06:07:23 +02:00
tsm-odoo e1f0811b22 [IMP] mail: replace hardcoded orm commands in tests
Using hardcoded ORM commands in tests is cumbersome and not reliable.
This commit introduces the same system as the one used on the server.

closes odoo/odoo#120670

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 15:58:50 +02:00
Alexandre Kühn c5c3362a21 [FIX] mail: arrow up/down should change selection inside composer
Before this commit, when composer had some text content in
multi-line, arrow up/down was not jumping to previous/next
line.

This happens because the navigable list is active even when not
shown, and was preventing all keydown events.

This commit fixes the issue by limiting handling of keydown
events of navigable list to when it is shown.

Also fixes a bug where the quick edit of last message was triggered
when composer text was non-empty with ArrowUp. This should only
be triggered when the composer text input is empty.

closes odoo/odoo#120657

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-05 14:55:08 +02:00
Sébastien Theys e6b3323237 [REF] mail: move channel commands to discuss folder
Part of task-3265211

closes odoo/odoo#120429

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 14:54:57 +02:00
Alexandre Kühn 08a6a5781e [FIX] mail: disable open chat from click on self-authored messages
Before this commit, when clicking on self-authored messages, it was
opening the form view.

It should neither open chat nor open form view for self-authored
messages.

closes odoo/odoo#120484

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-04 20:34:00 +02:00
Alexandre Kühn ec8dc607d0 [FIX] mail: consistent unread/needaction of channel in messaging menu
Before this commit, unread and needaction shown in messaging menu
was inconsistent with discuss sidebar.

In discuss sidebar, unread channel are bold, and needaction are
shown with badge + counter. In messaging menu, previews could be
either unread or needaction previews, and channels had 2 previews,
one for unread, and the other for needaction.

This commit make the messaging menu preview of channels more
consistent with discuss sidebar:
- channels have a single preview for unread and needaction
- unread messages make title bold, unread counter is no longer shown
- the counter displays needaction on this channel instead.

This commit also improves ordering of messaging menu items, so that:
- needactions have precedence over non-needactions
- unread channels have precedence over read channels

Task-3293723

closes odoo/odoo#120144

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-04 19:10:20 +02:00
Alexandre Kühn c0ce6ca7b6 [FIX] mail: do not auto-open chat window when self-posting a message
Before this commit, when posting a new message in a channel in the
discuss app, a chat window of this channel was automatically open.

This happens because new message from self where considered
new messages in a channel, and all new messages in a channel
were automatically opening a chat window.

This commit fixes the issue by not making self-authored messages
automatically open the chat window.

closes odoo/odoo#120478

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-04 08:56:20 +02:00
Sébastien Theys f9ca72dca9 [REF] mail: move CallSettings code to discuss folder
Part of task-3265211

closes odoo/odoo#120314

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-02 22:26:44 +02:00
Sébastien Theys 197d9a7dc6 [REF] mail: move ChannelMemberList code to discuss folder
Part of task-3265211

Part-of: odoo/odoo#120314
2023-05-02 22:26:43 +02:00
Sébastien Theys a843eb776f [REF] mail: move ChannelInvitation code to discuss folder
Part of task-3265211

Part-of: odoo/odoo#120314
2023-05-02 22:26:43 +02:00
tsm-odoo 0c919774ea [FIX] mail: fix non-deterministic message test
Before this PR, the `Updating the parent message of a reply also
updates the visual of the reply` test was failing in a non-deterministic
fashion.

This PR fixes this issue by replacing the `nextTick` by a  specific
`waitUntil` in order to ensure the DOM is properly updated before
asserting.

Fixes 20829 runbot issue.

closes odoo/odoo#120273

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 15:59:13 +02:00
Sébastien Theys 09ac15e2dd [REF] mail: clean code for message update
As a bonus, add cross-tab update for current user in chatter.

Part of task-3265211

closes odoo/odoo#120018

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 12:26:43 +02:00
Didier (did) 19abfc1f66 [IMP] mail: update link previews when editing a message
Before this PR, link previews where not updated when a user was editing a
message.
This clear the current link previews and reprocess the updated message.

closes odoo/odoo#119917

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 18:25:13 +02:00
Sébastien Theys c1a3ad8e01 [REF] mail: move channel specific code of reaction to discuss
The opportunity is taken to clean the methods to make the override
actually possible.

Part of task-3265211

closes odoo/odoo#119942

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 17:21:53 +02:00
Alexandre Kühn f1566d4d2d [MOV] mail,*: move static discuss/ to discuss_app/
*: im_livechat, website_livechat

In preparation of splitting 'discuss' and 'mail' modules.

This allow using new folder discuss/ that contains all static
files of new module 'discuss'.

Part of task-3265211

closes odoo/odoo#119860

Related: odoo/enterprise#40388
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 07:06:02 +02:00
Alexandre Kühn 66301a4ac6 [FIX] mail: new needaction message from chatter in messaging menu
Before this commit, when receiving a new needaction message from
chatter, the messaging was not updating itself to show this new
needaction.

closes odoo/odoo#119843

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 07:05:57 +02:00
Sébastien Theys b1772094b1 [REF] mail: move discuss.channel code to its own folder (models)
This commit focuses on removing all references to discuss.channel from
code located in /models of mail module.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119413

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-26 19:49:08 +02:00
Louis Wicket (wil) 03aada713a [IMP] mail: hold shift to select emoji without closing the picker
Clicking on an emoji from the emoji picker while holding down the Shift
key now prevents the emoji picker from closing, allowing users to easily
select multiple emoji in one go.

Task-3288704.

closes odoo/odoo#119598

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-25 14:07:38 +02:00
Sébastien Theys 694d501a35 [REF] mail, im_livechat: move /mail/chat_post to im_livechat
It is only used there.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119306

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-24 18:25:59 +02:00
Alexandre Kühn f34c5c64f8 [FIX] mail: save record on schedule activity
Before this commit, when adding a tag on record and then
scheduling an activity, the tag was removed from the record.

This happens because reloading the chatter does not save changes.

Although there is a `keepChanges: true` option, this looks
ineffective. This commit fixes the issue by letting chatter reload
always save any changes.

closes odoo/odoo#119275

X-original-commit: 97465dfb0ec53080bf05c3614dfa7429629729a6
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-21 23:46:21 +02:00
Sébastien Theys 90cb44e1e1 [REF] mail, *: rename mail.channel to discuss.channel
* = bus, calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot,
    mass_mailing, privacy_lookup, test_discuss_full, test_mail,
    test_mail_full, website_crm_livechat, website_livechat, base

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#118354

Related: odoo/upgrade#4553
Related: odoo/enterprise#39661
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-21 02:21:53 +02:00
Alexandre Kühn 7995349001 [FIX] mail: correct breadcrumb when open discuss from chat window
Before this commit, when opening Discuss from chat window and then
accessing the settings page of a channel, the breadcrumb showed
"Unamed" as the name of the App instead of "Discuss".

This happens because the client action was not named when expanding
the chat window by opening Discuss app.

closes odoo/odoo#118939

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-20 11:57:31 +02:00
Pulinckx Pierre (PIPU) 608e90e998 [REF] *: Replace underscore functions by native JS
Replace _.map(), _.flatten(), _.delay(), _.contains(), _.pluck(), _.isUndefined(), _.isEmpty(), _.isString(), _.isEqual(), _.isBoolean(), _.memoize(), _.invoke(), _.bind(), _.escape(), _.debounce(),
_.str.sprintf(), _.str.repeat(), _.str.startswith(), _.str.trim(),
_.str.escapeHTML(), _.str.escapeRegExp(), _.str.startsWith(), _.str.include()

closes odoo/odoo#118012

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-04-20 11:57:29 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello ebf646b44f [IMP] *: ModelFieldSelector improvements
We refactor the ModelFieldSelector and ModelFieldSelectorPopover
components.

We also improve a bit ModelFieldSelectorPopover:
    - on first page, the button to go back is no longer available
      (so that it is now more difficult to produce an invalid path)
    - we always start with a page presenting the model where the last
      selected field name belongs to
    - the keyboard navigation is improved
    - click on model field selector opens the popover with the focus in
      the search input (if any)
    - for relational fields in popover: the user can either click on the
      relational field (and select it) or a special button that make him
      follow the relation to the field comodel

We also refactor the hook useDynamicPlaceholder to make it use a new
component DynamicPlaceholderPopover that uses ModelFieldSelectorPopover.

Task ID: 3272798

closes odoo/odoo#117951

Related: odoo/enterprise#39673
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-19 21:58:34 +02:00
Didier (did) 6f12a849f6 [IMP] mail: link preview image as message
This PR hide the message body when the link preview is an image and the message
only contains the link to the image.

closes odoo/odoo#117772

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-19 20:58:14 +02:00
Alexandre Kühn 4fd9cfbe81 [FIX] mail: make chat window take whole height in mobile
Before this commit, chat window take at most 95% of global
height. This is ok in desktop, 5% room allow clicking on
systray menu. In mobile, however, the intend is for chat window
to take whole height.

This commit makes chat window take whole height in mobile, while
preserving the max-height 95% of global height in desktop.

Also fix an issue where chat window were foldable in mobile, when
this feature is desktop-only.

closes odoo/odoo#119058

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-19 19:14:47 +02:00
tsm-odoo e55ba11a89 [FIX] mail: fix message separator appearing after showing composer
closes odoo/odoo#118875

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-18 19:28:50 +02:00
Pulinckx Pierre (PIPU) 800223ae7c [REF] *: Replace underscore _.each() by native JS
Replaced _.each() functions (average 235 occurences)

Description of the refactoring this PR addresses:

Current behavior before PR:

There are underscore.js function enumerated above used in odoo.

Desired behavior after PR is merged:

These functions has been replaced by native javascript
prototypes/methods/functions.

TaskId : 3246238

closes odoo/odoo#118565

Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-04-18 15:38:54 +02:00
tsm-odoo a2a4cd56ec [FIX] mail: fix reply to author avatar
This PR fixes a bug where the author avatar of the parent message of
a reply had the wrong avatar (the one of the  of the reply
author instead of the one of the parent message author).

closes odoo/odoo#118878

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-18 11:33:48 +02:00
Alexandre Kühn 4d5516774d [FIX] mail: im status online color in community
Before this commit, im status in community was blue instead
of green.

This commit makes im status green in all version, as it should.

closes odoo/odoo#118744

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-17 14:14:22 +02:00
Alexandre Kühn 41e0543932 [FIX] mail: no crash on receiving link preview of non-known message
This notification makes sense when we know this message. If we don't
know it yet, then we should just ignore and receive data of link
preview when fetching the message.

closes odoo/odoo#118647

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-14 19:45:52 +02:00
Bruno Boi e9aced9d53 [FIX] web: close popover on mousedown away
**Before this commit**
The popovers will close on click away.
This makes impossible to start selecting text within a popover
using the mouse and finishing the move outside of the popover
(as it will get closed).

**After this commit**
Popovers will close on mousedown away instead, which is a general
standard for user interfaces anyway.

Part-of: odoo/odoo#118066
2023-04-13 16:40:18 +02:00
Louis Wicket (wil) c16bef413f [FIX] mail: adjusts member list separator to the locale
Prior to this commit, the separator used to separate the names of the
members of a group DM could not be translated. This is because the
string being translated is too short to be considered by the translation
system.

This commit fixes the problem by no longer relying on the Odoo
translation system and instead using the ECMAScript Internationalization
API.

closes odoo/odoo#118306

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 04:08:45 +02:00
tsm-odoo 1c1604466f [IMP] mail, im_livechat: add pin messages feature to channels
With this commit, messages can be pinned on a channel and
chat conversation. There's a new menu listing all pinned
messages on a conversation, and we can jump to these messages
in the current conversation.

As this feature incentives to see older messages, this commit
also adds a "Jump to Present" button when looking at old messages.

closes odoo/odoo#116666

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-13 04:08:11 +02:00
Alexandre Kühn fc9d46f3b9 [REF] mail: clean message fetch code
Adapt code of message fetch so that fetching of
(needaction) messages are controlled in a way to
keep continuous sequence of messages at all time.

This code design solves the "holes" problem in a message
list by not allowing holes. This fixes many scenario that
generated these holes, resulting in unfetchable messages.

Example of such a scenario:
- post 40 messages
- post a new message that is reply of the oldest message
- page reload and scroll up until load more
=> 10 messages are missing in-between replied message and
 following message (that should have been 11 messages apart)

This code also prepares for allowing jumps in a conversation.

Part-of: odoo/odoo#116666
2023-04-13 04:08:11 +02:00
Zelong Lin 6705c2f4fd [IMP] mail,im_livechat: no canned reply in mail
Canned response should only enabled in livechat thread.
task-3208438

closes odoo/odoo#116388

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-11 18:49:24 +02:00
Jorge Pinna Puissant baebb6a5b0 [REF] web, *: Unique id for field nodes
Before this commit, the field node id (`field_id`) uses the field name
for the first occurrence on the arch, and add an underscore and a number
for the rest of the occurrences. This can create inconsistencies when
sombody assumes that the field_id is equal to the name, and don't take
into account the possibility of multiple occurrences.

Now, a unique id is created since the first occurrence, this remove all
ambiguity between the id and the name.

Part-of task-id 3179751

closes odoo/odoo#117799

Related: odoo/enterprise#39511
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-11 15:17:20 +02:00
Alexandre Kühn d9bb64f1e9 [FIX] mail: show email_from if message has no author
closes odoo/odoo#118038

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-07 19:43:28 +02:00
Alexandre Kühn 804d3786e8 [FIX] mail: do not auto-open chat window with odoobot on login
closes odoo/odoo#117978

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-07 19:43:25 +02:00
Didier (did) e208b56280 [FIX] mail: fix traceback when deleting a link preview
closes odoo/odoo#117908

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-06 16:12:21 +02:00
Sébastien Theys e477c5d71b [FIX] mail: keep mentions when toggling composer or editing message
closes odoo/odoo#117786

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-05 16:26:26 +02:00
Sébastien Theys b7dd007396 [FIX] mail: allow click on suggested recipient input
closes odoo/odoo#117681

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-04 19:11:48 +02:00
Sébastien Theys 4e33fc4816 [FIX] mail: add recipients as follower when sending message
Part-of: odoo/odoo#117681
2023-04-04 19:11:47 +02:00
Lucas Perais 91000641f1 [FIX] mail: tests helpers: export mail setup registries
This commit exports the function responsible for setting up the mail registries in tests.

This is usefull if one doesn't want to instanciate a full webClient in tests and still have mail features.

Part-of: odoo/odoo#115799
2023-04-03 13:55:16 +02:00
Romain Estievenart fb8112a06b [IMP] mail,hr,web: change the UX of the Many2ManyAvatarFieldPopover
The commit change the design of the Many2ManyAvatarFieldPopover the goal
is to remove the m2m dropdown and fill the dropdown content directly
inside the popover.

It also reverses the order of the displayed tags inside the m2m avatar
field in the kanban view and inside the popover.

It removes the possibility to unassign users on mouse hover in kanban
view.

Note:
It's still possible to remove users inside an m2m_avatar_field popover.

Task ID: 3229888

closes odoo/odoo#117194

X-original-commit: f0d71e98743421318a798ef9d4f1e75d11a23334
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-03-31 10:53:08 +02:00
Alexandre Kühn 43bc9897e3 [FIX] mail: read more/less link on message of type notification
Read more/less requires content being `t-ref="body".
It was not properly set for messages of type notification, thus
skipping the read more/less insertion in the content.

closes odoo/odoo#117203

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 17:58:07 +02:00
Didier (did) bb8017707c [FIX] mail: restore the ability to disable link preview
Before this PR it was not possible to disable the link preview by setting
`mail.link_preview_throttle` to 0. This feature was lost in the refactoring.

This PR reintroduce this feature.

closes odoo/odoo#117101

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 17:57:53 +02:00