Commit Graph
5042 Commits
Author SHA1 Message Date
Alexandre Kühn a49106aad7 [FIX] mail: fetch mention suggestions silently
Before this commit, fetching mention suggestions
(e.g. with `@mention` in discuss composer) was not
making a silent RPC. This is a minor RPC, so it should
not display a "loading" whenever suggestions are being
fetched.

closes odoo/odoo#127649

X-original-commit: a7ba5365614c3b599bc55e4cb3903a0e89429f7a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-06 20:56:14 +02:00
Paul Morelle 13ba60e358 [FIX] mail: debounce updateBusSubscription
Before this commit, when updateBusSubscription was called, it was
postponed to the next event cycle by its first line `await`.
This was needed to avoid registering too many times when adding a large
set of channels: we waited for all channels to be added by the for loop
before actually calling the function.

However, this registered one event per function call. The first one did
the job, and all the subsequent ones did nothing, apart consuming CPU
(sorting the ids and JSONifying them cost memory and CPU).

On Chrome-based browsers, this resulted in a freeze of the rendering if
the number of channels became large (e.g. 600).

With this commit, we make updateBusSubscription a debounced function,
with no delay so that the function gets executed at the next event cycle
like before.
However, the difference is that the debouncing doesn't create a new
postponed call for each call: the function will only get executed once
after the current event cycle, no matter how many times it was called.

closes odoo/odoo#127598

X-original-commit: 2a5c78679875414dcfad7692b660a9c19047485b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-06 20:55:52 +02:00
Alexandre Kühn d6dddb9518 [FIX] mail: do not open server-synced chat windows in mobile
Before this commit, when there were some chat windows open
in desktop, mobile device were displaying the chat windows
at page load.

This was even buggy, because the chat windows are mounted in
a folded state, and it shows only the header of chat window.
The content behind the chat window is visible but we cannot
interact unless the chat window is closed.

This commit makes a few changes to fix the issue:
- Folded state of chat windows is ignored in mobile: the chat
  window is fully displayed in mobile even when in "folded" state.
- At page load, server data from chat window state are ignored
  in mobile
- Messaging menu in mobile should not display content below:
  dropdown in mobile had some margin which displayed some content
  below. Fix is to have `m-0`.
- Chat Windows are displayed on top of Messaging Menu in mobile.
  In desktop it makes sense it's the other way, because messaging
  menu can be toggled when there's a chat window. But it's not
  clickable in mobile, and it acts as the previous screen to open
  a chat window.

closes odoo/odoo#127597

X-original-commit: 791924d6d1d0e5aff6d9e84844626ac5863c2a88
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-06 20:55:49 +02:00
Alexandre Kühn 3097fa0217 [FIX] mail: quickly mark as read message in inbox
Before this commit, to mark a message as read in Inbox
of Discuss app, we had to click on "More" option and
then select "Mark as Read".

Considering this is a frequently used option in Inbox,
it'd best to have it easily accessible like "Reply".

This commit shows "Mark as Read" as a quick option of
message when in inbox. As to keep at most 3 quick options,
the "Add a reaction" option has been moved to the "More"
menu when in inbox.

Note that Emoji picker requires an anchor, and items in Dropdown
are components therefore they cannot have `t-ref`. To solve this
issue, there's an invisible `<span>` in the quick option list
that is used as anchor for the emoji picker when used from
the "More options".

Task-3412306

closes odoo/odoo#127570

X-original-commit: b9c8fe1759f03952a42c9bee117e718eab3fef08
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-06 19:46:24 +02:00
Alexandre Kühn b2f935efb5 [FIX] mail: make message actions float in mailboxes on mobile
Before this commit, message actions were floating on top-right
corner only in chat windows. In mobile, most threads are shown
in a (fullscreen) chat windows. Some exceptions are mailboxes
and chatters in an Odoo view.

As a result, lots of horizontal space is wasted for this action,
so that messages take only half of the screen width.

This commit fixes the issue by using floating visual of message
action list when in chat window or in mobile. That way, when the
width of thread is small, then messages take most of the container
width thanks to actions being in floated layout.

Task-3411797

closes odoo/odoo#127569

