Commit Graph
1803 Commits
Author SHA1 Message Date
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
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 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
Laurent Stukkens (LTU)andYannick Tivisse ac7cd0e874 [IMP] project: improve burndown chart performance
Purpose of this commit
======================

The Burndown Chart report was very slow on big databases as it was not
possible for Postgresql to optimize the query as it was based on a view
that was using several generate series.

This commit aims to improve the performance by injecting the constraints
at a lower level than it was in the past, lowering the amount of data
processed in the higher level of the query.

/!\ Important note
------------------

Overwriting the `read_group_raw` is really not a good practice and should
be avoided in most case. If you fall on this implementation by grepping
the source code, please be advised that this is not the right way of doing
things.

Implementation details
----------------------

- The report is now run by generating the `SQL` that is executed by the
  `read_group_raw`. This allows inserting `SQL` constraints at a lower
  level and simnifically improves performance. As there is no other way
  to do it, the code is unfortunately a modified copy of the actual
  `read_group_raw`.
- The pivot view has been removed as it had no meaning and was creating
  confusing data.
- The `Group By` menu has been limited to `stage_id` and `date` as bringing
  more data trough the different `GROUP BY` statements up to the higher level
  is costly. Further more, additional `Group By` did not bring added value
  as the Chart was less readable.
- The JS code has been adapted in order to force a group by both `stage_id`
  and `date` so that the date displayed is always making sense.
- The sort ascending and descending options have been removed as creating
  confusing data.
- The compare with previous period has also been removed as the chart only
  really make sense when seen chronologically.
- A lot of tests have been added in order to ensure that changes that would
  be harmful for the report will trigger test fails.

task-2845729

Co-authored-by: Yannick Tivisse <yti@odoo.com>
2022-07-20 15:57:32 +02:00
MAHAMADASIF ANSARI 3bf88fcf79 [IMP] {fetch}mail, google_gmail, microsoft_outlook: merge fetchmail into mail
The `fetchmail` module is build on top of the `mail` module and enables
the incoming email capabilities. However, using the `mail` without
incoming email server is not a good use case.

This commit merges the `fetchmail` moudule into `mail` and lessens the module
complexity, along with adapting the xml/external ids in the dependent modules.

task-2797458

closes odoo/odoo#94143

Related: odoo/upgrade#3615
Related: odoo/enterprise#28659
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-20 10:58:56 +02:00
Louis Wicket (wil) fdcaa53ca0 [IMP] mail, *: rename mail.channel.partner to mail.channel.member
* = calendar, crm_livechat, hr_holidays, im_livechat, privacy_lookup,
privacy_lookup, test_discuss_full, test_mail_full, website_livechat

closes odoo/odoo#95912

Related: odoo/upgrade#3681
Related: odoo/enterprise#29433
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-19 11:50:37 +02:00
Thanh Dodeur fcc6a008da [REF] mail, *: make rtc invitations use the new ChannelMember model
* test_discuss_full

channel invitation to rtc calls are now using the `ChannelMember` and
`mail.channel.partner` models instead of the `partner` and `guest`
models.

part of task-2692836

closes odoo/odoo#95898

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-15 14:21:50 +02:00
Sébastien Theys 458cb9b55a [IMP] mail: display guest in channel member list
Part of task-2664860

closes odoo/odoo#95859

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-07-12 18:31:42 +02:00
std-odoo e9f712278d [IMP] microsoft_outlook, fetchmail_outlook *: improve usability
* fetchmail, google_gmail, fetchmail_gmail

Purpose
=======
Improve the usability of the outlook modules.

Specifications
==============
Remove the checkbox "Use Outlook" and instead use the
smtp_authentication and the server_type, to be consistent with Gmail.

Hide the password field for Outlook / Gmail mail servers.

Add constraints on the outgoing mail server to force the user to use
the right configuration (e.g. the from_filter, so the sending does not
fail).

