Commit Graph
10579 Commits
Author SHA1 Message Date
Alexandre Kühn d9bb64f1e9 [FIX] mail: show email_from if message has no author
closes odoo/odoo#118038

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

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-07 19:43:25 +02:00
zel-odoo 21b6ef38cf [IMP] mail: activity visual update
1. always show the name of the assignee.
2. replace the icon with avatar
3. bold the time info.

task-3142628

closes odoo/odoo#116349

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-07 19:43:13 +02:00
Maryam Kia 7248178d19 [IMP] mail: Add message reaction menu
This commit adds a menu to see reaction on a message.
It can be accessed from message options or from long press in mobile.

Task-2641441

closes odoo/odoo#116022

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-07 19:43:10 +02:00
tsm-odoo d2e5969e3e [FIX] mail: indeterministic guest tour
This PR fixes the `19916` issue on the `test_mail_channel_public_page_as_guest`
test.

The messaging service subscribes to bus notifications before it is fully
initialized. This test is composed of two tours. In the first one, the guest joins
the channel and receives the "guest has joined the channel" message. Then, the second
tour starts and the local storage is cleared. Since the local storage has been cleared,
the guest receives this message again, potentially before messaging has been initialized
which leads to a `channel_pin` rpc. This RPC fails with `SessionExpired` error and the tour
is stuck and eventually, fails.

closes odoo/odoo#118000

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-07 11:37:30 +02:00
Alexandre Kühn 260e5de3df [FIX] mail: better border visual of chat window
closes odoo/odoo#117969

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-06 19:16:56 +02:00
Alexandre Kühn 104ad53516 [FIX] mail: correct orientation of self bubble in chat window
closes odoo/odoo#117965

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-06 19:16:53 +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
Thanh Dodeur 4d1e6481db [IMP] mail: improve handling of HTMLMediaElement errors
This commit improves the overlay icon that appears on call participant
cards when an error in the media players occur. The icon is now
clickable, which restarts an attempt to play all the `HTMLMediaElement`s
of the call as a recoverable error can occur when the browser does not
allow `HTMLMediaElement`s being played outside a user interaction.

other related changes:

* removing the `pointer-event:none` from the overlay as it was preventing
hover events, and the title tooltip from appearing.

* removing the try/catch around the `srcObject` assignment, as it should
only crash on old browsers without support for `srcObject` for which the
support of using the alternative (`URL.createObjectUrl` with
`src`) is being dropped.

closes odoo/odoo#117446

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-06 16:12:10 +02:00
Julien Carion (juca) 41a7af5ba6 [IMP] web, webclient: Add autoOpen prop to Dropdown
This commit adds a new prop to the Dropdown component: autoOpen.
It is true by default and follows the current behavior of all
current dropdowns (automatically open the dropdown when it is
hovered and a sibling is already opened) when set to true and
disable this feature for the dropdown when set to false.
The commit also applies this new property and set it to false on
all small icon dropdowns that are present by default in the
enterprise navbar to facilitate navigation with these (debug,
 messaging and activity)

opw-3259473

closes odoo/odoo#117622

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-04-06 14:58:53 +02:00
Sébastien Theys e477c5d71b [FIX] mail: keep mentions when toggling composer or editing message
closes odoo/odoo#117786

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-05 16:26:26 +02:00
Mahamadasif Ansari 5ad9686b2f [FIX] mail: composer non-thread _compute_subject
When using the composer on a non-thread model a notification is sent instead
of posting a message, as the model does not support the posting process.
However there is currently a crash due to the default subject computation
which is solved in this commit.

Task-3254379

Part-of: odoo/odoo#117763
2023-04-05 15:11:33 +02:00
Renaud Thiry 442467ceb8 [FIX] mail: handle non-thread model in _message_format
Calling _message_format on a anything but a thread could throw a traceback.

Task-3254379

Part-of: odoo/odoo#117763
2023-04-05 15:11:33 +02:00
mky-odoo 2cc2690c8f [FIX] mail: prevent to call _message_compute_subject outside of a thread model
While we run cron `Data Merge: Find Duplicate Records` an issue raises because
`data_merge.model` has no method `_message_compute_subject`. Indeed it is
possible to notify on non-thread models but that method is a thread-only
method.

In this commit, we only call `_message_compute_subject` when it's available
in model.

sentry-3947126655
Task-3254379

Part-of: odoo/odoo#117763
2023-04-05 15:11:32 +02:00
Sébastien Theys 672f2b2383 [FIX] mail: return guests in /who command
closes odoo/odoo#117717

