Commit Graph
9043 Commits
Author SHA1 Message Date
Sébastien Theys b532db523d [IMP] mail: uniformize components localId prop
task-2732017

closes odoo/odoo#82699

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-13 13:40:42 +00:00
Jérôme Vanhaudenard 59bdc60ef1 [FIX] mail: typo in action_save_as_template
Traceback on the ticket:
https://pastebin.com/mCAFJVWG

A browse should take an id or a list of ids as parameter.
```python
record = env['mail.compose.message'].browse(1)
attachments = env['ir.attachment'].sudo().browse(record.attachment_ids)
print(attachments)
attachments = env['ir.attachment'].sudo().browse(record.attachment_ids.ids)
print(attachments)
```

OPW-2728748

closes odoo/odoo#82664

X-original-commit: 74cfe2bc95827b52232995cd075757f54041d289
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-13 07:44:42 +00:00
Didier (did) cfd5adbb2e [IMP] mail: create model view for activity popover
task-2579306

closes odoo/odoo#81859

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-12 17:33:52 +00:00
FrancoisGe 1e1b45ea62 [IMP] web: Command Palette footer
This commit will change the setting of the emptyMessage and the
footer of the main command palette.
In order to make the command palette footer more customizable, we will
replace it with a Component. For example, using a footerComponent in the
main command palette allows us to adapt its text based on the namespaces
used.

Setting up an empty message:
Before:
```
registry.category("command_empty_list")
        .add("@", _lt("No user found"));
```
After:
```
registry.category("command_setup")
        .add("@", {
            emptyMessage: _lt("No user found"),
            });
```

With this commit, it is possible to add a namespace to the footer tips:
```
registry.category("command_setup")
        .add("@", {
                name: _lt("channels"),
            });
```

closes odoo/odoo#82541

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-12 11:19:00 +00:00
Didier (did) d4073f6274 [IMP] mail: move activity getters inside activity view
task-2698446

closes odoo/odoo#81805

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-11 17:08:50 +00:00
Krina Oza ff2ffb9e0d [IMP] web,sale_(project): improve keyboard navigation
The purpose of this commit is, to add keyboard shortcut
to multiple actions.

So in this commit, added keyboard shortcut to several actions
in project, sale_project, web_calendar and added smart action
in command palette on statusbar.

task-2655790

closes odoo/odoo#79805

Related: odoo/enterprise#22267
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-11 12:14:43 +00:00
Louis Wicket (wil) c04b313967 [IMP] mail: melt causal relations into identifying fields
With the idea of maybe merging the concepts of causal relations and
identifying fields, change the identifying fields so that their inverses
are the only fields with `isCausal: true`.

closes odoo/odoo#82521

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-11 10:22:43 +00:00
Sébastien Theys 6ae67acd0e [FIX] mail: clean message view component to ease the enterprise part
- Move extra class to field to avoid reliance on specific template.
- Rename prop to be generic.
- Remove extra margin-top in message view outside of thread view (bonus fix).
- Move code using message view component out of message list update to break
  infinite loop.

task-2728107

closes odoo/odoo#82415

X-original-commit: c002adeedeffa23190c7853a9d9643da7825ea33
Related: odoo/enterprise#23331
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-10 21:57:07 +00:00
Alexandre Kühn 21b366633a [FIX] mail: consistent padding of attachment image/card in chatter
Before this commit, attachments in attachment box (chatter) had no
left padding.

Mistakenly introduced by https://github.com/odoo/odoo/pull/80060
which changes classname passing from parent component to child
component with `t-attf-class`. AttachmentCard and AttachmentImage
components did not `t-attf-class` not on root node, which caused
the broken style that this commit fixes.

closes odoo/odoo#82515

X-original-commit: 429bcbcaad5164e9ecf6f518d4e5b0d1ada0bc4a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-10 20:59:55 +00:00
Alexandre Kühn e0e80c7f6a [IMP] mail: remove t-ref="component" on dialog
Task-2092965
Task-2694206

closes odoo/odoo#82030

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-10 19:28:25 +00:00
Alexandre Kühn 9a0006bdd3 [IMP] mail,*: remove manual need to bind record methods in created
*: website_slides

Task-2731656

closes odoo/odoo#82444

Related: odoo/enterprise#23343
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-10 16:32:53 +00:00
Louis Wicket (wil) 450475e143 [FIX] mail: remove auto isCausal on inverses of required fields
Previously, relational required fields had their auto-generated inverses
defined with `isCausal: true`, which seemed logical: if a record is
deleted, all the records that depend on it must be deleted too.