X-original-commit: fb100f848388d6e50029a81080e051c77cc057c2
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-06 19:46:21 +02:00
Alexandre Kühn 7f0e372e34 [IMP] mail: edit message comment in chatter
Before this commit, only logged notes could be edited in chatter.

With this commit, messages sent with "Send message" are also
editable.

Task-3380465

closes odoo/odoo#125939

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-06 17:52:01 +02:00
Thanh Dodeur fcfe6f5906 [FIX] mail: fixes button overflow of the chat window call buttons
Before this commit, the fixed margin between buttons wouldn't leave
enough room for all the buttons to fit in one row in the chat window.

This commit fixes this issue by using the flex space-between instead of
fixed margins.

closes odoo/odoo#127424

X-original-commit: c5a121729d5348ff81ef9bb8f58611c9234ef9f9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-06 01:52:43 +02:00
Alexandre Kühn e228acb081 [REV] mail: debounce suggestion (and channel selector) searches
This reverts odoo#126869.

Motivation for debounce was to reduce the amount of RPCs, to
not put too much load on server.

However, this makes showing of mention slower than it should,
and the load on server is already adjusted based on duration
of ongoing `fetchSuggestion` RPC: if server can reply with mentions
immediately, then no need to debounce. If the RPC is slow, then
next `fetchSuggestion` waits for current RPC to finish before
making a new fetch.

This PR also fixes this small crash when using mentions:

```
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at cleanTerm (format.js:244:1) (/mail/static/src/utils/format.js:244)
```

Steps to reproduce:
- type `@` then `backspace` then `@` then `backspace`, etc.

This happened because suggestion hook internal state had `term` being undefined when there is no term, but `undefined` is invalid for `cleanTerm`. `""` is a better default for no search term, and since this is a string this works with `cleanTerm`.

closes odoo/odoo#127399

Related: odoo/enterprise#43678
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 18:46:42 +02:00
Michael (mcm) ac153558a6 [FIX] web, mail: indirectly call a patched function
The commit [1] removed two async module and caused a reorganisation
on the module loading.
Since that commit, the patches could be applied in a different order
and be applied after a save of one these patches.

This commit fixes a case where we save the reference of a patched
function that we call it later with missing patches.

[1]: 96687f29496ab4cf16ae2ab1584ef1a6a3fb4a11

Part-of: odoo/odoo#121185
2023-07-05 15:58:20 +02:00
Sanjay-Sharma 4f6a92e684 [IMP] web_editor: add emoji picker in web editor
Purpose:

This commit adds Emoji_picker functionality to the web_editor,
allowing users to conveniently add emojis to their text and
improving the overall user experience.

Specifications:

Now we can insert emoji in web_editor using `/emoji`.

Task id: 3253958

closes odoo/odoo#125137

Related: odoo/enterprise#42772
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2023-07-05 11:37:06 +02:00
Sanjay-Sharma 4bc70c585c [MOV] moved emoji_picker from mail to web
Before this commit:

emoji_picker was in mail module

After this commit:

moved emoji_picker to web module

Part-of: odoo/odoo#125137
2023-07-05 11:37:06 +02:00
Alexandre Kühn 74b9986b30 [FIX] mail: improve horizontal spacing between msg avatar and bubble
Before this commit, horizontal spacing in message between avatar
author and bubble was too big. This makes reading messages slightly
hard, because this small gap gives the impression that the message
and avatar are 2 distinct part of UI.

This commit fixes the issue by reducing the size of message sidebar,
so that avatar and bubble are much closer together.

Also the message avatar was too close to the border of chat windows.
This commit fixes the issue by slightly increasing the horizontal
padding of messages in chat window (`px-1` => `px-2`).

closes odoo/odoo#127341

X-original-commit: 226c6588a89bf21e8c0a47010bffb8c59cbb4e37
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 01:31:05 +02:00
Alexandre Kühn a6ae780078 [FIX] mail: show updated activity date on changing its deadline date
Before this commit, when making an activity set at a specific date,
and then changing its deadline, the activity in chatter still displays
the old date instead of new date.

Steps to reproduce:
- schedule an activity in chatter for today
- edit activity and change deadline for tomorrow
=> Activity in chatter shows "Today" instead of "Tomorrow"