X-original-commit: e4d832804b6d317a4dedc6a11e2e62c1721a6190
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-04 20:08:44 +02:00
Pooja Kantesariya 7b5b26d8a0 [FIX] mail: return guests in /help command
task-2917720

X-original-commit: 320501875e027ae8fbb46d1c8b892d2f189595b7
Part-of: odoo/odoo#117717
2023-04-04 20:08:44 +02:00
Sébastien Theys b7dd007396 [FIX] mail: allow click on suggested recipient input
closes odoo/odoo#117681

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-04 19:11:48 +02:00
Sébastien Theys 4e33fc4816 [FIX] mail: add recipients as follower when sending message
Part-of: odoo/odoo#117681
2023-04-04 19:11:47 +02:00
Alexandre Kühn 7b21be10fd [FIX] mail: handle notification for guests not users
Some code in handle notification wrongly assumes `store.user`
is set, as it reads `user.id`. This is correct when the user
is authenticated as an internal user, but for guests this is
incorrect.

This commit adapt code of handling notifications so that
`store.user` can be undefined for guests.

Fix runbot issue 19978

closes odoo/odoo#117647

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-04 16:02:28 +02:00
Alexandre Kühn 24e5b5afcf [FIX] mail: do not console warn when cannot load emoji picker
This happens intentionally on tours that finishes successfully
before the emojis are fully loaded. Notably short tours like
public discuss page show this case.

The console.warn still trigger unhappy runbot. Functionally
the emoji picker shows "Failed to load emoji", so this warning
becomes useless.

Fix runbot issue 20081

closes odoo/odoo#117642

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-04-04 16:02:25 +02:00
Alexandre Kühn a61ce3491a [FIX] mail: fix public discuss crash on isSelfAuthored
This may happen when receiving a new message without setting
the self persona yet.

Fix runbot issue 19975

closes odoo/odoo#117633

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-04 16:02:22 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
Thanh Dodeur 6c8439ce43 [FIX] mail: add missing call icon in the discuss sidebar
Following the discuss refactoring* the call icon in the discuss sidebar
has not been reimplemented.

This commit fixes this issue.

\* https://github.com/odoo/odoo/pull/110188

closes odoo/odoo#117464

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-03 15:59:52 +02:00
luvi 129fa3f150 [MOV] web, *: move TagsList to core components
Since this component is imported and used in many places, it is more
convenient to move this component a core component instead of a
component made exclusively for the Many2ManyTagsField component.

This change makes the usage of TagsList possible by SelectMenu, which
would create issues as the fields folder should not be imported in
other modules.

Part-of: odoo/odoo#115799
2023-04-03 13:55:17 +02:00
Lucas Perais 91000641f1 [FIX] mail: tests helpers: export mail setup registries
This commit exports the function responsible for setting up the mail registries in tests.

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

Part-of: odoo/odoo#115799
2023-04-03 13:55:16 +02:00
Louis Wicket (wil) 418159b716 [IMP] mail: sync activities data between tabs
Task-2714099.

closes odoo/odoo#115986

Related: odoo/enterprise#38537
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-31 17:02:30 +02:00
Jeremy Kersten 51884712cd [FIX] mail: fix access rights for reaction in portal
Before this commit, the portal user get a Access Error.
After this commit, the portal user see the chatter without error.

The code works with reaction browsed in sudo, but since we use a ior
with a record not in sudo, we loose the sudo flag and so the right for
portal user to read it.

```py
x = record.sudo()
y = record
x |= y -> (x, y) in sudo
y |= x -> (x, y) not in sudo
```

How to reproduce ?
Assign lead to a portal user
Post a message with another user like demo on the lead
Add reaction with the admin user
Open the opportunity on the portal with portal user
-> access error

opw-3215507

closes odoo/odoo#117313

X-original-commit: 2bde53541b7a0171c7d1b89e0e412d624f5eab37
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-31 15:52:42 +02:00
Romain Estievenart fb8112a06b [IMP] mail,hr,web: change the UX of the Many2ManyAvatarFieldPopover
The commit change the design of the Many2ManyAvatarFieldPopover the goal
is to remove the m2m dropdown and fill the dropdown content directly
inside the popover.

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

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

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

Task ID: 3229888

closes odoo/odoo#117194