In practice, it turned out to be a bad idea since there are some cases
where you don't want the dependent records to be deleted. For example,
there is no point in deleting the current record when a required field
is replaced by another one.

Furthermore, this actually led to the introduction of new bugs, as the
one described in task-2730667.

Fixes bug described in task-2730667.
Reverts some of these changes: https://github.com/odoo/odoo/pull/81679

closes odoo/odoo#82437

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-10 13:52:49 +00:00
Didier (did) 267af3a8b8 [IMP] mail: make the activity popover test more reliable
This PR make the activity popover test use the mock model and a chatter as
component.

closes odoo/odoo#82143

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-10 13:52:38 +00:00
Olivier Dony e58471b148 [FIX] mail, mass_mailing: fix attachment ownership
Attachments that are uploaded on a record that isn't saved yet are
created with res_id set to 0. In the case of attachments linked through
a m2m rather than the usual (res_model, res_id), it means they may not
be readable afer the creation of the record, except by their creator.

Re-attaching them to the mailing / template at the end of the create()
call fixes the ownership.

Fixes #81935

closes odoo/odoo#82120

X-original-commit: 05fb705f2729ffdf07ab36accda20415a44e1aa6
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-01-10 10:22:22 +00:00
Julien Giannone 2e5606b135 [FIX] mail: fix to add reaction on a message
closes odoo/odoo#82388

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-07 19:06:46 +00:00
Didier (did) 5a958cb3ff [IMP] mail: move fileUploader methods in the model view
task-2579306

closes odoo/odoo#81848

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-07 17:35:03 +00:00
roen-odoo fef39f82ac [FIX] mail : Remove double signature on invoice email
Current behavior :
When sending an invoice by email there was 2 signature in the mail

Steps to reproduce :
Create an invoice
Send it by email
Check the mail, there are 2 signatures

opw-2703272

closes odoo/odoo#82347

X-original-commit: 00965df4be591b952b339038c324d7e92596e3d5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-06 19:30:53 +00:00
Thanh Dodeur 1ab3d53588 [IMP] mail: make the mute and deafen button behavior more intuitive
* When a user is already muted when setting their state as deafened
the mute state should remain after the deafen state is removed.
* When a user clicks the microphone (mute/unmute) button while being in
the deaf state, the user should end up undeafen and unmute.

task-2720026

closes odoo/odoo#82197

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-06 11:45:20 +00:00
Alvaro Fuentes 17bb0af7a8 [FIX] mail: check res_id!=0 when checking access rules
Although 0 is a valid value (integer), this has been (ab)used to signal
that a mail activity is not linked to any other record via res_id.

The issue is that when we have `0` as res_id value we get an error here
https://github.com/odoo/odoo/blob/158c0ae425b3be446d81c3a6f4387b2d9426d10e/addons/mail/models/mail_activity.py#L377
more specifically on
https://github.com/odoo/odoo/blob/158c0ae425b3be446d81c3a6f4387b2d9426d10e/odoo/models.py#L3603
with `AttributeError: 'int' object has no attribute 'origin'`

To avoid the issue, here we discard id `0` when checking the linked
records access rules.

On #81292 (targeting master, >15.1 at the moment of writing) a
constraint will be added to avoid `0` on `res_id`.

closes odoo/odoo#82281

X-original-commit: f96cec284a0714ae8eaa264d7adee503a96618d7
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-01-05 16:21:59 +00:00
Thanh Dodeur 55ab14e933 [FIX] mail: ensures that the audio track has the right enabled state
This commit fixes a case where the track could be left enabled when
transitioning from voice activation to push-to-talk (the track would
still properly be disabled on the next release of the push-to-talk key).

part of task-2720026

closes odoo/odoo#82273

X-original-commit: 96804f4eba76ce3c016ae34a9829f88ab8c7e0f3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-05 15:30:45 +00:00
Didier (did) 1ec153ecbf [IMP] mail: improve the notifications on mail_channel/add_member
Before this PR, the mail_channel/add_member function use multiple _sendone. We
can compile the notifications inside a single sendmany.

Task-2726415

closes odoo/odoo#82198

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-05 14:36:03 +00:00
Sébastien Theys 671e5b885e [IMP] mail, *: add view model for notification list items
* = im_livechat, sms, snailmail

Part of task-2728107

closes odoo/odoo#82239

