A raw query is not necessary to produce the desired result, found
activities need to be kept only if the corresponding record can be found
with standard search (which includes multi-company check).
Part of task-3266643
closesodoo/odoo#123070
X-original-commit: 9dd7ae942aebe2cfd3e2dcd52e10b3bff5c8e0a9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Add message post with attachment test on record of another company than the
user company but for which the user has readonly access on. The goal is to
justify the sudo added in mail_thread:
- in '_message_post_process_attachments' method to create attachment linked
to the record (the creation of attachment linked to a record verify the
right to write to the record, so in readonly we need a sudo);
- in '_message_set_main_attachment_id' method to link the main attachment to
the record. Here we write directly on the record for which we only have
readonly access, so a sudo is needed. Here the attachment is already linked
to the model and we only "tag" it has main attachment (see odoo/odoo#30659)
Task-3178885 (Mail: fix 'readonly' post support)
X-original-commit: odoo/odoo@8486c7ee05
Part-of: odoo/odoo#114511
PURPOSE
Purpose of this commit is to add a company field on test mail models used to
replicate ticket / project behavior (``mail.test.ticket`` and ``mail.test.
container``).
SPECIFICATIONS
To avoid messing with existing tests and ease comparison through all Odoo
versions (notably performance) this is done by adding new models inheriting
from current mail models. A company_id field is added as well as MC rules.
Those models will be used to add tests for mail thread behavior in a multi
company environment (aliases management, performance, emails and notification
layouts, ...).
In this commit we also update ACLs for ticket-like models to add rules for
portal users, based on followers. This mimics classic rules from Odoo used
notably in a light project-like environment. This allows to test a bit more
in details recipients, access tokens, links in emails, ...
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.