Add an option in the mail module to install Outlook.

Show a message for the outgoing mail servers to explain each
authentication methods.

Task-2811567

Part-of: odoo/odoo#88215
2022-07-12 15:36:50 +02:00
Didier (did) ee61cc4259 [FIX] mail: correctly return a field command when guest
Before this commit, field command was returning incorrect value if the
channel_partner was a guest. At the very least we have to return a `clear`
command.

closes odoo/odoo#95411

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-08 14:33:55 +02:00
Raphael ColletandVincent Schippefilt eb67feb590 [FIX] *: cache consistency
In module mail, invalidating 'message_ids' on a mail thread also
invalidates its inverse field 'res_id' on messages.  If you haven't
flushed it before, your cache will be inconsistent, as shown by the test
/mail:TestMailgateway.test_message_process_bounce_records_channel.

In module purchase_stock, add depends on report.stock.quantity.  This
ensures that when the model is queried after changes in other models,
the data on which the SQL view depends is flushed to the database before
querying that model's table.

closes odoo/odoo#66938

Related: odoo/enterprise#16722
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2022-07-05 11:35:01 +02:00
Thibault Delavallée ccf9a5aa9f [FIX] mail: help user using scheduled date field on mail
Followup of odoo/odoo@582ac8d9a9

Task-2860761

closes odoo/odoo#95143

X-original-commit: d95b19e2481e13fa159ebce0f1cc35175adecd4d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-04 10:19:42 +02:00
mafo-odoo 55130e50f2 [FIX] mail: try to parse scheduled date input
``scheduled_date`` field of ``mail.mail`` is a char field since its addition
in 2015 (see odoo/odoo@364b4ba06d). As its first usage was in combination with
mail templates, a char field was used to simplify its implementation.

However this technically allows to store whatever value in that field. Using
it in a filter with a datetime argument is quite strange. A workaround is
to try to parse as much as possible the inputs, remove timezone information,
try to localize it, and have it in regular server format to enable filtering
on it.

We consider value should be set in UTC. If we have a specific timezone set
on the input we localize it to UTC. Otherwise we consider the input was done
in UTC, as all datetime fields. It is the role of the business code generating
mail.mail to either give the timezone, either already convert into UTC.

This might solve the following bug
  Step to reproduce:
	activate the developer mode
	go to settings - technical - emails
	create a new email and set the Scheduled Send Date in the future
	run the scheduled action Mail: Email Queue Manager
  Current behavior:
    the email is sent and the action does not consider the filter
  Expected behavior:
    the email is not sent and will only be sent when the scheduler detects
    that scheduled_date exceeds the current time.

Task-2833300
opw-2823106

closes odoo/odoo#94937

X-original-commit: 5c113cb9d54e051132a9a50deb2fcf61f9c9dc2c
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-30 17:41:13 +02:00
std-odoo 66f5bc4dbf [IMP] portal: allow portal users to deactivate their accounts
Purpose
=======
Allow portal users to deactivate their accounts from the portal view.

After the deactivation, they are redirected to the login page, so
they can verify that they can not longer login with their credentials.

We first archived the record and remove sensitive information (password,
login, so he can not log in again with the same credentials).

After the deactivation, we blacklist the email and the phone of the
user, so we are sure that we never send him again email / SMS.

Then, we create a <res.users.deletion> to delete the user and the
partner in a CRON because this operation can be heavy (write_uid,
create_uid field on all models).

Task-2629544

Part-of: odoo/odoo#78298
2022-06-30 12:10:56 +02:00
Radhika ShyaraandPrakash Prajapati 1e2b70012a [FIX] mail: check if the user can access to the thread
Before this commit, when the user creates a private task
and assign another user to that task and then removes
himself and save the task, the current user should no
longer access to that task since the task becomes this
private task of the other user assigned on it.
So when the current user changes anything in that task,
it will have a `Access Error`.
However if the user tries to remove a follower on that
task he will also have a traceback because no thread is found.
The reason why no thread is found is because the user has
no longer access to the record and so he has no longer
access to the chatter.