This happens because the compute of date delay in activity component
is made locally and relies on a field in activity model, which itself
is a reactive (because the activities are stored in discuss store,
which itself is reactive). This compute is made at setup and on change
of props. However, when the `deadline_date` in activity model changes
then the model is still the same, therefore it doesn't trigger the
`onWillUpdateProps`.

This would work if this part of template was fully relying on
`deadline_date`. It was the case for the icon, so the icon is working
well. But the label was computed locally, so OWL could not detect that
`state.delay` needs to be recomputed.

This commit fixes the issue by replacing `state.delay` to a getter
that reads on `activity.deadline_date`, so that this is reactive
to changes on `deadline_date`.

Also fixing a memory leak of a `setTimeout` that was not cleared on
unmounting `Activity` component.

closes odoo/odoo#127319

X-original-commit: d7e314dde8d7bb20ed83ba821cdad1009c87e4c8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 01:31:02 +02:00
Alexandre Kühn 496b74fe1b [FIX] mail: message res url should redirect to model
Before this commit, when opening the related thread of a
message from inbox with "Open Link in New Tab", it was not
redirecting to the thread.

This happens because the url was wrongly using message id rather
than thread id. As a result, it redirects to either bad model or
a non-existing model.

This commit fixes the issue by correctly using `resId` instead of
`id`, which is the thread id of message. Also renaming `url` field
of message to `resUrl`, to clarify this is the link of thread and
not a specific link to message.

closes odoo/odoo#127342

X-original-commit: 8270138aba7e31f5db7853fbf00be6922347a8c0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 00:19:37 +02:00
Alexandre Kühn 3b694fa179 [FIX] mail: message action list next to message in chatter
Before this commit, message action list in chatter were always
at the very right of chatter. On small messages, the gap can
be quite big, so it's not easy to tell which message is
related to the action clicked.

This commit fixes the issue by putting message action list
in chatter close to message content, similarly to how this is done
in Discuss app.

closes odoo/odoo#127334

X-original-commit: 06aa1a89ac23fb5705e6c588ff2c91193922d4ec
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 00:19:34 +02:00
Alexandre Kühn e1b85e79ee [FIX] mail: show tracking value changed messages on different lines
Before this commit, a tracking value message was displayed on a
single line instead of several lines. The parts of the content
of message with tracking values changes were wrapping on multiple
line.

This happens because the content of message had `d-flex`, which
affects notably tracking values that have this DOM shape:
```xml
<div class="o-mail-Message-content d-flex">
    <p>Stage changed</p>
    <ul>
        <li><span/><i/><span/></li>
    </ul>
</div>
```
Because of `d-flex`, `p` and `ul` were next to each other
horizontally, and the `span` in `li` were wrapping to take
responsive layout of `d-flex` into account.

This commit fixes the issue by removing the `d-flex`. This is
undesirable, as the content is HTMl and it should follow the
intended design of the content. `p` and `ul` next to each other,
without specifying custom `display`, should default to 2 `d-block`
next to each other, so they must be on top of each other.

closes odoo/odoo#127320

X-original-commit: c7df8a5fe0c3f785066800e77eef5a46246308dc
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 20:33:51 +02:00
Alexandre Kühn 2ac5ceb7ff [FIX] mail: keyboard navigation in chat window dropdown
Before this commit, dropdowns in chat window (chat window more menu,
message actions more menu) had no keyboard navigation support.

This happens because dropdown item navigation makes use of hotkey
service, and hotkey service intercepts keyboard in bubble phase on
window object. `ChatWindow` component had a `t-on-keydown.stop` on its
root node, which prevented the hotkey service to receive keyboard
navigation for the good working of dropdown keyboard navigation.

This commit removes the `.stop` modifier on this `t-on-keydown` root
node of `ChatWindow` template. `onKeydown` in dropdown inside chat
window have precedence over `onKeydown` on chat window: For example,
when dropdown is open, hotkey "Escape" closes the dropdown menu but
does not close the chat window.

closes odoo/odoo#127318

X-original-commit: 4b36b28bd9e426b115ffefbbc174fe2efa3dfbf3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 20:33:48 +02:00
Alexandre Kühn 4376cf80b9 [FIX] mail: rounded (not circle) avatar in activity and msg reaction
Before this commit, avatars in activity menu and in message reaction
menu were rounded circle, instead of rounded square.

