Commit Graph
4305 Commits
Author SHA1 Message Date
Alexandre Kühn b5ce1e39d7 [IMP] mail: Improve Emoji Picker (step 2)
Improvements:

- Much more emojis in the emoji picker (more than 1800 emojis, up from 81)
- Fuzzy search bar to find emoji in the emoji picker

Known limitations:

- Emoji visual is based on browser/OS, so some emojis may not be visible on some devices

Task-2957928

closes odoo/odoo#99343

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-07 02:17:47 +02:00
Didier (did) 683f9be971 [FIX] mail: fix traceback with empty message body
This PR fix a traceback that occure when the message body is empty (eg: only
uploading an attachment).

closes odoo/odoo#99625

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 18:23:00 +02:00
tsm-odoo 0f9b11a025 [REM] mail: remove obsolete wait until event parameter
The `waitUntilEvent` start helper parameter has become obsolete. Indeed,
events are systematically awaited by the `openDiscuss`/`openView`
helpers. This commit removes this parameter.

closes odoo/odoo#99577

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 15:22:59 +02:00
Zelong Lin d57c64f95b [IMP] mail, *: remove 'public' field in channel
*: im_livechat, website_livechat

Access right should be based on channel type and membership instead.
Chat always private, group always private, channel private should
disapear and be a group instead (migration needed), and other channel
always public (but they can still be further restricted with
the "allowed groups" feature)

task-2632861

closes odoo/odoo#90415

Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 10:57:59 +02:00
Zelong Lin d23db6e9da [IMP] mail: who command supported in group
task-2971564

closes odoo/odoo#99545

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

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 18:35:08 +02:00
tsm-odoo 591baa9003 [FIX] mail: fix indeterministic chat window manager test
Before this PR, some mail tests relying on DOM elements being present
but that are added after the messaging initialization could fail
unpredictability. This commit fixes this issue by waiting the next
render following the initialization of messaging.

closes odoo/odoo#99461

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 16:54:12 +02:00
Louis Wicket (wil) ff49527fb5 [IMP] mail, *: convert ThreadPreview to use Channel instead of Thread
* = im_livechat, rating, test_mail_full

Part of task-2948676.

closes odoo/odoo#99342

Related: odoo/enterprise#30921
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-05 16:53:52 +02:00
Louis Wicket (wil) 9beb2b13d3 [MOV] mail, *: rename ThreadPreviewView files to ChannelPreviewView
Part of task-2948676.
* = im_livechat, rating, test_mail_full

Part-of: odoo/odoo#99342
2022-09-05 16:53:52 +02:00
Thanh Dodeur a78adfb8a3 [IMP] mail: adds the blur feature to video calls
This commit implements the blur feature to the user-video (=not screen
sharing) during video calls using google's MediaPipe library*.

* https://google.github.io/mediapipe/

task-2818116

closes odoo/odoo#94982

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-05 16:53:45 +02:00
Didier (did) 7ceb079455 [IMP] mail: implement link preview with OpenGraph Protocol
OpenGraph Protocol https://ogp.me/ allow us to get some data from the link that
are shared in message.

task-2365881

closes odoo/odoo#82641

Related: odoo/enterprise#30867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 14:49:30 +02:00
Louis Wicket (wil) 10950d549d [IMP] mail: add support for inline definition of sort and compute
This commit allows compute and sort functions to be declared within a
field definition instead of providing a string with the name of the
record method to be used to compute/sort the field value.

Example of code with compute inline:
```javascript
registerModel({
    fields: {
        thread: one('Thread', {
            compute() {
                return {
                    id: this.id,
                    model: 'mail'.thread',
                };
            },
        }),
    },
});
```

Example of code WITHOUT:
```javascript
registerModel({
    recordMethods: {
        _computeThread() {
            return {
                id: this.id,
                model: 'mail.channel',
            };
        },
    },
    fields: {
        thread: one('Thread, {
            compute: '_computeThread',
        }),
    },
});
```

The aim of these changes is to empower a better separation of concerns,
by allowing to group together in one place the data related to a field.

Note that for technical reason (`Function.prototype.call` not working as
expected with arrow functions), compute/sort functions should not be
arrow functions.

closes odoo/odoo#99424

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-02 19:14:04 +02:00
Didier (did) c89853c219 [IMP] mail: move command code out of postMessage
closes odoo/odoo#99489

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-02 17:46:17 +02:00
Zelong Lin 0c3961008e [FIX] mail: guard message view
add guard on onMouseenter/onMouseleave

task-2901855

closes odoo/odoo#99477

X-original-commit: 7ce86d6c90062c9f8eef0ba7337d773e6a79f5ec
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-02 17:46:02 +02:00
Thanh Dodeur 291e99b7f7 [FIX] mail: prevents traceback when downloading rtc call logs
Before this commit, since https://github.com/odoo/odoo/pull/96954 ,
the `CallActionListView` had its `channel` field renamed into `thread`.

