Commit Graph
4334 Commits
Author SHA1 Message Date
Thanh Dodeur eb37a32cec [FIX] mail: prevents RtcSession update in _willDelete
Before this commit, the RtcSession fields were updated in the
`_willDelete` which could cause tracebacks.

closes odoo/odoo#99701

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-15 17:18:22 +02:00
Thanh Dodeur 1c8fd08e7b [IMP] mail: call tests
Part-of: odoo/odoo#99701
2022-09-15 17:18:22 +02:00
Alexandre Kühn 486cd602fc [FIX] mail: guard ChatWindow/onClickHandler (nightly build failure)
closes odoo/odoo#100132

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-09-15 00:30:26 +02:00
Louis Wicket (wil) b9b0d9c462 [IMP] mail, *: inverse of identifying is automatically causal
* = im_livechat, snailmail

The model manager will now automatically add `isCausal: true` to inverse
of identifying fields. This commit implements the feature and removes
now unnecessary declarations of `isCausal: true` from the code.

Task-2741402.

closes odoo/odoo#100119

Related: odoo/enterprise#31290
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-14 21:22:15 +02:00
Aaron Bohy a7766e0f4d [FIX] web: SelectCreateDialog: remove padding
We don't want any padding in those dialogs. The presence of the
padding was a consequence of the rewritte of that dialog in owl.

It is a frequent usecase to remove the padding from the body of
dialogs. We thus introduce a new props on Dialog and when this
props is set to `true`, we do not set any padding on the body.

This commit refactors other usecases to make them use the added
props.

closes odoo/odoo#100045

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-09-14 21:22:12 +02:00
Gorash 5410b7c238 [IMP] base/web: XML templates are added into the asset bundles.
XML files are now declared in python module manifests. During the qweb
't-call-asset' directive, assetbundle will fetch the declared xml files,
apply the inheritance (t-inherit) and create a javascript service (for
eg: 'web.assets_backend.bundle.xml') which is added at the end of the
*.js mimifier file.

When the debug mode is activated, comments are added in the template
indicating which file the template comes from as well as the
inheritances applied to it.

****

JavaScript:

assets.js (module @web/core/assets) takes care of loading libraries,
javascripts and styles.
`loadJS(url)` (loads the javascript and returns a resolved promise when
the templates are also loaded via the '*.bundle.xml' service)
`loadCSS(url)` (loads the style a resolved promise when the file is
loaded)
`loadXML(xml, app=assets.defaultApp)` (load template into
application/owl, used by the `*.bundle.xml` services)
`getBundle(bundleName)` (get the bundle descriptor)
`loadBundle(desc)` (load the files and bundle from a descriptor)

templates (XML element content all owl templates)

A new `ready(serviceName)` method on boot.js lets you know when a
service is loaded are the require.

The xmlDependencies attribute no longer exists.

Python:

The xmls taken into account by assetbundle.py, applying `t-inherit`
inheritances and adding an `name_of_the_bundle.bundle.xml` service in
the generated JavaScript file.

****

Every manifest changes is into the next commit, except 'web_tour' in
this current commit as example.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Brieuc-brd 8b708cca59 [IMP] mail: CallSettingsMenu: review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2980888

closes odoo/odoo#100032

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-13 18:57:09 +02:00
William Braeckman e2ba23ea17 [IMP] mail: Migrate many2many_tags_email widget to Owl
closes odoo/odoo#99230

Related: odoo/enterprise#31254
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-13 13:53:08 +02:00
Viktors Lipskis (vili) bbf3dedb7a [FIX] mail: fix activity Mark as Done panels
Clicking on kanban activity Mark as Done button now works as expected, either displaying one empty panel or displaying no panels at all.
Before this commit, repeating a click on the button did not reset the panel, so the next click added another form to the panel.
Also, clicking on the button left other panels open.

task-2961943

closes odoo/odoo#98832

Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-09-13 09:31:11 +02:00
William Braeckman 44cfa03587 [IMP] mrp: migrate mrp_documents_kanban to wowl2
This views has multiple custom features such as file upload, attachment
viewer and download.
A lot of files have been rendered obsolete and have been deleted,
notably `file_upload_mixin` which has been replaced by the
file_upload service and hooks.

closes odoo/odoo#99769

Related: odoo/enterprise#31145
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-12 17:33:14 +02:00
Nicolas Bayet 10af6e83bf [IMP] web_editor,mass_mailing: adapt fields to use owl
- adapt the html field and mass_mailing_widget to be owl components
- adapt the mass mailing view to be an owl view

task-2898432

closes odoo/odoo#94875

Related: odoo/enterprise#30915
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-12 11:38:00 +02:00
Sébastien Theys e8b369e724 [IMP] mail: clean legacy activity file (2)
- move BasicActivity to KanbanActivity (only usage of that abstract class)
- remove useless class o_activity_link
- remove useless class o_activity_label
- move d-flex from o_activity_title_entry to template
- move align-items-baseline from o_activity_title_entry to template
- move o_no_activity SCSS to template
- clean selection compute
- clean record_id
- clean activityState, _setState, _reset
- remove obsolete unlink activity code

closes odoo/odoo#99824

Related: odoo/enterprise#31201
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-09 16:23:43 +02:00
tsm-odoo f7e0da7b71 [IMP] mail: improve after event error stack trace
Before this commit the error raised/logged when rejecting the afterEvent
promise was imcomplete. This is due to the fact we're creating the
error inside the promise itself. In order to get a better stack trace,
the error is now declared outside of the promise.

Moreover, both `afterNextRender` and `afterEvent` functions were using
`console.error` before rejecting the promise. This is also a problem
since runbot will show the error printed by `console.error` instead of
the one of the test failure. In order to solve this issue, those two
`console.error` have been replaced by `console.warn`.

