Before this commit, the "OdooBot has a request" notification in the
Messaging Menu -- which suggest to enable push notifications -- had
a muted style, which looks as if the item is unimportant and was
read by the current user.
This is an important notification, at an equivalent level of
importance than needaction notifications. This was already
highlighted by this item contributing to the global Messaging Menu
counter.
This commit fixes the issue by not muting this notification. To do
so, it enhances prop `muted` on `NotificationItem` component:
- 0 (default): the notif is unmuted
- 1: the notif is slightly muted
- 2: the notif is hard-muted
0/1 are equivalent to the different muted style of notification in
16.4, while `muted: 2` shows a hard-muted notification when the user
choose to manually mute a channel, as to not receive any notification
from it.
Some logic related to "mark as read"/"counter" logic has been moved
to this muted prop concern, as not all notification that have mark
as read or a counter necessarily must be muted, e.g. with "OdooBot
has a request".
Task-3566799
closesodoo/odoo#140380
X-original-commit: c60fdbb25b38899ceeb89e76abc35c3474ce1f5b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit:
Channel was not getting unpinned after being deleted
After this commit:
- Channel gets unpinned for all the channel members after being deleted
- If a user leaves channel/group then all of the messages of that channel/group
are removed from the user's history/starred/inbox channel.
Task-2814440
closesodoo/odoo#139972
X-original-commit: 4767d6001d15628768388bcac98c04ab185040c8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this PR, newly created direct message would be added at the bottom of the
list instead of the top.
This PR fix the issues by sorting the direct messages when creating a new direct
message channel.
Task-3566728
closesodoo/odoo#139960
X-original-commit: 60cf880102615a524f2fa89c71be7f1b08d931d1
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Before this commit, the avatar next to composer in Discuss app
had the top aligned with the top of the text input of composer.
The avatar is smaller than the input, and the text in the input
is centered, so the alignment looks off.
This commit fixes the issue by offseting the avatar so that
when the composer has only 1 line, the avatar is vertically centered
with the input.
Note that this alignment should be fixed, i.e. if the input field has
more than 1 line, we want to keep the avatar in the same place, hence
why the avatar is just statically offset.
Also align composer avatar with message list, by removing the
`align-justify: self` that was moving avatar slightly towards the
discuss app sidebar.
closesodoo/odoo#140398
X-original-commit: 5fe4297f3d1a988ae65617c177046a223bc62890
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, messages in livechat from visitor POV show
2 emoji icons in the quick actions. This is confusing and comes
from 2 actions sharing this exact same icon: "Add a reaction"
and "View reactions".
This commit fixes the issue by reducing the number of quick message
actions to 2 for the embed live chat. In other contexts there's
"Reply-to" and "Mark as Favorite" in quick actions, so the
"View reactions" item is always in expand menu.
Note that this "dirty" fix come from 2 actions with same icon.
Eventually we should fix that by clearly making icons unique.
This solution is decent for the time being, giving us more time
to make a dedicate icon for one of the emoji actions.
task-3498446
closesodoo/odoo#140335
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Dark-mode colors have been adapted from MILK redesign in 16.3 [1].
Discuss badge colors were changed in 16.4 to match systray color [2].
Commit [1] adapted them to use primary color instead of intended
sytray color. Removing the override of style fixes the issue, as the
base style in `core.scss` (white theme) works in both themes.
[1]: https://github.com/odoo/odoo/pull/130991
[2]: https://github.com/odoo/odoo/pull/122946closesodoo/odoo#140300
X-original-commit: b46bded27349acd311682846c0a0416ce4898882
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Make partner_id and guest_id properly exclusive.
Allow creating a channel member from its form view.
closesodoo/odoo#140272
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when opening a thread in the Discuss app and
changing to another active thread from the Messaging Meu in the
systray, the new thread was mistakenly renamed to the previous
active thread name.
This happens because the component `AutoresizeInput`, which is used
to show the thread name in the header of Discuss app, also allows to
rename the thread. The code to trigger rename was too naïve, in that
a click away was considered as a rename operation on the current
thread.
This commit fixes the issue by triggering the editing of the value
in the `AutoresizeInput` component only when the click away happens
while the input had focus. The click in messaging menu will not
trigger it as the input is not focused.
Task-3570377
closesodoo/odoo#140208
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
-> This commit add/change the name of the page corresponding to the string
attribute because To be able to detect a field, Knowledge needs to be able to
read its page name.
For more reference: Task-3501211
Task-3524474
closesodoo/odoo#137428
Related: odoo/enterprise#48315
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since [1], highlighting a pinned message from the notification sent
to the channel does not work anymore. This is due to a `super` call
missing. This PR fixes the issue.
Steps to reproduce:
- Go to a channel
- Pin a message
- Click on the "message" link
- Nothing happens
[1]: https://github.com/odoo/odoo/pull/121418closesodoo/odoo#139948
X-original-commit: 68992ba05eb48459800df17707741295a4f47c9c
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
It is sometimes desirable to completely remove a field
from the automated tracking message
when setting a custom message that already covers the change being made.
Add a filtering method on threads to allow models to selectively
hide tracking values from emails and messages.
task-2974500
closesodoo/odoo#109606
Related: odoo/enterprise#31795
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Problem
---------
Previously, when receiving an email with several attachments, we created
1 invoice that contained all the attachments.
Objective
---------
We want to create several invoices depending on the attachments received.
No invoice should have more than one PDF document.
No invoice should have more than one XML document.
Other attachments should be placed in seperate invoices (except for the
first invoice that can contain 2 attachments: ex. image and PDF).
Solution
---------
Update the _extend_with_attachments to behave like such.
task-3526248
closesodoo/odoo#140196
Related: odoo/enterprise#49779
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit introduces some adjustments to the dark mode color scheme
and the use of bootstrap classes in Community.
- Mini calendar contrast -
The colors were not using variables, making them non dynamic
and breaking the contrast in dark mode.
- Avoid !important rules spreadsheet -
Prior to this commit, spreadsheet top bar was using a `bg-white` class,
making it pure black in dark mode.
Since spreadsheet is designed with light colors and we don't provide a
dark mode for it, we remove that class and set a `background-color`
property using CSS in Enterprise.
- Input color -
This commit fixes the focus behavior on the searchbar in the control
panel, the `command_palette_search`, and the `start a conversation` in
discuss.
- Copy clipboard field border color -
Make use of the `text-primary` color for the copy to clipboard field
We use the o-theme-color function to avoid an undefined since primary
doesn't exist in the o-theme-text-color map in white mode.
- Web_editor toolbar variables -
The toolbar was using the `o-brand-primary` variable
which was set to a darker shade. This caused issue when activating an
option due to how vibrant the color is.
- Improve the controls on border-color -
Introducing a custom property on the border-color to allow
further control on individual components (such as the popover).
- Improve setting tabs colors use -
Prior to this commit, the colors of the settings tabs menu were kinda
inverted. The menu was light in dark mode and dark in light mode.
We fix this by changing the values associated to the CSS variables in
use.
- Make model field selector dark mode proof -
Fixing the design of the model field selector popover in both
light and dark mode. Since the popover was using custom style with
arbitrary values, it was not designed for the dark mode and had a lack
of consistency.
To improve the design, we use variables rather than custom style, and
make sure the desired render is as close as before.
- Sign colors use -
This commit aims to improve the sign module in both light and dark mode.
There were some readability issue with some `btn-light` having poor
contrasts in both light and dark mode, and the use of some classes was a
bit unexpected (e.g `card-header` to set a grey background with some
padding).
- Improve buttons design inside listview -
Prior to this commit, this button was using custom CSS to make it look
like a primary button, while it was using classes related to secondary
buttons.
We remove the custom CSS used to style it correctly and keep our button
design consistent.
- Messaging menu layout in mail -
This commit aims to improve the design of the notifications displayed
in the messaging menu. Prior to this commit, the notifications dropdown
was using custom CSS variables overriding the regular behavior
of our dropdowns.
In fact, the layout was generating some friction:
1) Marking a notification as read would turn its background into a
darker color
2) Effects like `:hover` were all based on the custom CSS variables
resulting in an inconsistent layout.
- Multi company selector adaptations -
In darkmode the multi company selection was using the btn-light which
creates a weird effect and overrides the dropdown default hover behavior
This commit uses the btn-link to display an hover effect on the
company switch and on the checkbox while blending with the background
and the default dropdown hover effect.
- Adapts default badge design -
Improve the design of the default badges in dark mode.
If you open the light mode, these badges are dark grey with a white
text. If you switch to dark mode, they are dark grey but with a dark
text, which makes them look either muted or off.
We make use of SCSS variables to handle the color of the component,
providing a good styling in both modes.
- Fix kanban cards borders inside dropdown -
Fixes the issue with the divider inside the kanban dropdown menu not
showing in dark mode.
To ensure it is visible, we assign it the `$dropdown-divider-bg`, which
is the color it should use, as the horizontal divider above uses.
- Fix tour pointer design for dark mode -
This commit aims to insert the tour pointer and its content inside the
styling we applied to our tooltip.
To do so, we make sure it uses CSS variables, allowing more control and
consistency, plus we replicate the overall look of our tooltips.
- Fix `text-primary` on action background contrast -
This commit improves the readability of our `text-primary` classes when
it's used on a `$o-component-active-bg` background.
Prior to this commit, the `text-primary` was not meeting the contrast
standard, mainly when you were using the `CMD+K` shortcut on the
app switcher.
To prevent that, we changed the background to a `$o-component-active-bg`
background with an opacity ensuring our text provides a good contrast.
- Fix input states -
Prior to this commit, the `--o-input-border-color` CSS variable was
using the `$o-form-lightsecondary` variable to define the standard color
of the `border-bottom` property of our inputs.
This was conflicting since `$o-form-light-secondary` is also used to
define the `background-color` of our table on focus.
With this commit, we separate these two element with different variables
to make sure they don't affect each others.
- Fix kanban ghost background -
Before this commit, if you created a project without any stage or element
in it, the ghost cards that act like placeholders would be pure `#000` in
dark mode, due to the `bg-white` class.
This commit replaces that class with a `bg-light`, providing a better
visual result in both light and dark mode.
- Fix new message design -
Improve the design of the new message element while
inside Discuss, using our danger color, ensuring a good visual result in
both modes.
task-3201038
closesodoo/odoo#139966
Related: odoo/enterprise#49666
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: chgo-odoo <chgo@odoo.com>
Co-authored-by: stefanorigano <sri@odoo.com>
Before this commit, messages of type email had their style initially
altered on the UI to match the theme, notably the background and font
color. To see the original format, a floating button
"Show Original Format" was shown in the top-right corner of these
messages.
The main problem with this button is that most email messages do not
have a different visual between altered and non-altered, so this
button felt useless most of the time. Also, the original style of
email message is a annoyance in dark theme but not in white theme.
This commit removes the presence on the button and the style of
email message is now based on the chosen theme:
- white theme: always show the original style of the email
- dark theme: always show a slightly altered style of the email
This commit also fixes a bug where message of type `email_outgoing`
were not properly considered as email messages. To fix this issue,
`message.type === "email"` has been replaced with
`message.type.includes("email")` to also take these messages into
account.
Task-3573855
closesodoo/odoo#140176
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, since https://github.com/odoo/odoo/pull/137750,
the `RtcSession.channelId` property was removed, which prevented
the "LIVE" state in calls to be displayed (and hidden) in the right
conditions, a missing button in call invitations, and possibly other
bugs.
This was not caught by tests because there is no test for that.
closesodoo/odoo#140082
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The messaging service starts synchronously and exposes a promise
isReady that is resolved when the call to init_messaging is done.
This is good as this call thus doesn't slow down the services
startup and thus the webclient mount.
Unfortunately, the ChatWindowContainer, which is a main component,
i.e. a child of the WebClient, waits for that promise in its
onWillStart. As a consequence, the webclient can't be mounted
until the rpc returns, which can take a while (in odoo.com, this
rpc lasts ~500ms).
The chat windows being "peripherical components", there's no reason
to block the whole application for them. Instead, the webclient
can be mounted, and when they are ready, the chat windows can be
rendered. This is what this commit does.
Back-port of https://github.com/odoo/odoo/pull/139750/closesodoo/odoo#140056
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit adapts message tests to check pointer style on message author name
and author image.
closesodoo/odoo#139951
X-original-commit: 134b7cc1143faf9275683ae12c2b121ab03aed7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when the command dropdown was open by clicking
on avatar/chat window header name, the clickable area was the same
as the rest of chat window header.
As a result, the dropdown was shown without some UI to help see the
toggler that is responsible from this dropdown.
This commit highlights the toggler of dropdown when it is open, so
that it looks nicer when the dropdown is open as we clearly see the
toggler of this dropdown.
closesodoo/odoo#139920
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when a message is a reply to another message,
the whole row of the message reply-to was clickable to highlight the
reply-to message.
This is ok when the click happens on the actual reply-to message
above the message, but when the content of the reply-to message
is short, the click area extends to more than the "clickable" cursor
show, so that click on thread view hightlights the reply-to message
when it shouldn't.
The `cursor-pointer` style was already correctly shown only the the
actual part of the reply-to message. But the `t-on-click` was more
generous and considered the whole row in the thread view.
This commit fixes the issue by matching the `t-on-click` with the
intentional clickable area, matching the `cursor-pointer` that was
correct.
closesodoo/odoo#139906
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this revision, an employee could create a discuss channel
with whatever setup he wants.
Which is fine. The critical part is for an employee to not be able
to join an existing restricted channel.
But creating a channel is not a problem.
However, he would be able to create a channel for which
he doesn't have access, meaning he creates the channel
and then no longer see it, which is not user-friendly.
closesodoo/odoo#139903
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when a message is of type email, the button to
toggle between adjusted content style with webclient theme and the
original email style was labelled "Show Original Email" and
"Don't show original Email".
This label is confusing, as it gives the impression that this button
opens a new screen or removes a UI element. This button only alters
the visual of the message, that is the style, so the label should
be better worded to tell that.
This commit rename the label to "Show Original/Custom Format", so that
it's clearer what this button actually does.
closesodoo/odoo#139901
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Currently both incoming and outgoing emails are using the same 'email'
message_type. However both flows are not linked in any way.
Purpose of 'message_type' is to distinguish who generated the message.
In this case incoming emails are generated by the mailgateway while outgoing
emails are generated by mailins e.g. using the composer in mailing mode.
We now distinguish outgoing emails from incoming emails by using a specific
type for outgoing emails. Addons are updated accordingly.
Default 'message_type' value when removing sms/snailmail/whatsapp is now
'comment' instead of 'email', as default value of messages should be
comment as discuss is the main source of messages.
Task-3285720
closesodoo/odoo#139814
Related: odoo/enterprise#49597
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since [1], guest is added to the channel immediately instead of
waiting for the guest name to be set. Since the guest is not in
the context when posting je "join" message, the author of the
message is the public user instead of the guest. This results in
an incorrect message ("public user joined the channel") since the
frontend relies on the author to set the name. This commit fixes
the issue by adding the guest to the context.
Steps to reproduce:
- Go to a channel
- Copy the invitation link
- Join the channel with this link
- The message is incorrect
[1]: https://github.com/odoo/odoo/pull/138330closesodoo/odoo#139892
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
When upgrading mail across the addition of the linked record's company
and mail alias, if the `composer.model` is not part of a module that's
already loaded (which is very likely) the compute will blow up when it
tries to look up the model in the env.
Add that check to the condition.
closesodoo/odoo#139845
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Unwittingly broken by the removal of `__implements__` in
a6d601dc4e, these lints don't run
correctly with the old pylint, allowing new errors to creep in since.
closesodoo/odoo#139605
X-original-commit: 99cec73f585c8759142a707b06934d9c23aa5478
Related: odoo/enterprise#49473
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
So that `Message.insert()` in JS becomes trivial, as it doesn't have
to infer the author of message to current user.
closesodoo/odoo#139501
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This utils file was added because removing item in JS based on
item content sucks, so some higher-order functions were introduced
to ease it slightly.
As many of its uses has been replaced with `RecordList.delete()`
where data is uniquely linked to a model, in the end the functions
were only used once. These functions have been moved to the only file
that still use them, so that we don't encourage using them.
Part-of: odoo/odoo#139501
Before this commit, when having an array of data to insert
in a model, we had to iterate and insert data item on by one:
```js
messageDataList.forEach(data => this.store.Message.insert(data));
```
With this commit, we can simply insert the array of data to
insert:
```js
this.store.Message.insert(messageDataList);
```
This helps simplifying the business code further, less LOCs is
usually better!
Part-of: odoo/odoo#139501
This commit allows to define html fields in discuss models,
so that when insert is trusted they are automatically markup.
By default, all model insert are untrusted. To make a trusted
insertion, we should pass 2nd parameter `{ html: true }` to
an `insert()` method. The param is intentionally named `html`
instead of `trusted`, so that it triggers ci/security for
reviewers awareness.
It's still possible to immediately assign a markup on the html
fields, like before.
This changes simplifies the code, so that we don't have to dissect
model data everytime and make sure all bits are properly markup.
The dissect operation added many LOCs and we frequently missed to
markup the data in some flows. Being able to flag html fields at
model definition and flagging an insert safe keeps the security
concern while helping properly markup-ing all the data.
Part-of: odoo/odoo#139501
Commit b05e7e4da0 rightfully removed the _compute_name dependency on
context keys (a bad idea for stored computed fields), but this change
could lead to UX frustrations (Server Action names getting reset all the
time despite what the user may have used as a name before) and UX issues
(e.g. triggering a recompute by accident at module removal that could
reset all 'code' action names to 'Execute Code').
This commit simply removes the automated naming feature from the base
module and moves the logic to the base_automation module - and only
computes automated names based on the link with an automation rule or
not (so 'standalone' server actions need a name given by the user at all
times).
Task-3450200
Part-of: odoo/odoo#138804
- Slight reword of the 'type/state' field labels for server actions
- Re-ordering of 'type/state' values
- Form view changes
- Allow hiding model in display_name of ir.model.fields base on context
key (avoid technical details when they are not needed)
Task-3450200
Part-of: odoo/odoo#138804
The `flanker` python library can be installed to implement optional
email address validation.
Nevertheless, it is not fully supported in python 3 (see https://github.com/mailgun/flanker).
Recent issues point to the fact that the latest pip release version 0.9.11
does not work under python 3.10.
This can lead to features, using the email validation, creating blocking
behavior due to error tracebacks.
As this is more of an issue on flanker's side than Odoo's, we remove the
`pip install` instruction. It can be assumed that someone wanting to go
out of their way to install flanker, should be proficient enough to either
make sure the python <3.10 is running or install one of the Github repo tagged
versions.
After this change, we still inform the user of the optional feature, but do not directly
incite them to pip install it, which should prevent normal users from
inadvertently blocking parts of their Odoo database.
opw-3562596
closesodoo/odoo#139800
X-original-commit: 637e60cb9687e9859d081f7367717c84d29fb82a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit it is impossible to find the qweb error when you preview an email template.
closesodoo/odoo#139668
X-original-commit: 1f373de5f218a1f43015f4f80e60d1da0188d6b5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit changes the wording of actions and notifications in the modules
listed below:
1) Discuss (Leave Conversation)
2) Web (Delete Filter, Get View - Close, Tours - Close, and property field
access warning)
3) Calendar (Stop Synchronization, Configure, and Discard)
4) CRM (Assign Leads)
Task-3390780
closesodoo/odoo#130353
Related: odoo/enterprise#44919
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit introduces a new optional feature in the chatter.
Users can request translation from the Google Cloud Translation API.
Documentation: <https://cloud.google.com/translate/docs#docs>
Adding the key in settings will instantly enable the feature for all
users of the database and consumption is not measured nor limited
by Odoo as it is natively supported using the Google Cloud Console.
Translation values are stored in the database to reduce cost as
much as possible. Therefore, translation values are automatically
garbage collected every 2 weeks to prevent database pollution.
Task-3338165
closesodoo/odoo#126555
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
New fa-bell icon to manage notifications according to that channel only
Options:
Mute (+choose time period):
No longer see the unread status: the bold text disappears and the channel name fades out.
As if you are not a channel member anymore.
Receive messages but without sound + only need action counter (grayed).
Add a crossed-out bell icon next to the channel or user name to indicate that the channel is muted
All messages: all messages sound + need action counter
@Mentions: only mention sounds + need action counter
Nothing (Discord-like): No sound + need action counter
By default: all messages
task-3328665
closesodoo/odoo#136405
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Currently, if all reactions are deleted from reactions menu, the menu remains open. This commit force it close in case of having no reactions.
closesodoo/odoo#139632
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
PURPOSE
Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.
SPECIFICATIONS
Now that alias domains are used in Odoo codebase there is no usage anymore
for the old config parameters. So long and thanks for all the fish !
Task-36879 (Mail: Support Multi Domains Aliases)
Part-of: odoo/odoo#76734
PURPOSE
Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.
SPECIFICATIONS
Update settings to configure your company's current alias domain instead
of the global 'alias.catchall.domain' configuration parameter. As domain
configuration is globally done per company, this is now a related on the
company. Advanced configuration and management can still be done manually
in settings.
Field 'external_email_server_default' triggering display of mail configuration
is moved to mail. It is defined in 'base_setup' but used only in mail hence
moving the field to be coherent.
Task-36879 (Mail: Support Multi Domains Aliases)
Part-of: odoo/odoo#76734
PURPOSE
Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.
SPECIFICATIONS: MAIL.MAIL
Update MailMail to use alias domains. Notably "Return-Path" headers are
now computed based on alias domain when possible, using the recently added
fields on 'mail.message' model for that purpose. Fallback is to use current
company's bounce email when mail_mail creation is done outside of classic
mail flows or without that information.
SPECIFICATIONS: IR.MAIL.SERVER
Update IrMailServer and low-level stack to use alias domains. This has an
impact notably on default values computation for from and bounce emails
* '_get_default_bounce_address' is called when there is no 'Return-Path'
given. Most classic mail flows will set it according to current record
company / alias domain. Fallback when not set is to fallback on current
company's bounce email, computed based on its alias domain;
* '_get_default_from_address' is used in two use cases
* computing a default 'email_from' for outgoing emails when it is not set.
In most classic mail flows it is set based on current user's email. If
not set fallback on current company's notification emails is considered
as a safe bet, replacing the global configuration parameter;
* overriding the 'email_from' of emails that are considered spoofing the
mail server, allowing to wrap the sending into a 'notifications@domain'
generic sender. For those we should try to keep record's information as
it may be called in classic mail flows;
* '_get_default_from_filter' is added in base and overridden in mail to
either use 'mail.default.from_filter' ICP, or use the one defined on
the alias domain. Supporting both is still an option, as its behavior
is implemented for basic email sending, without mail being available.
Those methods are updated to try to support multi domains / multi company
setup. However as those defaults are located ar ir.mail_server level it is
not always easy to have complete environment information, hence fallbacking
on current company's parameters when no better information is provided.
A test about 'mail.default.from' is removed, as it was testing a default_from
outside of catchall domain. It is not possible anymore as default_from is now
part of domain definition. As multi domains is supported, no need to support
exotic configuration like that.
SPECIFICATIONS: FROM MAIL.MAIL TO OUTGOING EMAILS
When sending emails based on MailMail, we now prepares sending groups based
on MailServer, email_from, but also alias domain to which the mail belongs to.
Information about alias domain (e.g. notifications email based on default_from
and bounce email) is propagated to low-level email preparation methods. It
uses the context as it is the easiest way to propagate information to that
level without hacking too much models or calls.
Task-36879 (Mail: Support Multi Domains Aliases)
Part-of: odoo/odoo#76734