All avatars were rounded-circle before MILK redesign in 16.3.
Since MILK in 16.3, almost all of avatars should be shown in a rounded
square. These 2 occurrences were using the old design of avatars.

closes odoo/odoo#127285

X-original-commit: ea83eb15b354470cbc104b4e0325280d5e349657
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 20:33:45 +02:00
Alexandre Kühn 25f0341a2d [FIX] mail: navigable list loading with gap between icon and label
Before this commit, when navigable list is loading data of
suggestions, the showing of "loading..." had label and icon
next to each other without any gap.

This commit adds a small gap between icon and label, so it looks
nicer.

closes odoo/odoo#127304

X-original-commit: 0aaab95cd39c50d9320dbec0417773497ebc0fcc
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 19:17:50 +02:00
Alexandre Kühn 987eeef710 [FIX] mail: debounce suggestion (and channel selector) searches
Before this commit, fetching suggestions (e.g. channel selector
in discuss sidebar "Find or create a channel", or `@`-mentions)
were performing RPCs on each user input, resulting in wasted
network and server load.

This commit fixes the issue by debouncing the fetching of
suggestions to 0.5 sec.

closes odoo/odoo#126952

X-original-commit: 6770ac3
Related: odoo/enterprise#43502
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 03:43:48 +02:00
Louis Wicket (wil) ce07b37111 [IMP] mail: make channel_info private
Make `channel_info` private so that it is no longer exposed to RPCs.

closes odoo/odoo#127078

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 00:51:54 +02:00
tsm-odoo 61ef69a8cf [IMP] im_livechat: small name, ui changes
This PR improves several things linked to visitors in the discuss
app:
- Change window header to "Visitor #, country"
- Change operator's name to Online Chat name if defined
- Rename "Public user" to "Visitor #", add country instead of website
- Change name of the thread to "Visitor #, country" (left panel + header)
- Remove "Website" from visitor's name (small and big threads)

part of task-3332872

closes odoo/odoo#125931

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-03 21:56:01 +02:00
Mathieu Duckerts-Antoine b72791f05b [REF] web: remove unused props in TagsList
Some props like className were declared as optional in TagsList while
they are not used by the component. We remove them from the props
declaration.

Part-of: odoo/odoo#126350
2023-07-03 16:58:55 +02:00
Elisabeth Dickinson d71c183f19 [IMP] mail: fix chat header's close button on mobile
While being logged in on mobile and having a chat window open in the
frontend, the buttons to close the chat window and to go to
the backend — both located on the top-left side of the screen — overlap,
making it impossible to close the chat window.

To solve this issue we've removed the chat window's `.fa-arrow-left`
and replaced it with the `.fa-close` icon on the right which is the
design we already have on desktop. Padding had been removed around
the close button on mobile and has been put back.

task-3120032

closes odoo/odoo#126889

X-original-commit: 870fcceab0c4142035d257b7b6fe6e7fcbf2a372
Related: odoo/enterprise#43485
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-01 03:40:46 +02:00
Alexandre Kühn 574a5a2f48 [FIX] mail: fix project invite button alignment in chatter message
This happens because last `<p>` of message was always `inline-block`
to properly position "(edited)". However, this was breaking some
non-editable content that relies on `<p>` default displays (`block`).

This commit fixes the issue by only inlining the last `<p>` of
an edited message. Non-edited message keeps the default styling of
`<p>`.

Also slightly improve alignment of edited on empty body messages.

Related to Task-3374747

closes odoo/odoo#126988

X-original-commit: 92b359347fc3e390a75ef7a27a9fa758a21673dc
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-01 00:51:48 +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
tsm-odoo 7e186375df [FIX] mail: correctly display unknown im status
Before this PR, the "unknown" im status was not properly
displayed. This commit ensures the question mark icon is displayed
when no im_status is available.

closes odoo/odoo#126958

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 15:41:49 +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
tsm-odoo 3a661beb3a [IMP] im_livechat: improve rating views
This commit improves the tree/kanban rating view for livechat
channels:
- Open the channel in discuss if the member is a member of it.
Open the form view otherwise.

part of task-3332872

closes odoo/odoo#125902

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 13:08:20 +02:00
Odoo a31fe2bb82 [FIX] discuss: channel name overflow
Before this commit:
The channel name used to overflow in the channel suggestion section.