This commit checks if a thread is found before continuing
the process. If no thread is found then the user has no
access to the chatter instead of throwing a traceback
because no thread is found.

task-2857229

closes odoo/odoo#94665

X-original-commit: 2c68e397b3c12657024e70016808183c89260168
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Prakash Prajapati <ppr@odoo.com>
2022-06-27 16:25:58 +02:00
Thibault Delavallée 8cbac0506c [FIX] mail, various: remove outdated "render_safe" rendering option
Render safe option was used with Jinja rendering to tell Jinja that content
was safe and was not expected to be escaped. This was used notably in subject
as characters like ``&`` was escaped in email subject (e.g. `R&D News`).

This is now supported directly by the "inline template" rendering engine that
is used to render text-based templates since Odoo v15 [1]. This option is not
supported by code anymore anyway and leads to nothing.

Task-2088884 (MailComposer: Onchange to editable computed stored)
Task-2710804 (MailThread Api Cleaning)

[1] See odoo/odoo@68182baff4

Prepares Task-2088884 (Mail: Composer Onchange to Editable Computed Stored)

Part-of: odoo/odoo#94660
2022-06-27 16:25:54 +02:00
Thibault Delavallée 6fec3e9091 [FIX] mail, mail_group: fix override of _message_compute_author
This commit mainly fixes an override of ``_message_compute_author``. It is
done with an incorrect default parameter value for raise_exception defaulting
to False instead of True). By the way we also fix parameter naming in order to
ease understanding.

Part of Task-2710804 (Mail: Clean Mail.Thread API)

Part-of: odoo/odoo#94660
2022-06-27 16:25:54 +02:00
Thibault Delavallée dc3d3f7dd8 [FIX] mail: fix some typos
Fix some typos spotted in mail sending code.

Prepares Task-2684479 (Mail: Better send error storage and display)

Part-of: odoo/odoo#94660
2022-06-27 16:25:54 +02:00
Jeremy Kersten 1186424387 [FIX] mail: check access on translation too
This commit checks that users without the access right 'Template Editor'
are not allowed to add dynamic qweb in the translations of a mail
template.

Old tests have been updated to keep the assertRaises and all the code
that handle the invalidation cache, ... But now we ensure that the
Access Error raised is the expected one.

Original tests was testing that a user without the group 'Mail Editor'
got an  access error due to the missing group, but since the commit
1a3e713 the Access Error is because you cannot edit a template that is
not created by yourself.

closes odoo/odoo#94597

X-original-commit: 127a598e96e0e4a9952c009d98b705ceccf40def
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-25 17:06:48 +02:00
diagnoza cb07db6e41 [FIX] mail: allow tracking values not loaded into registry
Use dict.get() instead of a subscriptable call. This way we let through
selection values that are not loaded into the registry, instead
of raising an error.

This is especially useful in the upgrade environment
where such values may be unavailable (because of being
lambda-defined in a custom module for instance).

closes odoo/odoo#94530

X-original-commit: 36a6943740f9b4fbd9a78986bee4cd84bb8469c7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 18:33:05 +02:00
Sébastien Theys 3332bff665 [IMP] mail: clean up main attachment js model
Part of task-2886642

closes odoo/odoo#93895

Related: odoo/enterprise#28532
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 18:56:19 +02:00
Sébastien Theys 0c30945d36 [IMP] mail, *: clean up attachment format and isolate legacy calls
* = im_livechat, portal, portal_rating, test_mail

Part of task-2886642

Part-of: odoo/odoo#93895
2022-06-20 18:56:18 +02:00
Fabio Barbero dc66b7aec3 [IMP] mail, various: use overridden method in message_notify
Purpose
=======

In message_notify, when called on a recordset, call model methods instead of
base one defined on MailThread. This allows to use internal methods overrides.