X-original-commit: f0d71e98743421318a798ef9d4f1e75d11a23334
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-03-31 10:53:08 +02:00
Thanh Dodeur 560243aefa [FIX] mail: prevent attachmentViewer crash when clicking a video
In the last refactoring*, the click event handler from the old code
was missed, calling an undefined function, which can cause a crash
on some browsers.

This commit fixes this issue and implements the expected behavior of
preventing the propagation of the click to the parent handler that
closes the attachmentViewer.

\* https://github.com/odoo/odoo/pull/110188

closes odoo/odoo#117288

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-03-31 08:51:05 +02:00
Alexandre Kühn 96ebb86201 [FIX] mail: CTRL-C content in chat window from home menu
Before this commit, when in home menu with a chat window,
it was not possible to copy content in conversation with
CTRL-C.

This was due to keydown event being intercepted by the hidden
home menu input.

This commit solves the issue by not propagating keydown events
above chat window, so it's not intercepted by the home menu for
his input.

closes odoo/odoo#117211

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 18:59:05 +02:00
Alexandre Kühn 43bc9897e3 [FIX] mail: read more/less link on message of type notification
Read more/less requires content being `t-ref="body".
It was not properly set for messages of type notification, thus
skipping the read more/less insertion in the content.

closes odoo/odoo#117203

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

This PR reintroduce this feature.

closes odoo/odoo#117101

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 17:57:53 +02:00
Renaud Thiry 035057a522 [IMP] mail: track contact address
Currently there is no way of knowing who changed the address
of a partner. This field is of high importance and should be
tracked to be able to follow who is editing it.
As addresses are represented with a bunch of fields, tracking
them individually would result in weird-looking tracking
messages with each value stacked on top of the other.

To avoid this, we take advantage of the fact that tracking can
be used on non-stored compute fields to log any change as a
change over the full address.

The full address is derived from the contact_address field to
take advantage of the existing regional formatting of addresses.
It is however modified to replace return to lines with commas to
accomodate the formatting of tracking messages in the front-end.

task-3165293

closes odoo/odoo#114695

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-30 16:22:45 +02:00
zel-odoo fa006f2bbe [IMP] mail: ChannelSelector improvements
1. Display no result when having no matched results.
2. Hidden when clicking outside of the field.
3. Be visible when clicking inside the field.
4. Add related tests

task-3208033

closes odoo/odoo#116214

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-30 15:09:20 +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
Alexandre Kühn e4537f7fc6 [IMP] mail: several emoji picker improvements
- Bigger and centered emojis in grid
- Better visual clue of focused input from search icon
- No search screen with icon + text
- Consistent sizing of emoji picker in case of failure
- Added basic test for active highlighted category

closes odoo/odoo#117001

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-03-30 09:49:52 +02:00
Thibault Francois 352f87585d [FIX] mail: fix missing recipient data
Use case
--------
If the a user has partner_share set to NULL not to 'false'
he will not receive any notification

The orm consider False and NULL value as False for boolean field,
the query that fetch the recipient data should have a consistent
behavior

closes odoo/odoo#117083

X-original-commit: a50fbd1f9404fd05eb576474eb3d10c94d37aa52
Signed-off-by: Thibault Francois <tfr@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-30 08:50:05 +02:00
tsm-odoo ce135776be [FIX] mail: make thread topbar icons reflect active state
task-3251550

closes odoo/odoo#116863

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-29 13:06:49 +02:00
Renaud Thiry ecbca821ad [FIX] mail: make access button clickable
When the template layout was made more mail-client friendly in 16.0
we used padding on a <td> node with
a color background to make it look like a button with centered text.

This approach makes most of the button unclickable.

The fix is to put the padding inside the link itself so that the whole
'button' is clickable. We already do this for most templates.

task-3168757

closes odoo/odoo#116945

X-original-commit: c40327db4f46040d4a6ed0231afcdefd5be47db5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-29 10:37:37 +02:00
Alexandre Kühn e4bd98a4a5 [FIX] mail: do not crash on failing loading emoji in tests
Before this commit, tour may end before emojis are loaded.
This results in following crash:

```
Trying to set result to failed (AssetsLoadingError: The loading of /web/assets/3949-d14fea7/mail.assets_emoji.min.js failed
    at HTMLScriptElement.<anonymous> (http://127.0.0.1:8069/web/assets/3709-a5ab371/mail.assets_public.min.js:7008:270)) but found the future settled (<Future at 0x7fee7552a410 state=finished returned bool>)
```

This commit hides the crash in case the loading of emoji fail,
and instead show emoji picker without any emoji.

Fix runbot issue 19877

closes odoo/odoo#116845

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-03-28 18:45:59 +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
Aurélien Warnon 5a37fbc6cb [FIX] mail: fix user preference test
This commit mocks the "preference_save" action on the res.users model during
the test that checks that the user can modify its own preferences.

This allows to ease the testing as a context reload in the middle of test steps
was not handled correctly by the test runner.

Task-3246086

closes odoo/odoo#116800

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-03-28 17:48:58 +02:00
Alexandre Kühn 72ccd229e9 [IMP] mail: improve message options
- Message options always compact by default
- when compact: "reaction", "reply", "favorite", "more"
- "delete" is shown after "edit"
- dropdown for "more"

Task-2362261

closes odoo/odoo#116029

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-28 16:44:07 +02:00
Alexandre Kühn a99aa4a868 [FIX] mail: allow scroll in activity menu
Before this commit, it was not possible to scroll
inside long activity menu.

Dropdown already manage scroll, so the content should not put
overflow management, to the risk of introducing scrollbar twice
or making content non-scrollable.

Task-3249174

closes odoo/odoo#116815

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-28 13:44:06 +02:00
Yolann Sabaux 71ed187223 [FIX] account: display pdf attachment
Steps to reproduce:
- Install l10n_mx modules
- Switch to MX company
- Create invoice and confirm it
- Send it to PAC in test environment (Process Now button)
- Click Send & Print button

Issue:
- XML Preview does not display, only shows the file name in the top right corner of the chatter.

Cause:
In l10n_mx_edi, when posting the invoice, the only attachment available is the xml sent to the government in `_message_set_main_attachment_id`.
Therefore the xml is set as the main attachment.
When clicking on "Send and Print", the pdf is generated but the main attachment is still the xml

Solution:
Redefine the main attachment everytime the the main attachment is an xml

Note:
- octet-stream have also been filtered out

opw-3085934

closes odoo/odoo#116784

X-original-commit: 48e6e81a47f5371f5985d135e56f39f445eb2854
Related: odoo/enterprise#38861
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-28 13:43:57 +02:00
Thanh Dodeur 5f82fc4cc6 [IMP] mail: add the "raise hand" feature to calls
This commit adds a button to the `CallActionList` to signal to the
other participants of the call that one is raising a hand.

This will add a hand icon to the `CallParticipantCard` of the people
with a raised hand and send a notification that is displayed in the
`Call` view (only when in discuss, not in chat windows).

task-3229507

closes odoo/odoo#116658

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-28 13:43:40 +02:00
Géry Debongnie 3db0ad01a1 [REF] web, *: rework webclient cache invalidation system
The web client has a mechanism to invalidate the action and the view
cache: in the basic model (and the relationalmodel), some code is
looking for updates to some specific models (such as ir.actions) and
trigger a `CLEAR-CACHE` event. This event is then listened by the action
and view services to properly clear the caches.  This mechanism was also
used to reload the page after editing a company, or reloading the
currencies after editing some currency.

With this commit, we modify the orm service to trigger an event after
each rpc. This event can then be used by the action/view service, and
also by the currency/company services to perform their specific cleanup.
This work is one step in the future refactoring of the relational model.

closes odoo/odoo#115655

Related: odoo/enterprise#38814
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-27 16:04:58 +02:00
Thanh Dodeur 49ff78711e [FIX] mail: prevents crash in some channelMember inserts
Before this commit, we were trying to access
`channelMember.thread.channelMembers` when inserting a member, but
some inserts come without this key.

A traceback could occur when inserts of `rtcSession` records came
with a `channelMember` with little information on their thread.

closes odoo/odoo#116656

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-27 12:47:23 +02:00
Archana Vaghasiya 13554dd655 [FIX] mail: invalidate the cache of the documents
If applied, this commit will solve the keyError for _invalidate_documents.

Before this commit:
============================================
KeyError 'rating' or 'False' occurs when a user tries to send a message and
 _invalidate_documents() takes the parameter model equal to 'rating' or 'False'.
but the model 'rating' is not available in the database and It will be accessed
by the self.pool[model].

After this commit:
============================================
Solved the issue when the model 'rating' is not available or the model is 'False'
while sending a message.

sentry - 3956327451

closes odoo/odoo#116302

X-original-commit: 5becbca6531d5829bee262a5c1b64ae5e0917f8e
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-27 09:39:53 +02:00