After this commit:
The name will not overflow in the channnel suggestion section also
added limit on input character.

Task id: 3366608

closes odoo/odoo#126872

X-original-commit: 95c4b24a4fe8f2af1fce73e99684815d14a895be
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 01:33:03 +02:00
std-odoo d305a78202 [FIX] web: fix the size of the avatar image for a relational property
Bug
===
The many2one properties to res.users and res.partner have an image
with the avatar. But the size was applied only for the res.users
model (and it was implemented in /mail and not in /web).

Remove the `width: auto` because it's redundant with `aspect-ratio: 1`.

Task-3377098

closes odoo/odoo#126835

X-original-commit: e05caa80120bd5bc7ba0b078c3237daddae995ed
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-30 01:32:55 +02:00
Alexandre Kühn ca64f6f5bb [FIX] mail: improved (fuzzy) search of emoji picker
Before this commit, search in emoji picker was case-sensitive
and had no scoring of items. For example:
- typing "ok" did not match with 🆗
- "ok" 1st suggestion was 😘 because of keyword "face blowing a kiss"
 and this is one of the 1st emoji having characters "o" and "k" in
 search terms.

After this commit, search is now fuzzy:
- typing "ok" shows 🆗
- "ok" 1st suggestions are 👌 & 🆗

Task-3175520

closes odoo/odoo#126801

X-original-commit: 4953172398719df829735f381f4e8939f17b1989
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 00:21:16 +02:00
tsm-odoo 8c6ec25533 [FIX] mail: unpin thread should close chat window
Before this commit, unpinning a thread from the discuss app
would keep its related chat window opened. This PR solves
this issue.

Steps to reproduce (non channels):
- Open a chat window (e.g. sales channel)
- Go to the discuss app
- Leave the sales channel
- Get back to the home menu
- Chat window is now the "New message chat window" as the
thread has been removed but the chat window was not closed.

If those steps are reproduced with a channel (e.g. direct messages),
the chat window is kept as is as the channel is not removed.

task-3389554

closes odoo/odoo#126751

X-original-commit: ef14f50d9ab7e2f38d65ac569f4108a89abbb69a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 00:21:01 +02:00
Maitri Patel 229fe73517 [FIX] mail: handle error while click on follow button
When a user click on the 'Follow' button in the chatterbox of the project
Task form view without adding any data, then traceback will appear.

Steps to reproduce(i.e Project):

- Install project module.
- Go to Project >> Tasks >> My task(you can also choose the all task menu) .
- In the list view of project.task model, click on the new button.
- In-form view of project.task model, Click on Follow Button in the chatterbox.

Error: traceback appears: "psycopg2.errors.UndefinedFunction: operator does
not exist: integer = boolean"

sentry-4243265676

closes odoo/odoo#126749

X-original-commit: eeaee0d57effb50d3a0edad1672e17bffea11d0a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-30 00:20:58 +02:00
Zelong Lin a0aa45ce00 [IMP] mail: chat window dropdown actions from avatar & name
Before this commit, chat window actions were all placed in
the right part of header. It was showing the main action (call),
close action, and all other actions in dropdown menu from
the "..." (more) button.

This commit now replaces the "..." (more) button by clicking
on avatar/name of conversation. The "..." (more) button has been
replaced to "_" (minimize/fold) button, as clicking on header to
open/fold chat window can become hard due to avatar + name being
clickable to show most chat window actions.

This commit also adds the following actions in chat window:
- Open (Employee) Profile
- Rename (conversation)

Task-3336752

closes odoo/odoo#124592

Related: odoo/enterprise#42480
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-29 19:54:38 +02:00
tsm-odoo 9beb4668ca [IMP] im_livechat: improve feedback messages
This PR improve feedback messages:
- Visitor has left the conversation: as note
- Rating message: as note
- Rating message: Use same emojis as for customer
- Rating reason in same message as the emoji, without writing "reason"
- Feedback done in 1 rpc instead of 3

part of task-3332872

closes odoo/odoo#125925

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-29 18:20:25 +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
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
tsm-odoo 9dd1bcd80e [IMP] im_livechat: improve session history tree view
This PR improves the livechat session history list view:
- Clicking on a session opens the channel in discuss if the
user is a member of it. Opens the form view otherwise.
- Display duration of the session (last message datetime - first
 message datetime)
