Commit Graph
100 Commits
Author SHA1 Message Date
Didier (did) 27cea9d84c [FIX] mail: remove duplicate code for needaction counter
This code is a duplicate of the mail.message/inbox
notification (https://github.com/odoo/odoo/blob/17.0/addons/mail/static/src/core/web/mail_core_web_service.js#L43)
resulting in the counter being incremented twice.

closes odoo/odoo#163310

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-04-25 17:06:56 +00:00
Didier (did) 3e00a3f633 [FIX] mail: add "To: No recipient" when there is no followers
task-3611153

closes odoo/odoo#148570

X-original-commit: 5f4f89a3573736c70c96e82d4cd12423a94ebb2e
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2024-01-10 07:26:59 +00:00
Didier (did) d507be4bf1 [FIX] mail: guest search error
Before this PR, I guest searching in discuss would get an access error.
This is because the search is searching in the attachments that the guest can't
access.

task-3637314

closes odoo/odoo#146110

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-01-08 20:38:00 +00:00
Didier (did) cfeef1472f [FIX] mail: cache online and offline getter
Before this PR online and offline cache getter where called when not needed.
This PR move the code inside the onWillRender hook to cache the results and
avoid useless computation of getters.

task-3572093

closes odoo/odoo#141750

X-original-commit: 57aa00893cc47456d5eb39f429c83c4069ab0d7e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-13 13:20:11 +00:00
Didier (did) bcf64fa885 [FIX] mail: mark as read can ignore 404 error
404 means that the thread was deleted

Task-3577083

closes odoo/odoo#141372

X-original-commit: 6aeb00d7e3b60f9eb0cb968fe16ba1a333076ec3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-11-08 01:21:58 +00:00
Didier (did) b160005840 [FIX] mail: reset bus notification before testing
Before this PR, bus notification was not reset before testing the bus
notification of link previews.

https://runbot.odoo.com/web/#id=28333&view_type=form&model=runbot.build.error&menu_id=405&cids=1

closes odoo/odoo#141419

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-07 23:57:47 +00:00
Didier (did) 4064508af5 [IMP] mail: send cache control header on avatars
Before this PR cache control header for avatar was set to no-cache which is not
the right value.
This PR mark the avatar routes response as immutable when a unique string is
present. We also use the partner write_date as unique string when possible.

task-3551636

closes odoo/odoo#141326

X-original-commit: 3de4f1f1225229cbdb0512df5790ce491f04ea7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-07 21:02:27 +00:00
Didier (did) f09d659a26 [FIX] mail: add missing threadService to mailCoreWeb
closes odoo/odoo#141207

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-06 20:52:29 +00:00
Didier (did) ceebd2e8d0 [FIX] mail: reorder direct message when opening a new one
Before this PR, newly created direct message would be added at the bottom of the
list instead of the top.
This PR fix the issues by sorting the direct messages when creating a new direct
message channel.

Task-3566728

closes odoo/odoo#139960

X-original-commit: 60cf880102615a524f2fa89c71be7f1b08d931d1
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-31 10:33:49 +00:00
Didier (did) ea0071ffc7 [FIX] mail: improve messaging menu performance
To reproduce:

* Populate mail.message as medium or more
* Open odoo and click the messaging menu
* The messaging menu take an unreasonable amount of time to open.

This PR cache the threads getter to avoid unnecessary computations

task-3551625

closes odoo/odoo#139519

X-original-commit: aa92a630d5146b7a4ee5eb5d09bb6db04c1ba146
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-24 15:23:22 +00:00
Didier (did) 00c2f50019 [FIX] mail: add missing inverse on channel member thread
task-3546165

closes odoo/odoo#139017

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-18 13:39:20 +00:00
Didier (did) fd68c7d343 [FIX] mail: allow empty message edition
Before this PR, it was not possible to edit a message that has an empty body.

Task-3387170

closes odoo/odoo#137996

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-09 20:31:50 +00:00
Didier (did) 75ee820002 [FIX] mail: close search panel when changing thread
task-3542981

closes odoo/odoo#137970

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-09 20:31:47 +00:00
Didier (did) 5e5616a45e [FIX] mail: do not display archived partner in recipient list
Before this PR, archived partner where displayed in the recipient list, but they
will never get notified.
This PR exclude archived partner from the recipient list.

task-3535433

closes odoo/odoo#137759

X-original-commit: a2474635c31d47e480f7a871aa869667f0a90dc5
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-09 18:16:56 +00:00
Didier (did) fa64a23f1c [FIX] mail: load gif category properly
Before this PR the showFavorite status was not properly updated after clicking
on "back".
This cause the categories to use the favorite route when scrolling instead of
the category route.

Task-3504566

closes odoo/odoo#136932

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-09 13:25:29 +00:00
Didier (did) f1abc4e4f3 [FIX] mail: selfFollower should be included in the followers
Before this PR, the current user was not considered has a follower, regarding
the mention suggestions.
This lead him to be lower than other entries.
This PR fix the issue by adding him back to the follower list.

Task-3531111

closes odoo/odoo#137583

X-original-commit: 50a785fedc5b5c7fd826548e52385bdf458c97a2
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-06 06:14:04 +00:00
Didier (did) e3d68312fa [IMP] mail: improve escape key usage in discuss app
This PR introduce multiple usage of the escape key:

- Channel selector can now be closed using the escape key
- Using the escape key will focus the composer automatically

Task-3456518

closes odoo/odoo#135031

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-05 13:37:50 +00:00
Didier (did) f29a09d7d3 [IMP] mail: send channel update to the client
Before this PR, channel update were not sent via bus notifications.

Part of task-2821415

closes odoo/odoo#136623

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-04 19:40:14 +00:00
Didier (did) 8fa2a6fe11 [IMP] mail: search a discuss thread
See https://github.com/odoo/enterprise/pull/43980

task-2359037

closes odoo/odoo#118794

Related: odoo/enterprise#43980
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-03 19:19:50 +00:00
Didier (did) 7c4a8f6118 [IMP] web: improve like operators capabilities in the mock server
Before this PR, the `like` operators from the mock server could not handle
request using the `%`.
This PR introduce it.

Part-of: odoo/odoo#118794
2023-10-03 19:19:50 +00:00
Didier (did) 6eaf6f23b4 [FIX] mail: do not display recipients when using log note
In log note case, followers are not going to be notified of the message.
Therefore the recipients input should not be visible.

task-3504225

closes odoo/odoo#136661

X-original-commit: c60449a2efde457e8370928681f011c103ea1d60
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-09-28 01:51:29 +00:00
Didier (did) 8ef53019db [IMP] web: add mail types file to _jsconfig
closes odoo/odoo#135751

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-18 20:56:24 +00:00
Didier (did) 023461cd06 [FIX] mail: fix composer render when switching chatter record
To reproduce this bug:

- Open a record with a chatter
- Open a composer (send message or log note)
- Change record using the pager
- Now, you cannot mention anyone

This is because the chatter component is reused and the `useComponent` hook isn't
refreshed with the new data.
This PR fix the issue by forcing a re-render of the composer when the `threadId`
changes. This refresh the `useComponent` hook used inside the `useSuggestion`
hook.

task-3502720

closes odoo/odoo#135331

X-original-commit: 28dd108294606499799e1fd2a7b24de23730d098
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 18:42:32 +00:00
Didier (did) 8e2d0e9f8d [IMP] mail: port test from 135122
This PR import the test created in https://github.com/odoo/odoo/pull/135122

closes odoo/odoo#135183

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 03:38:09 +00:00
Didier (did) 8a6eda2ccd [IMP] mail: add typing status above the composer in chat window
In DM chat, the im status turns into typing icon so it was not
a problem. In group chat and channel, however, there was no way
to see typing members in chat window.

This commit adds explicit small text above composer in chat window
to list typing members of conversation.

Task-3474778

closes odoo/odoo#133757

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 08:29:54 +00:00
Didier (did) 8bd1d87880 [IMP] mail: allow scroll using keyboard key in chat window
Before this PR, it was not possible to scroll a chat window using page down/page
up, home or end keys.
This is because the thread component that is scrollable cannot became an activeElement.
This PR fix this by adding a tabindex="-1" on the scrollable element.

Task-3468978

closes odoo/odoo#134657

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-09-07 14:45:28 +00:00
Didier (did) f4ee483fde [IMP] mail: allow deletion of all the link preview at once
Before this commit, when a message had many link previews,
deleting all of them required to delete one by one.

This commit improves this aspect by showing a "Delete All"
button in the dialog to delete all link previews at once.

task-3488054

closes odoo/odoo#134301

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-06 14:42:17 +00:00
Didier (did) ae9da88c0c [IMP] mail: simplify link preview payload
Before this PR the link preview formatter was creating an unnecessary complex
object in the message key.
This PR simplify the payload by using a message_id key and remove the
unnecessary object.

closes odoo/odoo#134283

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-06 01:18:47 +00:00
Didier (did) a6ebc20b73 [FIX] mail: only display followers with mail.mt_comment activated
Before this commit, recipient list in chatter when using composer
in "Send message" mode where listing emails of all followers, instead
of only subscribers of "Send message" (= `mail.mt_comment`).

This commit solves this issue by loading and showing followers
that are recipients in this list. Because this feature and follower
list lazy-load some data, they need to manage they own list for
the "load-more" aspect. That's why the diff shows some duplicated
code as with `followers` field of JS thread model.

closes odoo/odoo#134225

X-original-commit: ba43502b22f8f00e7a2318b341302b809e7129dc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-05 21:18:14 +00:00
Didier (did) 6aa3a1e243 [IMP] mail: message action registry + reorder actions in inbox
Before this commit, message actions were all defined in template
of `Message` component. It's good when there are few actions and
the ordering of actions is always the same, but there are now
many actions and we want to order these actions depending on context.

This commit fixes the issue by introducing a special registry to add
message actions. This registry is quite similar to thread actions:
each item define conditions to be shown, behaviour on click, and
their sequence which can depend on the context where the message is
being viewed.

In addition to this message action registry, this commit also
reorder message actions in inbox as follow:

1. Quick actions:
 - Add a Reaction
 - Mark as To do
 - Mark as Read
2. More menu:
 - View reactions
 - Reply
 - Unfollow
 - Edit
 - Delete

Task-3458086

closes odoo/odoo#131426

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-05 18:44:24 +00:00
Didier (did) 145ed67b92 [FIX] mail: avoid crash with link preview from bus notification
Before this PR, a crash occured when a link preview was recieved from the bus.
This is because the link preview was pushed twice on the `message.linkPreviews`
array.

task-3491629

closes odoo/odoo#134135

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 17:10:10 +00:00
Didier (did) 3bd65eadfa [FIX] mail: search for GIFs should match input
Before this PR, RPC in the search GIFs form could resolve in the wrong order and display outdated result.
This PR introduce the use of useSequential hook witch ensure that irrelevant RPC
are canceled.

closes odoo/odoo#133125

X-original-commit: 39fe84706e02ff7828d5098c9ec56aff274cba64
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-25 12:21:08 +02:00
Didier (did) b6f0e6ed65 [FIX] mail: avoid double encodeURI
Before this PR, if a user copy/past an already encoded url in the composer, the
linkify function would reencode already encoded character.

`%5B%5D` (witch mean `[]`) would become `%255B%255D` because `%` whould be encoded
`%25`.

We start by decoding the url, just in case it's already encoded.

closes odoo/odoo#133010

X-original-commit: 453c91d9c5b0353b5f362ecad487ccfd547856c6
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-08-24 20:59:04 +02:00
Didier (did) fdea4ee0e0 [FIX] mail: jumping on a message should not work outside the message thread
Before this PR, jumping on a message that is not displayed in it's originThread
would not work.
To reproduce:
* star a message that is a reply.
* open the starred menu.
* Try to jump on the replied message.

This PR fix the issue by not allowing the jump.

closes odoo/odoo#132924

X-original-commit: 914f899f119e4b5f6271613b4af653211a32f915
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-23 23:53:47 +02:00
Didier (did) 479ba79182 [IMP] mail: fix contains typing to avoid lint error
closes odoo/odoo#132632

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-22 20:00:24 +02:00
Didier (did) 1d14df47da [IMP] mail: add possible value of thread.type
closes odoo/odoo#132485

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-08-22 18:59:32 +02:00
Didier (did) f30588273c [IMP] display typing status inside ImStatus
task-2282361

closes odoo/odoo#131518

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-22 18:59:14 +02:00
Didier (did) 82e5b753d4 [FIX] im_livechat: fix history scrollbar
Before this PR, scrollbar in livechat session history was horizontal because the
flex-flow was set to column.
This PR remove the flex-flow to fix the issue.

task-3383919

closes odoo/odoo#131611

X-original-commit: ac3275706bbc3fcc1bffea731973de850db74892
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-08-14 09:16:38 +02:00
Didier (did) 630178359d [IMP] mail: introduce mail services module
This PR cleanup service typing:

* Introduce `addons/mail/tooling/type/services.d.ts` to automatically type
services imported by `useService` hook.
* Correctly type service constructor, setup and start functions.
* Remove now useless `@type`.
* Removing `Object.assign` for services variables.
* Type OdooEnv.services to services.

closes odoo/odoo#131192

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-08-09 19:27:09 +02:00
Didier (did) 47621309e9 [FIX] mail: search for partner to invite should match input
Before this PR, RPC in the channel invitation form could resolve in the wrong
order and display outdated result.
This PR introduce the use of `useSequential` hook witch ensure that irrelevant
RPC are canceled.

closes odoo/odoo#131011

X-original-commit: 7d628b6a2785a4ac2a1081413e8a54c7ad695cb5
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-08-07 13:42:24 +02:00
Didier (did) 1113272d56 [FIX] mail: discuss search results should match input
Before this PR, RPC made by input inside the discuss sidebar could
resolve in the wrong order, witch display outdated results.
This PR ensure that only the most recent RPC is sent to the server,
cancelling irrelevant RPC.

Note: This PR also remove the support for Promise inside the
NavigableList component since it's not compatible with useSequential.

closes odoo/odoo#130767

X-original-commit: ba2d029d876f9acd7c869cc3d345cc4ed7cab00a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-04 15:02:23 +02:00
Didier (did) 93f134d640 [FIX] im_livechat: reintroduce history command
task-3435244

closes odoo/odoo#130362

X-original-commit: 2e834a8439cc260c25d95233492df13e9b77c2de
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-08-02 13:20:34 +02:00
Didier (did) a1c079bbf1 [FIX] mail: fix nextMentionRpcFunction
Before this PR, the `nextMentionRpcFunction` was always undefined and therefor
never used. This could lead to some RPC being lost if the previous one was too
slow.
This PR fix the issue by directly using the `rpcFunction` that is already assigned.

closes odoo/odoo#130292

X-original-commit: fff3323cb82fb51dbbe8ac6790479530bbc51ba9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-02 05:10:10 +02:00
Didier (did) 1e12962743 [FIX] mail: suggested recipients are checked by default in chatter
Before this PR, suggested recipients without partner where not
checked and needed to be manually created. This is prone to mistakes
when sending an email to the suggested recipient.

This PR checks all the suggested recipients by default and create
the missing partners when a message is posted, and when full composer
is open. That way, there's far less risk to not send the email to
suggested recipient, and instead the user should manually uncheck
to not send the email.

closes odoo/odoo#128647

X-original-commit: 258b2420676fb1a0d7e834ab79f6bf1ec0f73254
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-17 20:36:07 +02:00
Didier (did) c348ea89a6 [FIX] mail: fix default_partner_ids in full composer
Before this PR suggested recipients were not correctly moved to the full
composer because the partner id is stored on the persona.

closes odoo/odoo#128291

X-original-commit: 38902e19389d2d559bf5866bfa96f638ca619c34
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-13 08:28:12 +02:00
Didier (did) 5e18390858 [IMP] mail: add missing type def
closes odoo/odoo#127868

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-10 16:59:21 +02:00
Didier (did) 56582ee3c0 [FIX] im_livechat: archived chatbot not active on the frontend
task-3374783

closes odoo/odoo#127052

X-original-commit: 2250585c21c4ad10622ed009bd4c12b82f13d945
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-03 15:37:34 +02:00
Didier (did)andBrieuc-brd 771477b9a7 [IMP] mail: Introduce gif picker in Discuss
This commit adds a GIF picker in discuss
app. GIF feature makes use of Tenor GIF API [1].
To enable GIF picker in discuss, you must provide
a Tenor GIF API key in the General Settings.
Then the GIF picker is visible in all channels
(chat window and discuss app), next to the emoji picker
button.

[1] https://tenor.com/gifapi/documentation

task-2365705

closes odoo/odoo#116060

Related: odoo/enterprise#41959
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
2023-06-30 23:38:01 +02:00
Didier (did) a2cd11c55b [FIX] mail: enable mentions when editing a message.
Before this commit, when editing a message, it was not possible
to add new mentions.

This commit adds the support to add new mentions when editing the
message.

Note that mentions added from editing message won't notify them:
it's only at creation of message that mentioned users are notified.

task-3329714

closes odoo/odoo#126888

X-original-commit: 1fe935d273142064784b9ecff2fff1c34e91064f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 13:08:26 +02:00
Didier (did) 3d2342cde8 [IMP] mail: display email addresses when sending a message from chatter
Task-3358505

closes odoo/odoo#125580

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-29 18:20:19 +02:00
Didier (did) 15609a9761 [FIX] mail: text-break activity description
Before this PR, long text in the activity description could create a horizontal scrollbar in the chatter.

Task-2721466

closes odoo/odoo#126607

X-original-commit: 0d087cd335bff3dcc04d54889f87f7b143e42b67
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-06-28 09:59:46 +02:00
Didier (did) 824922a2e9 [IMP] im_livechat: typing on services
closes odoo/odoo#126411

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-06-26 22:15:32 +02:00
Didier (did) 8766ce3e02 [FIX] mail: avoid error when clicking on jumpToPresent
Before this PR, the mouse event click was automatically passed has behavior to
the jumpToPresent function. This cause a TypeError.
This PR use an arrow function in the template to avoid passing the event.

closes odoo/odoo#126073

X-original-commit: bfc6be4b9129e8fa103efd6de57eb1cc9903b780
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-22 19:37:18 +02:00
Didier (did) 4cda4fab1f [FIX] mail: remove hard coded text-danger
closes odoo/odoo#124619

X-original-commit: 1c1b1e92c86e1ea7c81384e66b2549d77d3b37f2
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-12 14:04:19 +02:00
Didier (did) 0f36397ec5 [IMP] mail: discuss override of _init_messaging
closes odoo/odoo#120916

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-11 12:01:45 +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
Didier (did) be311dfc7c [IMP] mail: remove useless t-set
closes odoo/odoo#120242

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-03 12:39:48 +02:00
Didier (did) 0cb19acd04 [FIX] mail: guard an optional props
Before this PR, using the message component wihtout a thread could crash because
props.thread could be undefined (as thread is an optional props).
This PR just add the guard.

closes odoo/odoo#120233

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-03 12:39:45 +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
Didier (did) 3a86405a09 [IMP] mail: remove unuse variable
This code was moved to `_bus_notification_target` in https://github.com/odoo/odoo/pull/119413

closes odoo/odoo#119911

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-04-27 11:21:20 +02:00
Didier (did) 8a55e1b4df [IMP] mail: populate res.partner admin with 100 mail.message
Insert 100 messages on the admin res.partner for testing purposes.

closes odoo/odoo#119789

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 06:10:05 +02:00
Didier (did) 95b6b91fca [IMP] mail: better typing for composer and use Ref typedef
This PR complete the type definition for the props of the composer and replace
the custom Object by Ref type in the relevant place.

closes odoo/odoo#119593

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-25 14:07:30 +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
Didier (did) f5ff0b1b30 [FIX] mail: fix link preview overflow in the chat window
Before this PR, a link preview image would overflow out of the chat window. This
because the max-width on the image is bigger than the space dedicated to the
image inside the chat window.
This PR set the max-width to 100% inside a chat window, so the image cover the
space nicely.

closes odoo/odoo#119019

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-19 11:01:27 +02:00
Didier (did) f11ab40c3e [IMP] mail: rename update function and cleanup dead code
closes odoo/odoo#118793

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-17 16:35:06 +02:00
Didier (did) 1ea917278f [IMP] mail: type suggestion service
closes odoo/odoo#118212

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-04-11 15:17:40 +02:00
Didier (did) c184c2d78d [FIX] mail: remove outdated /new in type path
closes odoo/odoo#118200

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-04-11 15:17:38 +02:00
Didier (did)andSébastien Theys 611069fb65 [IMP] mail: improve get_mention_suggestion performance
"Order by" makes the query really slow.

On a database with 1000000 partner and 10000 user, this query goes from 5.5s to
600ms. Once cached by Pgsql it goes down below 100ms.

task-2982401

closes odoo/odoo#118198

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2023-04-11 15:17:35 +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
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
Didier (did) 533e0451aa [IMP] mail: populate data for discuss
This PR add a populate command for models `mail.channel`, `mail.channel.member`
and `mail.message`.
It will only create channel of type `channel` and `group`.

I used this bash function to quickly delete/create a database and populate it.

```bash
 # Quickly drop the current db (it use the git branch name as database name) and
 # create a new one that will be populated.
 # usage: odoo-populate model_name size
odoo-populate() {
    dropdb $(git branch --show-current)
    odoo -i mail --stop-after-init
    ./odoo-bin populate --models $1 --size $2 -d $(git branch --show-current) --addons-path=~/projets/pro/odoo/addons,~/projets/pro/enterprise --c ~/projets/pro/.odoorc
}
```

closes odoo/odoo#115827

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 12:54:30 +02:00
Didier (did) 312dfc3731 [FIX] mail: remove now useless comment
Since the rename of partnerRoot to odoobot (https://github.com/odoo/odoo/pull/116823), this comment is now irrelevant.

closes odoo/odoo#117102

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-03-30 10:54:10 +02:00
Didier (did) a5ca1895ac [IMP] mail: rename partnerRoot to odoobot
`PartnerRoot` is a confusing name for what is in fact what everyone call `odoobot`

closes odoo/odoo#116823

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-03-28 17:49:01 +02:00
Didier (did) 7da61eaeeb [IMP] mail: defaultDisplayMode can be directly assigned
Part-of: odoo/odoo#115945
2023-03-20 20:14:47 +01:00
Didier (did) 580042a2f5 [IMP] mail: Move lastInterestDateTime to a getter
Part-of: odoo/odoo#115945
2023-03-20 20:14:46 +01:00
Didier (did) ba2d6b9daa [FIX] mail: fix traceback when deleting a link preview
This PR fix a traceback that occur when pressing spacebar while the confirm
dialog for deleting a link preview is open.

task-3196494

closes odoo/odoo#113274

X-original-commit: d46a5171378497992bd65634f1aded53db27e9ef
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-02-21 21:07:51 +01:00
Didier (did) 45850003f1 [IMP] web: better typing for the RPC service.
This better expose the settings object when using the RPC service

closes odoo/odoo#108294

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-12-20 08:26:09 +01:00
Didier (did) c9ea3d0fa7 [IMP] web: expose immediate in useDebounced hook
Expose all debounced param in the hook.

closes odoo/odoo#106762

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-11-29 11:34:03 +01:00
Didier (did) 1cb660e53a [IMP] web: document position possible value
Position option has only 4 possibles values.

closes odoo/odoo#105271

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-11-17 11:58:53 +01:00
Didier (did) 74b30cb480 [IMP] mail: remove moment from the convert data and compute it
closes odoo/odoo#103935

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-26 12:23:06 +02:00
Didier (did) 365f5a9863 [IMP] mail: introduce notification handler mail.record/insert
Some of our current bus notification only insert data in the models system. We
can now simplify the way we handle them by using a generic `mail.record/insert`
handler.

closes odoo/odoo#102863

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-21 15:19:18 +02:00
Didier (did) 190f4bf416 [FIX] im_livechat: use the currentPartnerId from livechat
Current code can't work since session doesn't contain partner_id.

task-3010650

closes odoo/odoo#102952

X-original-commit: dcf9aa612e76ea71429725e12a819678c09cf449
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-10 19:03:25 +02:00
Didier (did) b95c95e6d4 [IMP] mail: convert LegacyComponent CallOptionMenu
part of task-2783065

closes odoo/odoo#102433

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-06 19:04:09 +02:00
Didier (did) bc5fde3e3e [FIX] mail: introduce hasEditButton
closes odoo/odoo#102421

X-original-commit: 715902da8ae76f5f027e4209c52e69c28f4bcb71
Related: odoo/enterprise#32400
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Debondt Didier (did) <did@odoo.com>
2022-10-06 18:01:37 +02:00
Didier (did) f54c392111 [IMP] mail: convert LegacyComponent webClientViewAttachmentView
Since
https://github.com/odoo/enterprise/commit/afcdd1878a2eaf4cbca85d1169dea31a108c8c43#diff-f064a21c91b8daa5d78c44e88e2c02345ff0a7230403dd3600a65d3a6b0653d3L18
there is no listener for preview_attachment_validation.

Part of task-2783065

closes odoo/odoo#102406

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-06 18:01:29 +02:00
Didier (did) 85bfd00dd4 [IMP] mail: convert LegacyComponent discuss to Component
part of task-2783065

closes odoo/odoo#102388

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-06 18:01:02 +02:00
Didier (did) 96dc4fb357 [IMP] mail: convert LegacyComponent of ActivityMarkDonePopoverContent
part of task-2783065

closes odoo/odoo#102349

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-06 15:58:02 +02:00
Didier (did) 85bd7c5069 [IMP] mail: convert activity LegacyComponent to Component
part of task-2783065

closes odoo/odoo#102336

Related: odoo/enterprise#32360
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-06 15:57:55 +02:00
Didier (did) 8554c9d583 [FIX] im_livechat: move checkbox "only if no operator"
task-3006024

closes odoo/odoo#102158

X-original-commit: 0e314674d4157e5f10a313ec70008ed443ce8366
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-05 00:08:57 +02:00
Didier (did) 7ffb5a0eff [IMP] mail: reintroduce mail_template_ids in activity
Task-2998135

closes odoo/odoo#101998

X-original-commit: c00828010f1245200b30451fb25a239047986421
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-04 13:28:52 +02:00
Didier (did) a00d53d9ff [FIX] mail: reintroduce missing overflow on discuss sidebar
In https://github.com/odoo/odoo/commit/9cbbb0248110acb1f85c8721d8ce8ce459217341
the overflow auto for the o_Discuss_sidebar class is missing making the sidebar
impossible to scroll.
This PR reintroduce this overflow-auto.

task-3004063

closes odoo/odoo#101931

X-original-commit: ce4dccf6e314dbd688dda1757781dd43ad47a601
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Debondt Didier (did) <did@odoo.com>
2022-10-03 15:19:34 +02:00
Didier (did) e62c11bafa [FIX] mail: avoid generation link preview on internal link
If website is installed, the login page of Odoo has opengraph meta that will be
used to create link preview on mention and channel link.
This PR add a xpath condition to always ignore mention and channel link in the
message body.

Part of task-3000274

closes odoo/odoo#101678

X-original-commit: eb032a5c36af6402b79ae768ce29b3d84eacf3b7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Debondt Didier (did) <did@odoo.com>
2022-09-30 09:32:15 +02:00
Didier (did) 3bef7380e0 [FIX] mail: fix link preview delete dialog size
part of task-3000274

closes odoo/odoo#101675

X-original-commit: e3773fe78f0cd652cecef0500611ac6988648e87
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Debondt Didier (did) <did@odoo.com>
2022-09-30 09:32:08 +02:00
Didier (did) 817be4899d [IMP] mail: convert activity_exception widget
closes odoo/odoo#100899

X-original-commit: cf8df2ccf4fd1de89336b3a5e838e15427565142
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-23 11:22:19 +02:00
Didier (did) 2811c74c0d [IMP] mail: convert notification alert
The notification_alert component can now be registered as a view_widgets directly

closes odoo/odoo#100898

X-original-commit: 4f91758d1aefb6e459ccf02220bf4cf27f3a2ff2
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-23 11:22:16 +02:00
Didier (did) 2aad13b67d [FIX] mail,hr: fix performRpcRead on user model
Fields param is actually not a kwargs. This cause a stack trace when opening a chat window (other than a chat with yourself) from a Kanban user avatar icon.

closes odoo/odoo#100315

X-original-commit: 95d3f4b0ea4dd5f1f9403b6e5ba97e1e2a510f65
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-18 09:30:01 +02:00
Didier (did) a06161ec1c [IMP] mail: introduce _generateMessageBody
Avoid code duplication by introducing `_generateMessageBody` function.

closes odoo/odoo#99745

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 11:45:18 +02:00
Didier (did) 8d8a4ef9b5 [IMP] mail: remove isPostingMessage from updateMessage
Since we are not using `postMessage` in `updateMessage`, setting
isPostingMessage is not useful.

closes odoo/odoo#99744

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 01:08:20 +02:00
Didier (did) 683f9be971 [FIX] mail: fix traceback with empty message body
This PR fix a traceback that occure when the message body is empty (eg: only
uploading an attachment).

closes odoo/odoo#99625

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 18:23:00 +02:00
Didier (did) 613448162a [IMP] mail: remove useless code in message edition
closes odoo/odoo#99487

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 18:35:08 +02:00