A reference to this old field name was missed which caused the
traceback, this commit fixes this issue by using the right field name.

closes odoo/odoo#99447

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-02 12:21:41 +02:00
Sébastien Theys 545d23888b [IMP] mail, im_livechat, *: add typing for guest and clean code
* = bus, hr_holidays, test_discuss_full

- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly

task-2664853

closes odoo/odoo#98923

Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 20:21:58 +02:00
Didier (did) f922f51910 [FIX] mail: avoid partner without name in suggestion
task-2884212

closes odoo/odoo#99432

X-original-commit: 385ba1d062abbc73ca3cdb9a27adb4b9cc7803be
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-01 19:17:32 +02:00
Zelong Lin d862ff258a [IMP] mail: remove legacy popover
task-2968421

closes odoo/odoo#99402

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 18:11:09 +02:00
Brieuc-brd 48d4b386f2 [FIX] mail: Message space between messages
Prior to this commit, the space between messages where too large and
created inconsistencies.

This commit fixes this issue.

closes odoo/odoo#99396

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 18:10:59 +02:00
Thanh Dodeur a90266e393 [FIX] mail: make call participant card colors more consistent
Before this commit, we were using `bg-secondary` which was dependent on
whether we used community or enterprise style, and `bg-black-75` which
is legacy and not available on the discuss guest page.

This commit fixes this issue to make the colors consistent across those
cases.

closes odoo/odoo#99393

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 17:11:19 +02:00
Bruno BoiandJulien Mougenot 0f49724436 [IMP] web: simplify format/parse/deserialize date(time) utils
The goal is to improve the dates utility functions (parse/format) by removing the timezone option, which is difficult to understand and has proven to be error prone.

- Rationale
When manipulating DateTime objects on the JS side, associated timezones
must be always coherent.
Until now, there were several code parts that had to check the DateTime
timezone and handle things differently in a case or another.
This sometimes lead to wrong code.
E.g. there was a bug in the DatePicker component because the DateTime
object it receives in props is in local timezone, but once it updates it
through the parse utility, the new object is in UTC.

- After this commit
The DateTime objects you'll get through deserialization or parsing are
always set in the user's local timezone.
The formatted strings you'll get through formatDate and formatDateTime
utils will always be expressed in the user's local timezone.
The formatted strings you'll get through serialization utils will always
be expressed in UTC.

- serializeDate and serializeDateTime
  - expected input: a DateTime object (its timezone does not matter)
  - outputs: a string formatted for the server expressed in UTC

- formatDate and formatDateTime
  - expected input: a DateTime object (its timezone does not matter)
  - outputs: a string formatted for the user, expressed in the user's TZ

- deserializeDate and deserializeDateTime
  - expected input: a date(time) string provided by the server, in UTC
  - outputs: a DateTime object in user's TZ

- parseDate and parseDateTime
  - expected input: a date(time) string provided by the user, in its TZ
  - outputs: a DateTime object in user's TZ

- Other changes in this commit
As the timezone option has been removed from parsing/formatting utils,
all their usage had been adapted in the codebase.
The large diff in dates_tests.js is because some tests were reorganized,
others were removed/adapted/joined.
A test has been removed from daterange_field_tests.js, because it has
no sense: it displays a date field as a datetime, but a date field does
not have any time information.

Part-of: odoo/odoo#98980
Co-authored-by: Julien Mougenot <jum@odoo.com>
2022-09-01 17:10:59 +02:00
Sébastien Theys aad27c38ea [FIX] mail: fix model manager isDebug
Mix of proxy and non-proxy was causing issue in set of records.

closes odoo/odoo#99388

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 15:33:36 +02:00
Didier (did) ac5cf64c24 [FIX] mail: remove unexisting fields from condition
closes odoo/odoo#99387

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 15:33:29 +02:00
Didier (did) 091e54ca17 [FIX] mail: remove unexisting field from template
https://github.com/odoo/odoo/pull/98262 introduce a t-out on a field that
doesn't exist.

closes odoo/odoo#99381

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-01 15:33:19 +02:00
Zelong Lin 14316ddd74 [IMP] mail: group_id explicit in channel_create
follow up https://github.com/odoo/odoo/pull/94510/commits/64d01d43a0f69c29cb9ad900c7aaa6ae00d8b4e4

task-2893661

closes odoo/odoo#98875