Also perform some linting on calls to ``message_notify`` in order to better
spot calls, parameters, ...

Task-2852908

closes odoo/odoo#92868

Related: odoo/enterprise#28038
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-18 10:23:03 +02:00
Thibault Delavallée c4133ec2eb [FIX] mail: do not fetch followers in user_notification mode
When fetching recipients information for user_notification we don't need to
check for followers, as only explicit recipients are considered.

Task-2859935

Part-of: odoo/odoo#92868
2022-06-18 10:23:02 +02:00
Louis Wicket (wil) d91f7852db [IMP] mail, *: user settings improvements
* = im_livechat, test_discuss_full

Various improvements to user settings, including:

+ Introduce new js models `res.users.settings` and `res.users.settings.volumes`
to mirror the python models.
+ Avoid reformatting server data and simplify the way notifications are handled.
+ Clean dead code (unused convertData).
+ Reword and add documentation.

closes odoo/odoo#93390

Related: odoo/enterprise#28291
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-17 14:14:14 +02:00
Florian Charlier dae28c4b46 [IMP] base: add _is_internal method to res.users
No method was readily available to know if a user is `internal` (has
group `base.group_user`), which was inconsistent with other base groups.

_is_internal is now used in the codebase where it is clear that
`.has_group('base.group_user')` is called on a single record.

Part-of: odoo/odoo#85703
2022-06-14 09:35:57 +02:00
Sébastien Theys d9c25be92f [IMP] mail: introduce Channel and ChannelMember model
task-2832456

closes odoo/odoo#91918

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 17:58:22 +02:00
std-odoo f3f750b0f7 [FIX] mail: do not ignore email sent by mailing list
Bug
===
Since 9c1cdd330e we ignore all incoming
email sent by mailing lists.

They are real use case when people want to be able to receive email
from mailing list (e.g. if they subscribed to an automated service,
or if someone is in leave and has done a auto-replier for that, etc).

Add a model to whitelist some email address. The alias limit
does not apply for those emails.

Task-2862092

closes odoo/odoo#92015

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-07 10:16:18 +02:00
sofiagvaladze cef01fa521 [IMP] mail, hr_expense: show expense attachments on sheet
Purpose: Before it was hard to view expense attachments from sheet record.
To do so, the user should have gone through clicking on each expense first and
checking attachments, or could have clicked on a attachments smart button on embedded
expense table, which is redirecting to another view that only displays attachments for the one expense only.
Thus, checking all the attachments from sheet was an tedious task.

After this commit, the user can see in the sheet attachment preview all the associated expenses' attachments.

To make it possible, we ovveride 'mail.thread' method that is called to
fetch the data for the chatter. In the override, we fetch extra, associated expenses' attachments.

task - 2320177

closes odoo/odoo#92724

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 16:54:22 +02:00
Pierre-Yves Dufays aa32818c30 [IMP] [test_]mail[_full]: improves message recipients visibility
All the recipients of message were not always displayed in discuss and some
users were wondering if the message has been sent to everybody concerned.
This solves the problem by allowing to specify whether to display all
recipients based on the message sub type and defining for which sub type it
must.

Technical note:
- The added query count in some tests is due to the fact that the inbox
notification can now be displayed on the client. Before they were discarded
right away. Now additional check must be done. The added query is due to the
test self.res_partner_id.partner_share which is now also done on inbox
notifications (This has been determined by testing locally for all tests except
one: TestMailHeavyPerformancePost.test_complete_message_post, but it is likely
for the same reason).
- A speed optimization could be to add mail_notification.display as stored
computed field in order to avoid that extra read but it would add a little more
needed storage.

Task-2429708

closes odoo/odoo#90203

Related: odoo/upgrade#3487
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-01 09:57:47 +02:00
Rahul Prajapati ac00d19c8d [IMP] mail: remove alias mixin from channel
Before this commit:

mail.alias.mixin is being used in mail.channel

