Commit Graph
9921 Commits
Author SHA1 Message Date
tsm-odoo 9d86827840 [IMP] bus, *: only use one mock server during tests
*: mail, web.

The pyEnv used during tests is based on the mock server to provide
server like api. This issue is that when creating multiple environments
during tests, a new mock server is created each time. This is not realistic
since in a real world scenario, multiple tabs would share a single server.
In order to make pyEnv work with multiple tabs tests (e.g. multiple env tests),
let's create a single mock server shared between js environment during a test.

task-2053917

Part-of: odoo/odoo#97975
2022-08-12 23:37:38 +02:00
Didier (did) a682b0349c [IMP] mail: disable chatter when the user has no write access
Before this PR a user that could not post on the chatter could still try. This
PR disable the chatter topbar menu if the user doesn't have the write access.

task-2693304

closes odoo/odoo#88531

Related: odoo/enterprise#30054
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-12 23:37:10 +02:00
Thibault Delavallée 63e52c200f [IMP] mail: add default values when creating template from server action
Better avoid wrongly-defined templates.

Task-2613245 (Server actions mail update / cleaning)

Part-of: odoo/odoo#75906
2022-08-12 23:37:04 +02:00
Thibault Delavallée b3fc41cc44 [IMP] mail: add a post server action
Currently only an email action based on template exists in server actions when
having mail app installed. It basically sends an email based on a mail template.

However being able to post a message on record is also useful. Instead of
sending emails it post on a document as a comment or as a note, like what
users can do using the chatter. Notification flow for those cases is the
classic from post: followers, specified partners, Inbox/Email, ...

Task-2613245 (Server actions mail update / cleaning)
Closes #45640

Part-of: odoo/odoo#75906
2022-08-12 23:37:03 +02:00
Thibault Delavallée 138ab8ef14 [REF] base, mail, sms: cleanup ir.actions.server model constraints
In this commit we cleanup server actions model in order to make it a bit
more inlined with current code state of the art.

  * add no_create / no_open on technical fields (m2o towards fields notably)
    as creating or updating fields on the fly is not the purpose of base
    automation module;
  * rewrite onchange into compute or constraint methods;
  * add compute methods to cleanup data when changing configuration (model or
    trigger). Some fields have no usage except in some configuration better
    reset their value. Notably fields linked to the chosen model should be
    reset;
  * add constraints for invalid configuration, notably for models coherency
    with mail features;

Task-2613245 (Server actions mail update / cleaning)

Part-of: odoo/odoo#75906
2022-08-12 23:37:03 +02:00
Louis Wicket (wil) 090c558452 [IMP] mail, *: introduce Mailbox model for mail.box threads
This commit will simplify the code of Thread by properly splitting all
behaviors exclusive to mail.box threads.

* = test_mail_full

closes odoo/odoo#97996

Related: odoo/enterprise#30402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-12 17:06:08 +02:00
thcl-odoo 1a3517a572 [FIX] mail: correct starred count computation in private channels
Current behavior

Starred messages counter takes into account the starred messages of a private
channels even if we no longer have access to this channel. Happens with deleted
messages too.

Steps channels
- Install Discuss
- Create a Private Channel and invite Marc Demo to join it
then send him a message
- *As Marc Demo*, star the message then leave the channel
-> Starred counter still shows 1

Steps for deleted messages
- Join the private channel again
- Delete the starred message (with Mitchell Admin)
-> Starred counter still shows 1 for Marc Demo

Reasons
Starred message count is computed by a raw sql [1] which only counts partner's
occurrences without taking into account the message's state and/or the
associated channel.
Side records (stars, notifications) are not removed when emptying a message
content [2].

With changes

- It doesn't take into account messages from a private channel which we no
longer have access to by doing a search on mail.message instead of doing it
in SQL (which filters out invisible messages);
- It correctly voids side records when emptying messages;

Side effects

This somehow raises number of queries because we now check access on messages
and records. However this is necessary as bypassing ACLs means unreachable
notifications or stars.

OPW-2742092
Task-2813738

[1] : https://github.com/odoo/odoo/blob/2c1c6b1373c238216fda1e2d9d2f00b5d16c8ca3/addons/mail/models/res_partner.py#L49-L51
[2] : 776d1ee08b

closes odoo/odoo#97974

