Commit Graph
11102 Commits
Author SHA1 Message Date
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
Astik Singh 200ccf1b10 [FIX] mail: prevent from modifying subtypes
Prior this commit:
In mail subtype, any users could have perform modification on it.

After this commit:
Now user have only access to read and only admin can do all the modifications.

Task-3245940

closes odoo/odoo#127539

X-original-commit: 1b99f9b6608793612dda72007a4ca2258373a97f
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-07-06 13:39:52 +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 73db32a17f [FIX] mail: send message on archived chatter
Follow-up of https://github.com/odoo/odoo/pull/120002

Commit above made a a structural change of code that
should not have changed the functional behaviour of
chatter.

In consideration of reducing query count footprint,
it replaced a `browse().exists()` by `search()`, as
`exists()` always perform a query whereas `search()`
may rely on cache and skip a query.

However, `search()` filters archived records, so this
change unintentionally removed the possibility to send
messages on archived chatter. Also the performance of
`search()` and `browse().exists()` are pretty much the
same, so the premise of changing it to `search()` seems
wrong.

This commit reverts this part so that this is the exact
same behaviour as before.

closes odoo/odoo#127518

X-original-commit: 43227ad2eaaeba3f6e3e6fae8b84728e0c33c59a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-06 00:27: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
Odoo's Mergebot 566a93567b [MERGE] base,hr: Remove Private Addresses
- The private addresses have been removed from the "res.partner" model.
- The employees' private address information has been moved to the "hr.employee" model, preserving the old records but emptying the private information fields.
- The applicant's private address information has been moved to the "hr.applicant" model, following the same approach.
- More generally, some efforts have been done to ensure we only create and use the same partner from the application form, to the employee creation and also the user creation.
- The salary configurator offer mechanism has been improved to provide stability (no more arguments in URL), traceability (track changes and responsibles) and reporting.

closes odoo/odoo#120586

Taskid: 3101400
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-07-05 17:33:59 +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
Yannick Tivisse fda7ec5f1f [FIX] mail: Fix truncated template field on mail.composer
TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse b1f7e56f79 [IMP] base: Remove private res.partner type
- Improve performances, as the ir.rule restricting private partners
  visibility is also applied on res.users by inheritance, on each
  prefetch.
- Solve the issue of partners set as followers on records (eg: application
  form) and then made private, making them impossible to contact via the
  chatter.
- Solve the multiple access issues when trying to access the bank
  account, or the private address for non HR people like the accountants
  forcing the usage of sudo in the business code.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Sébastien Theys ef4196281b [IMP] mail, *: optimize query of channel members
* = im_livechat, test_discuss_full

According to stats from our production database, this query is 10 times
faster than the one generated by the ORM by using a `left join` rather
than `id in`.

closes odoo/odoo#125961

Related: odoo/enterprise#43635
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-05 11:37:16 +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
Thanh Dodeur e8a883ff65 [FIX] mail: prevent crash when deleting a message
Since https://github.com/odoo/odoo/pull/126713, deleting a message
would crash as the `mail/message/update_content` route is called without
passing the `partner_ids` parameter.

This commit fixes the issue by making the parameter optional.

closes odoo/odoo#127284

X-original-commit: 34abd3dc1d159962a376b248134d0cd4977f3dcb
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-05 02:47:42 +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
Louis Wicket (wil) d0710323b9 [REM] mail: remove dead code
closes odoo/odoo#126641

Related: odoo/upgrade#4866
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-29 14:08:47 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41: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
Zelong Lin d32ba1a55e [FIX] mail: add users from self-chat
Before this commit, when opening self-chat and trying to add users,
self id was duplicated with the chat partner id, leading to a crash.

This commit fixes the issue by removing duplicates in inviting users,
so that there's no longer a crash when inviting users in self-chat.

task-3381895

closes odoo/odoo#126605

X-original-commit: d101a82b97989d5c60c1b6dfbc5fa2143680bd3c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-28 16:17:04 +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
Julien Van Roy ca4ba84d98 [FIX] mail: UTF-8 text/xml attachment and omitted charset
When parsing an email containing an xml attachment, the `email` python
module will decode the base64 attachment using the charset or ascii if
the charset is missing.

In some cases, the payload is in UTF-8 but the charset is omitted. This
results in replacement characters for the non ASCII characters.

The solution is to force the charset to UTF-8, since it is a superset of
ASCII that should not be a problem.

NB1: Omitting the charset for text/xml is not recommended. See the RFC
(section 6.4): https://www.ietf.org/rfc/rfc2376.txt

opw-3144519

closes odoo/odoo#126474

X-original-commit: e3a5b46c7b4f5030e165a6d943ec2275aea5d583
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2023-06-27 10:42:49 +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