- Display country of the visitor

part of task-3332872

closes odoo/odoo#125899

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-28 12:30:53 +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
tsm-odoo 3ed674645d [IMP] im_livechat: add last used date to mail shortcodes
This PR make add a last used date to the canned responses
in order to know whether they are still usefull or not.

part of task-3332872

closes odoo/odoo#125909

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-27 16:26:51 +02:00
tsm-odoo 95ae1b6726 [FIX] mail: fix attachment alignment in chat window
This PR fixes an alignment issue for the attachments in the
chat windows. Indeed, those attachments were always displayed
to the left while it should be to the right in case it was
uploaded by the current user.

closes odoo/odoo#126355

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-06-26 21:10:32 +02:00
tsm-odoo 18dda9ddb4 [FIX] im_livechat: fix session demo data
This PR fixes some issues present in the livechat demo data:
- anonymous name should be given to the channel, and should be the
name of the visitor not the one of the channel.
- odoobot should not be a member of the channel (done by default
when creating a channel but making those channels that are supposed
to be one-to-one channels a group channel)

At the same time, this PR fixes an issue with the thread model that
contained clear commands instead of null value.

part of task-3332872

closes odoo/odoo#126219

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-26 20:01:15 +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
Louis Wicket (wil) e9f6c94aa6 [FIX] mail: show same unpin message everywhere
Before this commit, the unpin message was different depending on whether
the message was unpinned from the “pinned messages panel“ or from the
message action.

This commit unifies both flows by introducing a common method to pin and
unpin messages.

closes odoo/odoo#126072

X-original-commit: 9cf7ec443dce3a3d40a3e67533de60491bc9e7b6
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-22 19:37:15 +02:00
Hubert Van de Walle (huvw) 75bc86c817 [FIX] mail: usable ListActivity widget in many2many subview
Steps to reproduce
==================

- With studio, create a model
- In the form view, add a many2many pointing to res.partner
- Close studio
- Create a record
- Add a line by selecting a partner

-> `Cannot read properties of undefined (reading 'find')`

Cause of the issue
==================

The res.partner uses a custom widget for the activity field `ListActivity`.
The fieldDependencies selection fields are not properly defined.

opw-3360436

closes odoo/odoo#125907

X-original-commit: 69019fd51aa4d157b95dd44c9f359b967c67a23d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-21 19:04:17 +02:00
stefanorigano (SRI) b0baac6fc4 [FIX] web, mail: Dropdown and PopoverWowl, increase contrast
This commit adapt several components and utility-classes in order to
increase visual contrast.

In the case of `o-mail-ActivityGroup` and `o-mail-NotificationItem`
templates, these has been reworked in order to use default BS components
and consequently automatically inheriting the improved design.

task-3338419

closes odoo/odoo#124903

Part-of: task-3326263
X-original-commit: 190ec1c947e17b2b4aa8614e9e0a04d00cb38d90
Related: odoo/enterprise#42507
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:49 +02:00
Maryam Kia 896a69cc30 [IMP] mail: disable escape on composer wizard
task #2793003
- rename Cancel to Discard on composer wizard
- disable escape on composer wizard to prevent closing the composer accidentally

closes odoo/odoo#120427

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:46 +02:00
tsm-odoo 90dd769e93 [IMP] im_livechat, *: add emoji menu to embed livechat
*: mail, web.

This PR adds the emoji menu to the embed livechat. When mounting
the livechat on the odoo frontend, the env is shared between the
livechat app and the main app. This is an issue regarding the
overlay service since the `OverlayContainer` is mounted in the
light DOM while we would expect the overlay styles to be dicted
by the shadow DOM.

In order to solve this issue, an `OverlayContainer` is added to the
shadow DOM and a mechanism to determine whether the overlay belongs
to the light/shadow DOM is introduced.

part of task-2742676

closes odoo/odoo#125713

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-20 15:58:29 +02:00
Sébastien Theys 70eb043ccf [FIX] mail: clean chat window thread avatar
Remove uncessary ThreadIcon that only served as spacing, properly add
module icon for chatter records.

closes odoo/odoo#125388

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-19 16:39:56 +02:00