X-original-commit: fadb57564209e1b9c4ee6ee993b117b288ac614d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-05 12:50:16 +00:00
Thanh Dodeur 28b946989d [REF] mail: rename isMuted into isSelfMuted
This commit renames the isMuted variable into isSelfMuted to reflect the
user action of self muting, as opposed to the state of being mute,
which will be distinct in an upcoming commit.

part of task-2720026

closes odoo/odoo#82199

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-04 12:57:39 +00:00
Didier (did) 2292979b98 [FIX] mail: notify guest when joining the channel
Before this PR, the guest that just connect wouldn't receive the longpolling
message before the current one expire.

task-2664831

closes odoo/odoo#82170

X-original-commit: 0006123dba46d32d062a581e9a16f433f3ce05f3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-04 10:26:21 +00:00
Didier (did) 09b3e8cfa1 [FIX] mail: temporary id should be negative
Before this commit temporary id could match an existing attachment id and
replace that attachment by the new uploaded one.
Even if this is very unlikly, using a negative id avoid it completly.

closes odoo/odoo#82185

X-original-commit: c18705d1ced6a9b1d6bb8c33049a1248ae83cf18
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-03 20:21:51 +00:00
Sébastien Theys f221d4f663 [FIX] mail: prevent crash with file uploader when editing message
task-2726182

closes odoo/odoo#82142

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-03 13:22:46 +00:00
Didier (did) c718fce536 [FIX] mail: use a placeholder when replying to empty message
Before the PR, when replying to an empty (only attachment) nothing was display
in the message reply preview. This PR introduce a placeholder to handle this
case.

Also taking to opportunity to add missing translations.

task-2664815

closes odoo/odoo#81996

X-original-commit: 60f68512fdc9ebfb2d9331790be5884a86cce67b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-03 13:22:42 +00:00
bit-odoo c74e501e3a [IMP] mail: add test for temporary or transient messages not have reply icon
Task-2702690

closes odoo/odoo#82079

X-original-commit: 87c0f4a2ab43f9bd385fb66b21629e64415c5461
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-30 15:15:33 +00:00
Florian Damhaut 83d7e36864 [FIX] mail: no more than 2 user in a chat
Step to reproduce:
- Settings -> Mail channel -> any chat-type channel
- Go to Members
- Add an user
- Refresh the page

Current Behaviour:
- Traceback
- Chat are designed for 2 users and you should not be able to add more

Behaviour after PR:
- Can only edit members of channel if it's not a chat
- User error if try to add more user
- Fix traceback if there is too much users

opw-2717341

closes odoo/odoo#82044

X-original-commit: 85f7b7c1304222966610833dc325bc47f1c13158
Related: odoo/enterprise#23156
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-29 18:44:41 +00:00
Alexandre Kühn edb25d056e [IMP] mail: use popover view for emojis
Task-2694206

closes odoo/odoo#81877

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-29 17:55:16 +00:00
Sébastien Theys 07048871af [FIX] mail, im_livechat, *: restore usage of livechat user name
* = website_livechat

Prevents from leaking unnecessary information to livechat clients.

opw-2453956

closes odoo/odoo#82026

X-original-commit: 5ec191d288d5b44f78cd1f6980c47bb64cfd9bd1
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-29 16:55:47 +00:00
Alexandre Kühn 7d3775a525 [IMP] mail: rename emojis popover to emoji list
Task-2694206

closes odoo/odoo#81905

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-27 12:49:47 +00:00
Alexandre Kühn bead58114d [IMP] mail: rename folder and files of emojis popover to emoji list
Task-2694206

Part-of: odoo/odoo#81905
2021-12-27 12:49:47 +00:00
Louis Wicket (wil) 51bfb9eb03 [IMP] mail: properly detect nonexisting fields
Invalid data provided at record creation were silently skipped by the
framework without triggering an error. This commit ensures that data are
no longer accidentally filtered and therefore that an error will be
raised if a key that does not match an actual field is provided.

This commit also removes the dead code that was detected thanks to these
changes.

closes odoo/odoo#81909

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-27 12:02:28 +00:00
Alexandre Kühn 8d2567d162 [IMP] mail: remove propsCompareDepth from useShouldUpdateBasedOnProps
Task-2695743

closes odoo/odoo#80269

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-27 11:14:44 +00:00
Thibault Delavallée 14bbac3f35 [FIX] base: temporary files were not correctly attached 2021-12-23 12:50:14 +01:00
std-odoo efc407fe03 [FIX] mail_group: add missing SMTP headers
Bug
===
Since 2d359b909b we moved the mailing
list feature of the <mail.channel> in a different model, <mail.group>.

