Commit Graph
5042 Commits
Author SHA1 Message Date
Sébastien Theys 517c206cb5 [REF] mail, im_livechat: move chat window notify to discuss folder
Part of task-3265211

Part-of: odoo/odoo#125388
2023-06-19 16:39:56 +02:00
Sébastien Theys 6f246d7fa2 [REF] mail: move attachment deletable condition to discuss folder
Part of task-3265211

Part-of: odoo/odoo#125388
2023-06-19 16:39:56 +02:00
Sébastien Theys 97259f8076 [REF] mail: remove obsolete chatter channel condition
The chatter is no longer displayed on the channel view.

Part of task-3265211

Part-of: odoo/odoo#125388
2023-06-19 16:39:55 +02:00
Maryam Kia f5dd14e8ce [FIX] mail: message sent twice because of the wrong tempId
task #3356870
Before this fix, at the first time of sending message in a chat, the tempId of the message in the chatter, crashes the getting lastMessageId and the first tempId in the chat becomes NaN.

closes odoo/odoo#125424

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-19 13:35:34 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
Sébastien Theys 70b4ba4539 [FIX] mail: load around not formatting parent messages
This results in parent message being displayed as text when it is part
of the result of a load around call.

closes odoo/odoo#125439

X-original-commit: 783a5186cf7529161d95c34c9290dc57a32b8200
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-16 23:01:24 +02:00
Sébastien Theys d619908772 [FIX] mail: fix mock server of load around
Forgot to properly sort messages, resulting in returning messages not
actually around but the most recent instead.

X-original-commit: 803f1ad7e3bceaa8f03fca06f920447ce9d8eb69
Part-of: odoo/odoo#125439
2023-06-16 23:01:24 +02:00
Sébastien Theys 22fa09f63e [FIX] mail: fix message create returning proxified version
Double assignation does not chain, resulting in the non proxified
message being returned, which can potentially cause issues either when
comparing messages by reference or if a reactive version is expected.

X-original-commit: 30a77cb2778ec0fce5892cfd3903aa1982825626
Part-of: odoo/odoo#125439
2023-06-16 23:01:23 +02:00
Alexandre Kühn 2d5194f8a3 [FIX] mail: show correct button style for "Send" in chatter
Small mistake during forward-port of [1],
`btn-link` was moved from `t-att-class` to `class`.

The `btn-link` visual is specific to non-chatter, therefore
it should be in `t-att-class`.

[1] https://github.com/odoo/odoo/pull/124905

closes odoo/odoo#125395

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-16 14:59:53 +02:00
Alexandre Kühn 6977b4c84e [FIX] mail: correct push notification content
Before this commit, push notificiation content
was not displayed correct.

When receiving message `&lt;`, it shows `<`.

This commit fixes the issue by not unescaping the content.

closes odoo/odoo#125314

X-original-commit: 4f8ba016e63cb9817d61705ce262d392f7704ef5
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 12:19:06 +02:00
Alexandre Kühn 9b55c4565b [FIX] mail: linkify message content
closes odoo/odoo#125307

X-original-commit: 406ff4727e361588bded08c6719f932a8b800b35
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:32 +02:00
Aman Patel e0de62b5a3 [FIX] mail: message notification double escape issue
Before this commit:
In discuss when a user receives a message containing strings from any of
these '>,<,&' it gets converted to `>,<,&`  respectively.
For example, if a user sends '<abc>' , when the chat is out of focus,
the toaster  notification will show a notification with an escaped message
i.e.`<abc>`.

After this commit:
The message will be shown as it is, in the toaster notification.

Task-3284244

closes odoo/odoo#125306

X-original-commit: bbc9966198eb644c220d98452e0ef53c8424f5ea
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:30 +02:00
Alexandre Kühn 8a885bb5ba [FIX] mail: play sound effect from new message with push notif
When odoo tab is out-of-focus and user receives a new message,
it should play a sound effect. This works when showing notification
in Odoo, but when push notifications were enabled it did not play
the audio.