X-original-commit: b1e8f7d97e3a1fa624436d2dd6801bf5fe7d19aa
Related: odoo/enterprise#30415
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-12 17:06:02 +02:00
tsm-odoo 1766c6997a [FIX] bus, mail: fix model definitions setup moved in wrong module
The model_definition_setup has been moved in [1] but adds some models
to be fetched that are not related to the bus module. This would lead
to error in single module builds.

closes odoo/odoo#97937

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-11 17:57:02 +02:00
Louis Wicket (wil) 52e6e0ce54 [IMP] mail, *: move channel_type field from Thread to Channel
As the name suggests, `channel_type` only makes sense for Channel.
This commit moves `channel_type` from Thread to Channel.

* = im_livechat, test_discuss_full

Part of task-2948676.

closes odoo/odoo#97779

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-11 17:56:51 +02:00
Rémy Voet (ryv) f80d8e00e4 [IMP] *: optimize redundant calls to exists()
Making a `exists()` on a record got by a `search()` is useless and
lead to a extra useless query. Remove them.

closes odoo/odoo#97482

Related: odoo/enterprise#30133
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-11 17:56:38 +02:00
Romain Estievenart c87b9e105c [FIX] mail: hide sharing screen button on mobile devices
The current implementation of sharing screen uses the
`MediaDevices.getDisplayMedia()` API. Sadly this API is not currently
supported by all major existing mobile browsers[1].
Some users were confused about the browser request permission
notification. As this is a way more complicated than just adding a
permission. We prefer to hide this feature by removing the screen
sharing button on mobile devices.

Links:
[1] https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=487935

opw-2915773

closes odoo/odoo#97947

X-original-commit: 2bf5ce06ef18d10c79ebab57551267eb31de872f
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-11 16:36:04 +02:00
tsm-odoo 6d9ff04a18 [FIX] mail: fix compute audio triggered on each qunit test
During qunit test, the audio notification is never used but the audio
element is still computed. This leads to unnecessary get requests
being triggered on the server. This PR prevent computing the audio
field of the user_notification_manager if canAudio is set to false.

closes odoo/odoo#97785

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-10 14:43:52 +02:00
tsm-odoo 75007b578e [MOV] bus, *: move startServer test helper to the bus module
*: calendar, hr, hr_holidays, im_livechat, note, rating, snailmail,
test_mail, test_mail_full, website_livechat, website_slides.

Part-of: odoo/odoo#97771
2022-08-10 14:43:41 +02:00
Lucas Perais 1814888a7f [FIX] mail: text emojis field should remove its dropdown on destroy
Have a field with widget text_emojis.
Click Edit on the form view.
Click Save.

Before this commit, the button that opens the dropdown was still present in the dom in readonly mode.

After this commit, it is correctly removed.

closes odoo/odoo#97704

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-09 09:00:10 +02:00
tsm-odoo d952fbcb96 [IMP] bus: move sendNotification to mail module
The BusService class only adds the possibilty to send notifications.
This is only used in the mail module. Let's remove this unnecessary
override and move this functionnality into mail models.

closes odoo/odoo#97685

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-09 06:28:00 +02:00
Didier (did) 633f58f8a4 [IMP] mail: im_status for guests
task-2883466

closes odoo/odoo#97076

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-08 21:02:21 +02:00
tsm-odoo d998c54feb [FIX] mail, bus: fix mock sendone/many crash during tests
The mock of sendone/many was relying on the bus_service. Since owl.Component.env
is changing during tests setup, the bus_service was not always defined. In order
to make this more reliable, the longpolling/poll route is now mocked, returning a
promise that can be resolved by the sendone/many methods.

closes odoo/odoo#97298

Related: odoo/enterprise#30059
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-05 16:35:45 +02:00
stefanorigano (SRI) 6b41d20815 [ADD] web, *: transition-x utility classes
Define classes for some default bootstrap transitions + 'none'.
These values are generic enough to fit different circumstances.

Classes added:
- transition-base
- transition-fade
- transition-none

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

closes odoo/odoo#97051

Related: odoo/enterprise#30066
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-04 13:54:15 +02:00
stefanorigano (SRI) bd2a1110a0 [REM] *: drop o_cursor_default & o_cursor_pointer classes
Drop custom cursor classes in favor of Bootstrap default ones.
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
Aaron Bohy 2ca93bd1ec [FIX] mail: correctly display activity dropdown in list
Before this commit, the dropdown of the activity widget wasn't
visible when the widget was used in a legacy list view, because of
the `overflow: hidden` rule on the cell.