During this split, some SMTP headers have been forgotten.

Task-2721009

closes odoo/odoo#81887

X-original-commit: daf9c0300fb042891c019e4f2a8c5395de388e1c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-24 09:52:42 +00:00
Alexandre Kühn cc28195b7d [IMP] im_livechat,mail: remove MobileMessagingNavbar/tabs deep props
In preparation for using OWL v2 in discuss code.
(shouldUpdateBasedOnProps will be removed)

Solution consists of introducing MobileMessagingNavbarView model.

Task-2695743

closes odoo/odoo#80617

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-23 19:15:38 +00:00
Alexandre Kühn c71d9ba51e [IMP] mail: remove useless 't-ref="startAMeetingButton"'
Task-2694206

closes odoo/odoo#81801

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-23 18:26:20 +00:00
Alexandre Kühn cd05d194b2 [IMP] mail: remove useless 't-ref="composer"'
Task-2694206

Part-of: odoo/odoo#81801
2021-12-23 18:26:19 +00:00
Alexandre Kühn 0e51782d59 [IMP] mail: remove useless 't-ref="header"'
Task-2694206

Part-of: odoo/odoo#81801
2021-12-23 18:26:19 +00:00
Alexandre Kühn 79d6f1db60 [IMP] mail: remove useless 't-ref="dropzone"'
Task-2694206

Part-of: odoo/odoo#81801
2021-12-23 18:26:19 +00:00
Louis Wicket (wil) 971fecb40b [IMP] mail: test isMulti only once
Move isMulti sooner in the flow so that the check is only done once.

closes odoo/odoo#81863

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-23 15:53:48 +00:00
Didier (did) 01ff1cd226 [FIX] mail: user cannot edit a message that is not a comment type
Before this PR, user could edit notifications message.

task-2713602

closes odoo/odoo#81803

X-original-commit: 45e9f367d583ec8fafdf19c9e5451bdff0e16e62
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-22 12:11:41 +00:00
Alexandre Kühn c1c082543c [FIX] mail: redefine UserSetting/volumeSettings
Follow-up of
https://github.com/odoo/odoo/pull/81679

This field was actually being used, so shouldn't have been deleted.

closes odoo/odoo#81737

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-21 15:03:32 +00:00
Sébastien Theys 0565171213 [IMP] mail: add file uploader view model
closes odoo/odoo#81697

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-21 13:46:59 +00:00
Rémy Voet (ryv) 034d369c10 [FIX] mail: batch _insert_followers in create of mail.thread
The `_insert_followers` wasn't batch in the `create` of `mail.thread`
for no reason, which call the create of a `mail.follower` one by one.
It is inefficient for the batch records creation (import or some
flows) of a model with `_inherit = [mail.thread, ...]`.

Then batch it, to miminize the cost of `_insert_followers`:
The creation of 100 `mail.follower` takes:
- 0.107 sec if you create one by one (before)
- 0.022 sec if you create in batch (now)

Also add two tests (on model with a chatter):
- One testing the behavior of follower and subtype in case of
multi-create
- One testing the number of queries done to create 5 records.
The old SQL request count was 23, now it is 19 (-1 by create
call).

task-2711448

closes odoo/odoo#80954

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-21 08:06:57 +00:00
Louis Wicket (wil) 99b2c61d92 [IMP] mail: make inverses optional when unused
IdentifyingFields and fields marked `required` must have their inverse
with `isCausal: true`. This led to having to systematically declare
inverses on the related models in order to explicitly add `isCausal:
true` to them, even when these inverses are not used for anything else.

This commit automatically adds `isCausal: true` to the inverses
generated by the framework when they are related to required fields or
identifyingFields. Thus, it is no longer necessary to declare inverses
if they are not used for anything else.

This commit also removes all the inverses that are no longer needed
thanks to this change.

closes odoo/odoo#81679

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-20 17:59:01 +00:00
Didier (did)andSébastien Theys 84adbcaffa [IMP] mail: move the activity handler inside a model view
part of task-2579306

closes odoo/odoo#79538

Related: odoo/enterprise#22506
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2021-12-20 16:52:47 +00:00
Didier (did) 7d7a1e4029 [IMP] mail, website_slides: use mock server for activity test
closes odoo/odoo#81502

Related: odoo/enterprise#22941
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-17 12:51:39 +00:00