This commit fixes the issue by playing audio when receiving push
notification of new message while out-of-focusing the tab.

closes odoo/odoo#125305

X-original-commit: b0b4f300705595df31588e747e1b12ad99f6d8d0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:27 +02:00
Alexandre Kühn e82a35b588 [FIX] mail: thread content with few content should be at bottom
closes odoo/odoo#125163

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:10 +02:00
Alexandre Kühn 5276ed23e6 [FIX] mail: show typing in chat window
closes odoo/odoo#125135

X-original-commit: c9a94488381abef016a28a4bda0b23423e8217ee
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:55 +02:00
Alexandre Kühn af21d99a36 [FIX] mail: pass props to thread actions
Since [1] thread actions are stored in a specific registry.
Some of those actions require props to be passed to their
component.

Those props are not correctly passed as the `componentProps`
key is in fact a function that returns the props but is
treated as the props themselves.

This commit fixes this issue by transforming `componentProps`
into a getter, so that `action` is internally passed to
`componentProps` definition. The templates using thread
actions can still use `t-props="componentProps"` as getter,
as the active action is deduced by transform automatically.

[1]: odoo#123454

closes odoo/odoo#125120

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-15 18:51:48 +02:00
Alexandre Kühn 57a6a995c9 [FIX] mail: correct seen indicator alignment in squashed message
Before this commit, the seen indicator in squashed messages was
not centered. This is especially noticeable in comparison to
shorten date when hovering on this squashed message in chat window.

This commit centers the sidebar in squashed messages.

closes odoo/odoo#125082

X-original-commit: 1c342c1c5c14add563bba07fe5e5b6e6fbe9fdb3
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:43 +02:00
Alexandre Kühn da73468c31 [FIX] mail: linkify url with subdomain containing numbers
Before this commit, when posting a message in discuss with some
urls, the url was not linkified.

Example of such linkify not working:
```
https://www.45017478-master-all.runbot134.odoo.com/web

```

The url regexp was changed with [1]
to make punctuation mark the end of url to linkify. The 1st dot
removed in diff was a mistake. This commit reverts this part, so
that url above is correctly linkified while fixing the problem
of [1].

[1] https://github.com/odoo/odoo/pull/122621

closes odoo/odoo#125081

X-original-commit: bbbc85865b45615937a22ed08b6e560a0aa898a0
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:39 +02:00
Alexandre Kühn 8a9bc4c55e [FIX] mail: Send message/log note in chatter style with MILK
- Send button has text "Send" or "Log" depending on composer mode
- When button is active, it has `btn-primary` and composer mode
  buttons use `btn-outline-primary`
- Add hint to use Send keyboard shortcut for fast send in chatter

Other changes:

- Re-introduce missing feature to jump to present when posting
  a new message in a thread.
- In chatter, the topbar and composer are sticky. Whole chatter
  is scrollable rather than just a part of it. As a result,
  `Chatter-scrollable` becomes `Chatter-content`.
- Editing a message in chatter now uses the extended composer

Task-3356271

closes odoo/odoo#124905

X-original-commit: 894ec7e7757d2bb78574e8cd210012b83fad1cf6
Related: odoo/enterprise#42508
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:14 +02:00
luvi 410c3dce05 [FIX] mail: display strip animation on filtering activities
This commit fixes the display of the ColumnProgress component, which was
no longer displaying an animation when a filter is applied. This was due
to changes made in commit (1), introducing an "activeBar" key on the
value given to the ColumnProgress component.

A test has been modified to assert that the classes corresponding to the
animation are added as expected when a filter is selected.

1) 58ca40b032

closes odoo/odoo#124969

X-original-commit: b4857a5c4570d3824b581003cdf456bcdc29f75f
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-06-15 00:12:45 +02:00
Sébastien Theys 77fa212a43 [REF] mail: move ChannelSelector to discuss folder
Part of task-3265211

