odoo/odoo#204895

Created by fw-bot
Merged at 1f34abc173f07b6d20c08a27ec57c7025cb20562

Statuses:

label
odoo-dev:master-saas-18.2-mail-email_like_cleanup-thjo-419961-fw
head
e984d9dcf711dad7f1b60a6d14b6d06413d0f85d
merged
6 months ago by SM Engagement, Thomas Josse (thjo)
odoo/odoo
saas-18.2 #199994
saas-18.3
saas-18.4
19.0
master #204895

[FW][FIX] mail, various: improve email-like discussion flow

This commit fixes a list of issues with the recently merged new email-like
changes done to the mail composer. Here is a list of fixes done in this commit.

A newly created partner from the small composer using the mailbox notation would
use the email as name, even though it was indeed provided to the composer. Now
the name is indeed used to create the partner.

In some modules, e.g. sales, the customer of the model is set as follower of
the document when it can access a record as portal. Thus the customer would be
set as a bcc instead of an actual recipients. Now when a customer is set on a
record as a follower we automatically show the bcc. This way the user isn't
surprised if the mail is sent to the customer.

This commit also revamps the Chatter Component recipients. We are adding the
possibility of updating the email of a partner if we detect that one of them
doesn't have one. We thus created a popover that helps the user rewrite a
partner's email. The email accepted by the popover must follow the usual
notation and not the mailbox one. (e.g. rob@gmail.com is ok while Robert
rob@gmail.com will not be accepted).

We also added a popover on click for each partner that extends the
AvatarCardPopover that already existed. The issue with the original Component is
that it used the res.users model instead of the res.partner one. Which in
the case of the recipients was useless since most of them are customers without
any user.

The resend message modal is no longer used when there was an issue sending the
email to the partners. Instead we show the notifications that failed and their
failure reason so that the user know what was the issue.

It is also no longer possible to send a message in the chatter when one of the
partners doesn't have an email address.

task-4610531

Followup of #188642 (see task-4273479: [mail] Email-like recipients)

Forward-Port-Of: #199994