After this commit:

removed mail.alias.mixin with all of its uses in mail.channel

Task-2823691

closes odoo/odoo#89652

Related: odoo/upgrade#3469
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 19:17:06 +02:00
Florian Charlier ab9bc656da [IMP] mail: improve notification email previews
Prepare an informative and nice-looking preview from the main content of the
email body, avoiding buttons/images alt etc.
Links, images, tables are removed.

Whitespace is added after the preview to avoid including the full message in
the preview (with markup).

Tags and attributes are also added to increase compliance with HTML5 standard,
including accessibility.

One additional SQL request is required to fetch the preview sub-template.

Task-2413355

closes odoo/odoo#86266

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 19:16:49 +02:00
Didier (did) d46e879983 [FIX] mail: remove channel name translation
task-2818091

closes odoo/odoo#88239

Related: odoo/upgrade#3423
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 14:59:04 +02:00
std-odoo 036a739b62 [IMP] mail, mass_mailing: remove the <mail.mail> in batch
Purpose
=======
Improve the performance of mass mailing by removing the <mail.mail>, in
batch, all at once. The unlink operation is very expensive for the ORM,
in terms of SQL queries.

A new field `to_delete` is required to know which <mail.mail> we need
to delete. The reason is that the `failure_type` is stored on the
<mail.notification>, and it's possible to have <mail.mail> without
<mail.notification>.

Task-2587345

Part-of: odoo/odoo#73271
2022-05-31 14:58:53 +02:00
std-odoo 94a372dee7 [IMP] mail: improve the tree view of the <mail.mail>
Purpose
=======
Show the state of the <mail.mail> in the tree view and color only the
badge widget instead of the entire row.

Fix a typo in the help of the scheduled_date field on mail template.

Task-2587345

Part-of: odoo/odoo#73271
2022-05-31 14:58:53 +02:00
std-odoo 33965afa5e [IMP] mail: do not remove cancelled email during the sending
Purpose
=======
It's not the role of the sending method to remove non outgoing emails.

Task-2587345

Part-of: odoo/odoo#73271
2022-05-31 14:58:52 +02:00
Louis Wicket (wil) 94db11826e [IMP] mail: add res_users_settings_id field
Add the `res_users_settings_id` field on `res.users` so that it can be
used as a target for relateds that is not a x2many field.

closes odoo/odoo#90015

Related: odoo/upgrade#3479
Related: odoo/enterprise#26287
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 12:52:00 +02:00
root 4c6a010730 [ADD] mail: quick-open related record from activity
Current behavior before PR: You have to find the right menu/view and then take
over the ID stored on the activity (through export) to find back the record.
This is annoying, painful and error prone.

Desired behavior after PR is merged: By adding a smartbutton the user can
quick-navigate to the related record in a second. This allows for quickly
finding and opening records which is usually handy when debugging things or
finding back related records.

Task-2868230

closes odoo/odoo#91230

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 11:06:56 +02:00
root 6d1f9a2000 [ADD] mail: quick-open related record from email
Current behavior before PR: You have to find the right menu/view and then take
over the ID stored on the email to find back the record. This is annoying,
painful and error prone.

Desired behavior after PR is merged: By adding a smartbutton the user can
quick-navigate to the related record in a second. This allows for quickly
finding and opening records which is usually handy when debugging things.

Task-2868230

closes odoo/odoo#91228

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 11:06:52 +02:00
Denis Ledoux 23c24843cc [FIX] mail: template _is_dynamic with a field having groups=
Using customization, if you add a field on `mail.template`
with a `groups=` attribute with a group your regular users do not belong to,
e.g. `groups="base.group_system"`,
the users will have an access error when attempting to read the given
field when checking if the template is dynamic,
with the `_is_dynamic` method.

We could restrict the list of fields to read/check to the fields
the user has access, but that means a user could
duplicate a template with code in the fields he cannot see.