closes odoo/odoo#124891

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-14 22:40:02 +02:00
Jay Savaliya 156625b86e [FIX] mail: arrow icon should be centered in join button
On the welcome page, in the join channel button, the arrow icon is not centered.

Technical reason:
Currently, fa-stack class is used with the oi class, that results in the
misalignment of the arrow icon, which prevents it from being centered.

After this commit icon will be centered.

Task-3355356

closes odoo/odoo#124910

X-original-commit: 60b0155ee17e74f7eadfa02c635b8b617c451be4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-14 10:54:33 +02:00
Alexandre Kühn 1d42692cfd [IMP] mail: improve discuss counter style
To match the visual of the messaging menu badge for its counter.

Task-3345133

closes odoo/odoo#122946

Related: odoo/enterprise#42493
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-13 19:28:59 +02:00
Alexandre Kühn b90b64c6b5 [IMP] mail: improve new message separator visual
smaller and centered text

Part-of: odoo/odoo#122946
2023-06-13 19:28:58 +02:00
Alexandre Kühn b399b1afe0 [FIX] mail: no crash on livechat close in mobile
Steps to reproduce:

- Create a chatbot
- Browse your website as a user in moble
- Start a conversation with your chatbot
- Go back to your website or close the window

There was a crash because some code in chat window service
makes sense only in `/web`.

Task-3367338

closes odoo/odoo#124716

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-13 12:49:39 +02:00
Alexandre Kühn 8f38b5130c [FIX] bus, mail: message notif should not increment counter twice
Before this commit, a new unread message could contribute to unread
counter of conversation twice.

Steps to reproduce:

1. Log in as Demo and start a conversation with Mitchell Admin
2. Log in as Admin: if this is the first message in the conversation,
   counter is correct and shows (1)
3. Log out as Admin
4. Send another message to Admin
5. Log in as Admin and notice that the counter is doubled
6. If the conversation was still open, counter is correct!

This happens because some notification are pending dispatch before
fetching messaging state initially. The counter at init_messaging
fetch takes into account the notification. However, when handling
the message notifcation, it's wrongly considered as a new
notification, thus incrementing the counter when it shouldn't.

This commit fixes the issue by fetching the last bus notification
when fetching init_messaging. Doing so allow to determine whether
a notification is newer or older than init_messaging state.
This helps deciding whether the counter should be incremented or not.

Task-3357960

closes odoo/odoo#124767

X-original-commit: 081ab772dece86f1b5a5d4b3f6227b4b311d9206
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-06-13 10:14:06 +02:00
tsm-odoo 6dae07e56d [FIX] mail: fix emoji picker xml
Before this commit, a `t` opening and closing tag mismatched.
This would lead to an error when exporting the discuss app
translations.

```
Traceback (most recent call last):
  File "/home/odoo/Desktop/odoo/odoo/odoo/tools/translate.py", line 1152, in _babel_extract_terms
    for extracted in extract.extract(extract_method, src_file, keywords=extract_keywords, options=options):
  File "/home/odoo/.local/lib/python3.8/site-packages/babel/messages/extract.py", line 322, in extract
    results = func(fileobj, keywords.keys(), comment_tags,
  File "/home/odoo/Desktop/odoo/odoo/odoo/tools/translate.py", line 905, in babel_extract_qweb
    tree = etree.parse(fileobj)
  File "src/lxml/etree.pyx", line 3521, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1880, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1900, in lxml.etree._parseFilelikeDocument
  File "src/lxml/parser.pxi", line 1795, in lxml.etree._parseDocFromFilelike
  File "src/lxml/parser.pxi", line 1201, in lxml.etree._BaseParser._parseDocFromFilelike
  File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
  File "/home/odoo/Desktop/odoo/odoo/addons/mail/static/src/emoji_picker/emoji_picker.xml", line 60
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: t line 10 and div, line 60, column 15

```

closes odoo/odoo#124751

X-original-commit: eb59c0157cbe2d5d82356333b0e35a5f9513524d
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-06-13 10:13:51 +02:00
Sébastien Theys 6021b68b17 [REF] mail, im_livechat: move author open chat to discuss folder
Part of task-3265211