Part-of: odoo/odoo#97415
2022-08-04 11:45:42 +02:00
Sébastien Theys 2a104bff47 [IMP] mail, im_livechat: remove obsolete SCSS rules
These rules no longer target any element.

closes odoo/odoo#97386

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-03 15:10:07 +02:00
tsm-odoo de498ee63a [FIX] mail: fix remove attachment from composer test
This PR fixes the 3922 runbot issue.

closes odoo/odoo#96972

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-03 04:31:46 +02:00
Zelong Lin 3ee2363a56 [REF] discuss: rewrite tests on test_mail_channel
rewrite some asserts on test_mail_channel.

task-2893661

closes odoo/odoo#94510

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-02 23:56:54 +02:00
Zelong Lin d072e6a860 [REF] discuss: rewrite setup classes on mail tests
rewrite setup classes on test files. Making it clear
for adding asserts in the future.

task-2893661

Part-of: odoo/odoo#94510
2022-08-02 23:56:53 +02:00
Zelong Lin 692ba8dc03 [IMP] discuss: adding groups into channel_create
task-2893661

Part-of: odoo/odoo#94510
2022-08-02 23:56:53 +02:00
Zelong Lin e3dcad0fb7 [REF] discuss: rename variables on mail tests
rename some variables on test files to make a better sense.

task-2893661

Part-of: odoo/odoo#94510
2022-08-02 23:56:53 +02:00
Romeo Fragomeli 18b4d919df [IMP] mail: add support for RTL in discuss public
As `discuss_public_channel_template` is sandboxed for the `webclient`
the following CSS rule is not applied anymore.
```css
.o_web_client {
  direction: ltr;
}
```

This commit adds it specifically for this template to reflect the
language direction in this sandboxed environment.

closes odoo/odoo#95893

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-02 13:06:33 +02:00
Martin Trigaux ffc525419a [IMP] base: avoid render with env mixup
The render API was confusing as mixing the access to the report and
the rendering env.

The ambiguity was present for code such as
`report.sudo()._render(record_ids)` where it was not clear if the
`sudo()` is needed to access to `report` or to `record_ids`. For low
priviledge users (such as portal or public), it was common to use
`report.with_user(SUPERUSER_ID)._render(record_ids)`.

This PR changes the render methods signature to be `api.model`. The
`report_ref` can be:
- ir.actions.report external id
- ir.actions.report id
- ir.actions.report recod
- `report_name` value

This will allow to call the report methods with any user and no longer
need to use `with_user(1)` to render reports as public user.

Task-id 2670865

closes odoo/odoo#91341

Related: odoo/upgrade#3650
Related: odoo/enterprise#27323
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-02 11:48:46 +02:00
Bruno Boi 9d1786c361 [IMP] web: account for local timezone when formatting dates
formatDate and formatDateTime had their default 'timezone' option set to
false but this was changed to true in order to have the same behavior as
the legacy formatDate and formatDateTime functions.

Part-of: odoo/odoo#96946
2022-08-02 09:19:56 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Louis Wicket (wil) fc2118f5c3 [IMP] mail: remove Record/create
The way the code has evolved, `create` is now no more than an
unnecessary indirection for `insert`.

This PR removes `create` and replaces its uses with `insert` directly.

closes odoo/odoo#97058

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-01 10:55:44 +02:00
tsm-odoo c68c0f3400 [IMP] mail, *: remove create component methods in tests
*: sms, snailmail, hr_holidays.

task-2871066

closes odoo/odoo#97093

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-29 18:34:19 +02:00
Brieuc-brd f7469552a1 [IMP] mail, test_mail: TrackingValue, redesign
This commit redesigns the `TrackingValue` component.
Part of the ChatWindow/Discuss redesign

task-2823627

closes odoo/odoo#92872

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-29 15:53:06 +02:00
Brieuc-brd dc942516d4 [IMP] mail: MessageInReplyToView, redesign
This commit redesigns the `MessageInReplyToView` component.
Part of the ChatWindow/Discuss redesign

task-2823627

Part-of: odoo/odoo#92872
2022-07-29 15:53:06 +02:00
Brieuc-brd 9b995e5b7d [IMP] mail: Message, redesign
This commit redesigns the `Message` component for the ChatWindow,
Discuss and the Chatter. The purpose is to make the chats more
user-friendly.

task-2823627

Part-of: odoo/odoo#92872
2022-07-29 15:53:06 +02:00
Brieuc-brd f169280275 [IMP] mail: increase the ChatWindow size
Following the redesign of ChatWindow, this commit increases its size.