So, read the field has sudo to make sure they do not contain code
is the way to go.

closes odoo/odoo#92371

X-original-commit: 41cbd3fdfec8e2b7a8b22360c5bb7f7b9bab4b1e
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-05-27 17:45:59 +02:00
Raphael Collet 6cf8db906f [REF] *: adapt code to new flush API
closes odoo/odoo#87527

Related: odoo/upgrade#3497
Related: odoo/enterprise#26939
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-05-25 18:00:47 +02:00
Didier (did) 0b1846bb46 [IMP] mail: display channel invite group restriction
Before this PR, nothing warned the user that the invitation link was restricted to
a user group.

task-2818094

closes odoo/odoo#88562

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-23 17:31:45 +02:00
Zelong Lin 659c61219f [REF] mail: use tracking models rather than fields
Introducing tracking_value and tracking_value_item models for tracking value.

task-2817111

closes odoo/odoo#88547

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-23 17:31:42 +02:00
Christophe Monniez 65c8814a2f [FIX] various: replace deprecated currentThread method
CurrentThread is now really deprecated in Python 3.10 ... Time to
change.

Part-of: odoo/odoo#91927
2022-05-23 08:29:52 +02:00
Ipsita Borisagar c272573905 [FIX] mail, test_mail_full: remove an obsolete method
Before this commit:

There is an obsolete method 'channel_fetch_listeners' which is not needed now.

After this commit:

Removed this obsolete method.

Task-2827899

closes odoo/odoo#91876

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-20 13:15:49 +02:00
std-odoo 9c1cdd330e [IMP] mail: avoid email loops when Odoo reply automatically
Purpose
=======
In this commit, we will fix the loops that occur when you send an email
to an alias (to create a ticket e.g.). In that case Odoo can reply
"Your ticket has been created" and then the auto-replier of the user
can reply to this email and the loop occurs.

Specifications
==============
To solve this issues, we add 2 system parameters
- <mail.gateway.loop.minutes>, 120 minutes by default
- <mail.gateway.loop.threshold>, 20 by default

When an email is sent to an alias, we look on the last records created
<mail.gateway.loop.minutes> minutes ago. If we overcome the limit
<mail.gateway.loop.threshold> the email is ignored.

Alias creation detection
========================
To detect the number of records created by a specific email address we
use the `_primary_email` attribute set on the model.

Task-2294034

closes odoo/odoo#78597

Related: odoo/enterprise#21772
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-20 13:14:56 +02:00
Sébastien Theys 2825af7623 [IMP] mail, test_discuss_full: only return ids of public partners
Other data are not actually used. This will improve performance a bit (less
queries, less data to return) until the need to return this list goes away (it
requires a bigger refactoring).

task-2847983

closes odoo/odoo#91576

X-original-commit: 61e472aa35ac825553144fd9a80fbf62e3e8b5e1
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-05-18 12:00:46 +02:00
std-odoo 0afd1f672f [FIX] mail: allow the admin to open any emails
Bug
===
When the admin open an email, he might get an error message if he can
not access the mail message.

Technical
=========
To allow to bypass mail message ACl without adding extra SQL queries, we
need to overwrite "_add_inherited_fields".

This trick add a related_sudo on the inherits fields, it can't be done with
>>> subject = fields.Char(related='mail_message_id.subject', related_sudo=True)
because the field of <mail.message> will be fetched two times (one time before of
the inherits, and a second time because of the related), and so it will add extra
SQL queries.

Task-2464212

Part-of: odoo/odoo#78734
2022-05-17 10:10:06 +02:00
std-odoo 0ad4209b6d [FIX] mail: hide restricted the attachments the current user doesn't have access to
Bug
===
When the admin open an email, he might get an error message if he can
not access one of the attachment of the email.

Now the admin is able to view / edit the attachments he has access to.

Task-2464212

Part-of: odoo/odoo#78734
2022-05-17 10:10:05 +02:00