closes odoo/odoo#124495

Related: odoo/enterprise#42264
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-12 17:41:14 +02:00
Sébastien Theys 0a3ae9e9a4 [REF] mail: remove obsolete class o_redirect
Part-of: odoo/odoo#124495
2023-06-12 17:41:14 +02:00
Sébastien Theys 3ba40f468d [REF] mail: remove obsolete test tracking setup
Part of task-3265211

Part-of: odoo/odoo#124495
2023-06-12 17:41:13 +02:00
Sébastien Theys 16329a6a3e [REF] mail, im_livechat: remove obsolete context service
inPublicPage is already written from public page boot

Part of task-3265211

Part-of: odoo/odoo#124495
2023-06-12 17:41:12 +02:00
Sébastien Theys d0dbd25701 [REF] mail: move activity cell from core to views
Part of task-3265211

Part-of: odoo/odoo#124495
2023-06-12 17:41:11 +02:00
Sébastien Theys c38e1bfee9 [REF] mail: move public page to discuss folder
Part of task-3265211

Part-of: odoo/odoo#124495
2023-06-12 17:41:10 +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
Alexandre Kühn aea5e51c42 [FIX] mail: long logged note in chatter should word break
Otherwise it makes whole chatter overflow on the right.

closes odoo/odoo#124618

X-original-commit: 61f47dfe74fa65fa55aa68c4a9676362511dc478
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-12 14:04:15 +02:00
tsm-odoo 5c12a8b82e [FIX] mail: load after message order
In [1] the order by `id ASC` has been removed from the
`_message_fetch` method. This is wrong since we want
to load the messages coming DIRECTLY after the given
id thus, this order is required.

In order to solve this issue, this commit ensures the
order of the messages returned by the `_message_fetch`
method is always in descending order as it was done
implicitly before [2].

[1]: https://github.com/odoo/odoo/pull/123664
[2]: https://github.com/odoo/odoo/pull/116666

task-3349175

closes odoo/odoo#124169

X-original-commit: 074a5fea5a7f08c7018620cb9b2b956b3a871344
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-06-12 14:03:53 +02:00
Zelong Lin 4c107fd8c2 [FIX] mail: systray styling
closes odoo/odoo#124467

X-original-commit: 41e839cdc2017549091ffa9ded787e131678e032
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-09 17:01:54 +02:00
Sébastien Theys 2e386d966a [FIX] mail: move channel url to discuss folder + fix cache key
Avatar didn't sync when changed due to miss reading the cache key.

Part of task-3265211

closes odoo/odoo#124466

X-original-commit: 58fea4c78e11176bac609f89476fec8cd9fdb5df
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-09 17:01:51 +02:00
Aditya Sharma f79f2be85c [FIX] mail: preview of some documents were broken
How to reproduce the bug
========================
-> Try to preview some documents like (Employement Contract.pdf or Odoo CLA.pdf).
-> Preview is broken.

Technical
=========
"application/pdf;base64" mimetype was not included in the isPdf()  so the
method was returning the false value.

After this commit:
==================
Now the PDF containing this mimetype are previewable.

Task-3305415

closes odoo/odoo#124412

X-original-commit: 698d51fa56be47eb108cec299b12a3f6b58058b9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 17:00:58 +02:00
Sébastien Theys 9dba4e0d77 [REF] mail, *: reorganize JS files
Remove "fake" feature sub-folders that make files harder to find.

Note: If there are too many files in the main folder now, a new split
that actually makes sense can be done at a later time: this would not
just be code move, but removing coupling between said feature and the
rest of the code.

Apply consistent structure, where the top level folder is a feature (or
core), and sub-folders are subdivision of the feature depending on
context (closely related to assets bundles).

```
- core
    - common
    - public
    - web
- feature
    - common
    - public
    - web
```