task-2823627

Part-of: odoo/odoo#92872
2022-07-29 15:53:05 +02:00
Zelong Lin 1c1bcced26 [ADD] mail: compact message action list
task-2869932

Part-of: odoo/odoo#92872
2022-07-29 15:53:05 +02:00
Louis Wicket (wil) 072756d9b1 [IMP] mail: remove Record/get
closes odoo/odoo#96984

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 18:01:22 +02:00
tsm-odoo ecd4cba040 [FIX] mail: runbot error accessing messaging on undefined
This PR fixes the 4427 runbot error.

closes odoo/odoo#96966

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 15:03:54 +02:00
tsm-odoo 8a04a0297a [IMP] mail, im_livechat: remove createComposerComponent
task-2871066

closes odoo/odoo#96886

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 13:21:22 +02:00
Rahul Prajapati fda3a48e94 [IMP] mail: move oncomponentupdate from discuss_view to thread
PURPOSE:

The whole process depends on `thread_view` render, not `discuss`. So, it's
unnecessarily making `discuss_view` observe and rerender on a lot of useless
values.

SPECIFICATION:

Remove method from `discuss_view`. Make some onChange methods for handling
the functionality.

Task-2869417

closes odoo/odoo#94147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 11:54:21 +02:00
tsm-odoo 4b1b981a93 [IMP] mail: remove create composer suggestion view
task-2871066

closes odoo/odoo#96899

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 05:04:48 +02:00
Thanh Dodeur 2cbad9a3f7 [REF] mail: separate the tile model based on the parent view
Before this commit, the `callParticipantCard` model was used separately
for both the main session and the multi-tile views
(`CallSidebarView`/`CallMainView`), this commit makes so that each
multi-tile view has its own list of tiles.

part of task-2692836

closes odoo/odoo#96868

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-28 05:04:29 +02:00
Sébastien Theys 13245211a1 [IMP] mail: move mark_all_as_read into message_fetch
This removes an extra request, targets fetched messages more reliably and
simplifies the code.

task-2847909

closes odoo/odoo#96840

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-28 03:51:33 +02:00
std-odoo a0186bd4c4 [IMP] mail: improve the UI of the mail gateway allowed model
Purpose
=======
Show a help message in the "mail gateway allowed" list view that
explains why this model is useful and what the email limit is.

Remove the normalized email from the list view and rename the label of
the email field.

Task-2885455

closes odoo/odoo#96588

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-07-28 01:30:14 +02:00
tsm-odoo 71d5af4ce0 [FIX] bus, *: fix onNotification/offNotification
*: im_livechat, snailmail_account, survey, web_editor.

The callback registered by the bus service method onNotification was
not the same unregistered by offNotification. Since those method were
superfluous, they have been removed in favor of (add/remove)EventListener.

closes odoo/odoo#96684

Related: odoo/enterprise#29819
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-27 16:34:10 +02:00
tsm-odoo 901a43f532 [IMP] bus, *: improve multi tab service
*: calendar, im_livechat, survey.

Following @ged-odoo review, the multi tab service has been improved:
    - multi_tab_service.js has been moved to the correct location.
    - _callLocalStorage method has been removed and replaced by
      getItemFromLocalStorage/setItemToLocalStorage.
    - underscore.js calls have been removed.
    - multi_tab_service is now using function closure style  instead of class.
    - multi_tab service is now using its own bus instance.
    - service name is now in snake case as per convention.
    - tests have been added.
    - multi tab service now handles setting/removing/getting values
      shared between  all the tabs.

closes odoo/odoo#96386

Enterprise: https://github.com/odoo/enterprise/pull/29694
Related: odoo/enterprise#29694
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 03:34:51 +02:00
Sébastien Theys b401ba6e2d [IMP] mail, *: remove legacy code from activity systray
* = calendar, crm, im_livechat, mass_mailing_sms, note, test_discuss_full,
    test_mail

task-2920645

closes odoo/odoo#96114

Related: odoo/enterprise#29794
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 02:18:15 +02:00
Thanh Dodeur 0efcb55c6f [REF] use ChannelMember in CallParticipantCard model
part of task-2692836

closes odoo/odoo#95418

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-27 02:18:09 +02:00
Thanh Dodeur 174ff9ff83 [REF] mail: use the channelMember relation for RtcSession
part of task-2692836

closes odoo/odoo#96394

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-25 20:12:42 +02:00