- Improve performances, as the ir.rule restricting private partners
visibility is also applied on res.users by inheritance, on each
prefetch.
- Solve the issue of partners set as followers on records (eg: application
form) and then made private, making them impossible to contact via the
chatter.
- Solve the multiple access issues when trying to access the bank
account, or the private address for non HR people like the accountants
forcing the usage of sudo in the business code.
TaskID: 3101400
RATIONALE
Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.
SPECIFICATIONS
Support a real res_ids field on mail.compose.message model. Instead of relying
on active_ids from context, store it once for all at composer level and use
it in code. Active_ids usage is still done at default_get level, using it to
populate the field.
Improve usage of domain, renamed to res_domain to match other document related
fields naming. Add support of a res_domain_user_id field allowing to set the
user from which the domain should be evaluated.
Composer now runs on a list of IDs. Mass mail mode and comment mode are now
distinct from running on a singleton or on more records. Rendered or raw
mode is not triggered by
* mass mailing mode: always display raw mode, whatever the number of records;
* comment mode: display rendered mode when having a single record (like the
previous comment mode). Display raw mode when having either no records
either at least two records.
Task-3035101 (Mail: Support batch-posting from composer)
Part-of: odoo/odoo#99482
Purpose is to rewrite value generation as code is messy with a lot of dict
updates, rewriting key on top of existing keys until reaching the final value.
In this commit we better split computation, to have computation that is static
(currently, posting a comment as composer holds final code) separated from
dynamic computation (posting a mass mailing, as rendering is done based on
qweb or inline template value).
It allows to better understand how composer and template fields are used when
sending emails or posting messages. This commit should not change anything
functionally, even if some values are weirdly computed. Future commits will
improve support of composer / template fields, notably through computed field
and less cross computation.
Also split sending methods: do a mailing in batch in case of mass mailing
(allowing commit per batch), and simply loop on records to post a message
in case of comment (or mass post).
Task-2710804 (Mail: Clean MailThread Posting API)
Prepares Task-2088884 (Mail: Use editable computed stored fields in composer)
Part-of: odoo/odoo#99482
Current behavior
In the recruitment module, if you set an email template for the first step of
a job recruitment process you cannot send any other email using the full
composer. This happen because the partner type goes from 'contact' to 'private'
and this type cannot be set as recipient in the full composer.
Steps to reproduce
- Go to any job recruitement and set an email template for the first
step
- Go on the website and apply for this job
- Go back to the job application and send an email using the full
composer, the email is not sent to the applicant. And the applicant
is not added to the followers.
Fix is to somehow improve support by adding asked partners from default in
context.
Note that this does not change anything from ACLs point of view, as trying
to access private partners without the necessary group or ACLs will raise an
access error anyway.
Also note that private partners defined on a template are still stripped
as they do not respect the new (nor the old) domain. That would be tricky
to solve, better not use private partners in templates.
opw-3010308
closesodoo/odoo#109451
X-original-commit: 12b25f21216b11511d5fed22fb3564d9dc297559
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Part-of: odoo/odoo#109522
Co-authored-by: Robin Engels <roen@odoo.com>
Add tests showing current behavior of partner_ids fields on composer when
dealing with private partners. Some use cases are added as unit tests
* default_partner_ids: coming notably from suggested recipients;
* template usage adding a partner (e.g. partner_to);
* when not having the rights to see private partners, access error should
be raised;
* mail gateway when a private partner sends an email;
X-original-commit: 2153eec790b730761fe50d6bea5cd4bacedce97a
Part-of: odoo/odoo#109522
Co-authored-by: Robin Engels <roen@odoo.com>
PURPOSE
Cleanup and improve composer-related tests. As composer will soon be improved
better ensure we don't break flows.
SPECIFCIATIONS
Cleanup existing tests: rename, make it use tools, reoder them.
Add some tests about composer in order to better spot changes and differences
as well as to help debugging mail composer code update. Notably add tests
with Form tool, add tests for reply-to computation, auto-delete, mail server.
Performance tests about composer are added, notably using the Form tool. This
helps determining differences between creating / manipulating a composer in
code and in UI. Indeed notably onchange and some side effects may lead to
different query counters, which is the case as highlighted here. Tests
involving attachments are also added to see their impact on posting process.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
We adapted a test in mail in commit be21041f9aa385f2b9ce1b242379bf147c54b158.
Basically, the test only contained mso comments and no regular comment.
While the python code teats them the same, they are not semantically
equivalent as mso comments actually do have side effects in outlook.
The adaptation is to add a regular comment to the test data so that both
comment types are properly covered by the test, even though the result
is technically the same regardless.
This is the only change from this commit that was not yet present in 15.2.
closesodoo/odoo#84786
X-original-commit: 9275b0119ee6bb2e9a4ee5bef66b00e8c2456d3d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
For email design in the context of Microsoft Outlook, we want to keep
some magic Microsoft comments (Outlook conditional comment), which -
until this commit - were skipped by QWeb. These allow us to change the
rendering exclusively for Outlook so as to overcome some of its
limitations. This commit introduces a qweb rendering option
(`preserve_comments`) for when - like in mass mailing and digest - we
want to keep comments.
Part-of: odoo/odoo#80621
This adds a test sending a mail with comments (MSO conditionals) in
mass_mail mode.
X-original-commit: 8778c10bc1856e57216785a8332b90878ff1b5ef
Part-of: odoo/odoo#80621