The opportunity is taken to reorganize the top of the files and imports:
- Always use absolute path in imports to be able to find all usages of a
  file with a single search.
- Reorganize imports to group them by module, and to sort them
  alphabetically by path/feature.
- Always use single asterisk (*) for `odoo-module`: less characters yay!
  And double asterisk should be used for JSDoc comments, not for custom
  instructions.

Part of task-3265211

closes odoo/odoo#124168

Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-08 21:52:44 +02:00
luvi 2a1a388ffb [FIX] mail: clear groupBy from ActivityModel load
This commit fixes issues that could happen when a groupBy is present
in the load params from the ActivityModel. Before the rewrite of the
view to Owl, this code was present but was forgotten. This causes
crashes whenever web_search_read is then called, leading to undefined
record in the template, and crashing the view.

Now, the groupBy param (if present) is replaced by an empty array.

A test has been added to verify that during the load, even if the
ActivityModel has received a groupBy in its load parameters.

closes odoo/odoo#124215

X-original-commit: b6fa8ec174f5467baaed32b0c12acd0224757281
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-06-08 09:10:04 +02:00
Sébastien Theys 0dfed1b18b [REF] mail, im_livechat: move call files to discuss call folder
Part of task-3265211

closes odoo/odoo#124066

Related: odoo/enterprise#42093
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-07 18:01:04 +02:00
Sébastien Theys 227796c984 [REF] mail: move tests to core folder
Avoid having test floating in the root folder.

Part of task-3265211

Part-of: odoo/odoo#124066
2023-06-07 18:01:04 +02:00
Sébastien Theys 5dde72ace7 [REF] mail: move call tests to discuss call folder
Part of task-3265211

Part-of: odoo/odoo#124066
2023-06-07 18:01:03 +02:00
Sébastien Theys f9d0bef6b7 [REF] mail, im_livechat: make test setup methods patchables
Part of task-3265211

Part-of: odoo/odoo#124066
2023-06-07 18:01:03 +02:00
Alexandre Kühn 04b45dc43c [FIX] mail: more friendly pin message dialog
Task-3347745

closes odoo/odoo#124032

X-original-commit: 860ce3a
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-07 15:58:48 +02:00
Alexandre Kühn d9679cafe0 [FIX] mail: same icon size of expanded message actions
closes odoo/odoo#123798

X-original-commit: 125201ce0b96cada42b6059707ffcb7212909b44
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-06 13:10:27 +02:00
Alexandre Kühn 6741ebdd62 [FIX] mail: no size flicker on message hovering
Following https://github.com/odoo/odoo/pull/123266 that removes
some vertical spacing between messages.

The date text on squashed messages was increasing size of messages
that fits on a single line.

This commit fixes the issue by slightly reducing the size of date
text in sidebar, so that when hovering messages it doesn't affect
the size of messages.

closes odoo/odoo#123799

X-original-commit: 454d250e6c88b09d616d4d3404204d57addf8b28
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-06 11:45:16 +02:00
Alexandre Kühn 23e60fb780 [FIX] mail: no access right issue on open chat from message avatar
Before this commit, when hr was installed and Demo clicks on avatar
of Mitchell Admin, open chat failed due to access right exception.

This happens because open chat works only with internal users, and
when we don't know whether the partner has an internal user, we have
to check whether there's a user linked to this partner.
Doing `searchRead()` without passing any field triggers this missing
access right for some reasons.

Only the knowledge of an existing `userId` is enough, so we
can actually just make a `search()` to get the user id. This won't
trigger the access right exception while giving the user id of
the partner if this exists, thus proceeding with open chat request.

closes odoo/odoo#123796

X-original-commit: 2f6dc5f4222d380cf77c6660ccce8b7381e0e64a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-06 11:45:14 +02:00
Sébastien Theys 08a06c6e8f [REF] mail: make thread actions more generic
This will remove the necessity to patch component, and remove
duplciation between discuss and chat window.

Part of task-3265211

closes odoo/odoo#123454

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-06 11:45:04 +02:00