closes odoo/odoo#99899

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-09 14:41:25 +02:00
Louis Wicket (wil) 9e685f0147 [IMP] mail: move "isAddingItem" logic from Discuss to DiscussView
This move will remove the need of the adjustment compute and therefore
will avoid writing on computed fields.

closes odoo/odoo#99891

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-09 12:17:13 +02:00
Alexandre Kühn d8f1b8deda [FIX] mail: emoji picker with emoji up to unicode 12.0
Task-2977886

closes odoo/odoo#99844

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-09 11:12:41 +02:00
Alexandre Kühn d41f6e7687 [IMP] mail: emoji picker view no search content screen
Task-2976156

closes odoo/odoo#99700

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-09-09 02:41:48 +02:00
Alexandre Kühn b63a7deb0e [FIX] mail: dialog properly manage overflow for long content
Before this commit, when content of dialog was long, content
overflow but was not scrollable, which makes bottom unreachable,
which is especially a problem when buttons are at the bottom.

This problem solves the issue by adding classname `modal` to
dialog. This classname puts proper handling of overflow of
dialog and its content.

Also remove `align-items-center` so that top doesn't overflow
in isolation from the rest of content, which made top unreachable.

Task-2973866

closes odoo/odoo#99865

X-original-commit: 9f4495aa065da5e94d6ccd007c9f26b7d755f140
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 21:43:21 +02:00
Alexandre Kühn c1051a154b [FIX] mail: emoji picker properly show last row in search
Before this commit, when searching an emoji in emoji picker,
the last row was frequently now showing. This is especially
a problem with very specific search, whose results are not
showing any result, like "bomb" for 💣

This commit fixes the issue by properly showing the last row.

Task-2976677

closes odoo/odoo#99766

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 21:43:06 +02:00
tsm-odoo c01b9e7bdd [FIX] mail: model manager is debug during tests
Since the PR introducing the wowl environment in the discuss app, the
model manager is not set in debug mode during tests. The debug mode
is usefull since it adds integrity checks and more verbose error
messages. This commit restores it.

closes odoo/odoo#99556

Related: odoo/enterprise#31086
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 12:46:37 +02:00
Alexandre Kühn d8ba2ce234 [IMP] mail: introduce Messaging/executeGracefully
- Made executeGracefully in messaging so it can have specific
behaviour in qunit tests (no timeout)
- guard all usages of `executeGracefully` in case current record
is deleted (e.g. during test teardown).

Task-2976295

Part-of: odoo/odoo#99556
2022-09-08 12:46:37 +02:00
Alexandre Kühn c4e84115c2 [FIX] mail: remove manual .update() in onScrollActiveCategory
This computed field was manually updating a field, which is
not correct. Instead, this field should have been an `onChange`,
which is what this commit does as a fix.

Task-2976940

Part-of: odoo/odoo#99556
2022-09-08 12:46:37 +02:00
Didier (did) a06161ec1c [IMP] mail: introduce _generateMessageBody
Avoid code duplication by introducing `_generateMessageBody` function.

closes odoo/odoo#99745

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 11:45:18 +02:00
Alexandre Kühn f48479e7ee [FIX] mail: remove manual .update() in compute of emoji grid rows
Task-2976694

closes odoo/odoo#99771

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 03:23:53 +02:00
Alexandre Kühn 67e3603c07 [FIX] mail: emoji picker with only widely supported emojis
1. Remove emoji that have unicode version equal or greater than 13.0.

2. Also removes "smiling_face" and "frowning_face" emojis, as although
they are old emojis, their visual support is quite lacking, so
they feel off. As substition, use "slightly_smiling_face" and
"slightly_frowning_face" respectively.

3. All regional flags have been removed.

4. the 11 remaining flags have been moved to "Symbols" category.

Task-2976577

closes odoo/odoo#99753

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 02:25:57 +02:00
Didier (did) 8d8a4ef9b5 [IMP] mail: remove isPostingMessage from updateMessage
Since we are not using `postMessage` in `updateMessage`, setting
isPostingMessage is not useful.

closes odoo/odoo#99744

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 01:08:20 +02:00
Alexandre Kühn 0f2e34acc8 [IMP] mail: shorten emoji picker search placeholder
Task-2976308

closes odoo/odoo#99724

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 01:08:05 +02:00
Sébastien Theys e605f90ab6 [IMP] mail: clean legacy activity file
In preparation of future clean up.

- remove obsolete method _fetchSpecialActivity
- apply lint / some es6 syntax on legacy activity file
- use async/await and remove most self in legacy activity
- inline activity setFileUploadID function
- inline activity _bindOnUploadAction function
- inline activity setDelayLabel function
- inline activity _readActivities function
- inline activity _sendActivityFeedback function
- inline activity _bindPopoverFocusout function
- remove obsolete activity _unbindOnUploadAction function

closes odoo/odoo#99646

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 00:13:05 +02:00
tsm-odoo 7b10219d32 [FIX] mail: fix composer attachment upload test
Before this PR, the `remove an attachment..does not need any confirmation`
test would fail because the attachment was deleted while still
uploading. Since the abort controller does not work in the mock
server, the attachment would have finished its upload after its
deletion. This commit solves this issue by waiting for the attachment
to be uploaded before deleting it.

closes odoo/odoo#99758

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-07 18:57:00 +02:00
tsm-odoo 0954f0284c [FIX] mail: fix chatter attachment drop test
The chatter drop attachment test fails in an indeterministic manner.
This is because we're assuming that the next render will be the one
corresponding to the file uploading. In order to be sure this render
is really the one we're expecting, the `o-file-uploader-upload` event
is added.

closes odoo/odoo#99652

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-07 18:56:57 +02:00
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