Related: odoo/enterprise#30722
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-01 13:08:47 +02:00
William Braeckman d325c028db [IMP] mail: change identifyingmode of attachment viewer
Part of the document B2B (see odoo/enterprise#29807 )

The attachment viewer can be opened without being a dialog in the
documents app now.

TaskId-2863861

closes odoo/odoo#98389

Related: odoo/upgrade#3835
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-31 22:13:04 +02:00
Louis Wicket (wil) fa445f6117 [FIX] mail: make Activity/note field readonly
3c28be1b33ea18be7280d9372ebd53a54140da86 enforced readonly by default on
computed and related fields, but Activity/note was not adapted to be
readonly, leading the application to crash when editing a note.

This commit fixes it by introducing a new field to write on instead of
the computed one.

Follow-up of task-2955927.

closes odoo/odoo#99310

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-31 18:54:04 +02:00
Louis Wicket (wil) c9d810f05f [IMP] mail: replace throw with warn in model manager
closes odoo/odoo#99306

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-31 18:54:00 +02:00
Louis Wicket (wil) 9fded39f48 [IMP] hr, mail: use Channel instead of Thread in getChat
Part of task-2948676.

closes odoo/odoo#99281

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-31 17:54:22 +02:00
Zelong Lin e1e6417604 [IMP] mail: remove legacy popover
task-2968161

closes odoo/odoo#99279

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-31 17:54:19 +02:00
Louis Wicket (wil) d713bf261e [FIX] mail: adapt RTC code to not write on readonly fields
3c28be1b33ea18be7280d9372ebd53a54140da86 enforced readonly by default on
computed and related fields, but some fields were not changed to be
readonly, leading the application to crash when editing them.

This commit fixes that by introducing new fields to write on instead of
the readonly ones.

Follow-up of task-2955927.

closes odoo/odoo#99253

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-31 17:54:13 +02:00
Achraf (abz) 31f389b983 [FIX] *: Adapt old custom-control class of Bootstrap
* = hr_holidays, mail, sale, web, web_editor, website, website_forum,
website_payment, website_sale

https://getbootstrap.com/docs/5.1/migration/

replacing `custom-control` by `form-check` because in bs4 this class had
a use which is not the case in bs5.

closes odoo/odoo#98965

Related: odoo/enterprise#30768
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-08-31 16:05:20 +02:00
Thanh Dodeur a8d7887f34 [FIX] mail: prevents shared rtcSession focus across callViews
After https://github.com/odoo/odoo/pull/78439 and before this commit,
the `activeRtcSession` was a field of `callView` which is the same view
for all channels. Which means that setting an `activeRtcSession` would
display it for any channel instead of only the channel that hosted this
session.

This commit fixes this issue by moving the field to the `Channel` model.

closes odoo/odoo#99270

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-31 12:38:05 +02:00
Brieuc-brd 5459b11015 [FIX] mail: MessageInReplyToView, space after author
Prior to this commit, there was no space between the author's name and
the message.

This commit fixes this issue.

closes odoo/odoo#99235

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-31 12:37:55 +02:00
Didier (did) bec6cefd0c [IMP] mail: differentiate message and notification in channel
This PR changes the way notification are displayed inside the a channel.
Currently, notification look exactly the same as a message send by the user.

task-2918956

closes odoo/odoo#98262

Related: odoo/enterprise#30732
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 23:40:24 +02:00
Didier (did) 5c861656b6 [IMP] mail: rename MessageListViewMessageViewItem in MessageListViewItem
part of task-2918956

Part-of: odoo/odoo#98262
2022-08-30 23:40:24 +02:00
std-odoo 93fc52c8e1 [FIX] mail: allow a normal user to view the template body
Followup of odoo/odoo@1a3e713

Bug
===
If the user doesn't have the template editor, he cannot open the template
preview.

Technical
=========
The reason for that is because the web editor moves some CSS properties,
and so when the user tries to open the preview, an access error is raised.

Ideally, the template form view should not be editable if the access
rules do not allow it. But in _postprocess_tag_field, we only check
for access right because we don't have the record. So a user without
write access rules, but having write access right can edit the template
in the UI, and gets an error when saving.

Also, the web editor should not save the HTML value if no change are
made on the field (like all other text / char field).

To mitigate the issue in stable, we add a computed field that check the
access rules and make the body readonly if he can not edit the template.
So the web editor is not loaded, the CSS properties are not moved. Other
possible solutions are way to complex technically speaking (editor internals
to update in frontend, complex comparison of html blobs in backend, cache
usage making fields_view_get override not working in all cases, ... )

As the HTML body look weird in readonly mode, add the same border as the web
editor.

Task-2845877

X-original-commit: dcf3ab5fb41aa9ef6e59b2155bfd192e551b6476
Part-of: odoo/odoo#99256
2022-08-30 21:25:55 +02:00
Aaron Bohy bedce02bb7 [REF] web,mail,account: orm service: move context in kwargs
This commit standardizes the API of orm service functions by adding
a "kwargs" parameter, s.t. one can always use those functions even
if the target model overrides the corresponding method to add the
support of a given kwargs. Furthermore, to simplify those function
API, and to close the gap between the js and python APIs, we moved
the "context" argument inside the kwargs.

closes odoo/odoo#99018

Related: odoo/enterprise#30830
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-30 20:23:17 +02:00
Aaron Bohy 23101ed69a [FIX] web,mail: orm service: can pass kwargs to read
Before this commit, the "read" function of the ORM service didn't
allow to pass any kwargs. As a consequence, it wasn't possible to
call the "read" method of a model with "load" kwargs specified.
This commit fixes the issue, and adapts existing calls accordingly.

Part-of: odoo/odoo#99018
2022-08-30 20:23:16 +02:00
Alexandre Kühn b3b672a66b [MOV] mail, *: use PopoverView for Message/notificationIcon popover
closes odoo/odoo#98497

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-30 20:22:53 +02:00
Alexandre Kühn 4e697ff6d0 [IMP] mail, *: use PopoverView for Message/notificationIcon popover
*: sms, snailmail

Task-2864563

Part-of: odoo/odoo#98497
2022-08-30 20:22:52 +02:00
Louis Wicket (wil) 6a6e737f61 [IMP] mail, *: move channel concerns in Thread from Thread to Channel
This commit is the continuation of task-2948676 which consists of
lightening the Thread model by moving the channel-specific behaviours to
the Channel model.

The changes revolve around the DiscussSidebarCategoryItem model. The
goal is to use channel instead of thread as identifying field for
DiscussSidebarCategoryItem, and to move channel-specific fields involved
in the computes of this model from Thread to Channel.

Changes in this commit include:
+ move `avatarCacheKey` from Thread to Channel
+ move `correspondent`
+ move `correspondentOfDmChat`
+ move `custom_channel_name`
+ move `localMessageUnreadCounter`
+ move `serverMessageUnreadCounter`
+ introduce `Channel/displayName`
+ use channel instead of thread as identifying field for
DiscussSidebarCategoryItem

Part of task-2948676.

closes odoo/odoo#98149

Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 20:22:14 +02:00
Brice bib Bartoletti a3c7a06dc3 [REF] mail: remove account.move.line hack
While refactoring the move_line_list_views.js in owl, we provided the
account.move id and model + "generate" a thread in the front-end for
account.move.line instead of only providing account.move.line model and id.

This allows us to get rid of this hacky special case

Task-id: 2857743
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Sébastien Theys 4b2bd7b16f [FIX] mail: fixes various issues introduced by recent changes
- fix typo in model manager: "return" -> "continue" in loop
- fix typo in model field: "models" read from record not from field itself
- fix reading obsolete fields in message view
- move listeners on records directly rather than storing a map on model manager
  (code a bit easier to read, and issues on deleted records easier to debug)
- remove obsolete trigger of listener in _created (not possible to observe a
  record before it exists)

closes odoo/odoo#98892

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:22 +02:00
tsm-odoo 5b5052a774 [IMP] mail: remove follower subtype local id in tests
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the message
id is more than enough and available. This PR replaces follower subtype
local id data attribute by its subtype id.

task-2959366

closes odoo/odoo#98776

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-25 04:20:48 +02:00
Thanh Dodeur 3723b222b3 [IMP] mail: Call settings menu as right sidebar
This commit changes layout of call settings menu.

Before this commit, it was available in call action list
while in a call, as a dialog, in More > Settings.

With this commit, it's now available as an button in
thread topbar and chat window header, next to member
list button (`fa-cog`). It can be accessed even while
not in a call.

Task-2929713

closes odoo/odoo#96954

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-25 01:53:50 +02:00
Sarika Shekhada 2be526b295 [FIX] web: fix the traceback on schedule activity view
Before this commit, when we open activity view and click on schedule
activity >> select a record there is a trackback due to the
invalid default_res_id passed in context.

So in this commit, fixes the issue by passing the valid res_id in
instead of object with id and display_name.

task-2927335

closes odoo/odoo#96999

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-24 21:06:55 +02:00
tsm-odoo e91c0728fc [IMP] mail: remove message local id in tests
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the message
id is more than enough and available. This PR replaces message local id
data attribute by message id.

task-2959366

closes odoo/odoo#98728

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-24 19:53:54 +02:00
Brieuc-brd 30f520a494 [IMP] mail: Message, remove note style
Prior to this commit, the note had its own style. This created too much
confusion with the other message types.

This commit removes the note style to improve the readability in the
chatter.

closes odoo/odoo#98043

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-24 02:04:58 +02:00
Louis Wicket (wil) 381c0f0228 [IMP] mail: model_field: use this.model instead of record.constructor
Since be0fc43bbd0664340d555f2156630870e3548466, a reference to the model
is passed to ModelField constructor. This commit replaces all occurrences of
record.constructor with this.model (shorter and more straightforward).

closes odoo/odoo#98687

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 17:55:31 +02:00