The type fields of actions already defaults to
the model name in the base model definition.
Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).
closesodoo/odoo#114539
Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
This field will be used to remove low-level asserts using existence of
'message_post' on a given model instead of correctly checking the
inheritance on mail.thread.
This is going to increase a bit query counters but those queries should
be fast and have no real impact on performances.
Task-2088884 (Mail: Use editable computed stored fields in composer)
Part-of: odoo/odoo#107356
Currently when using the composer excluded emails are computed when the target
model inherits from the blacklist mixin. This behavior can now be deactivated
through a new field 'use_exclusion_list', like what has been done in SMS
composer.
Task-3132710 (Mail: Configurable composer)
Part-of: odoo/odoo#99482
Currently when using the composer to create a mass mailing emails are sent
directly, unless scheduled date is in the future.
With this commit it is now controllable through a field like what has been
done on SMS composer. Its default behavior is the same as before
* posting on a monorecord: force send notification emails;
* posting on multirecords: use the queue (force_send=False parameter given
to message_post and propagated to _notify_thread);
* mass mailing: use force send to send emails directly;
Usage of mail_notify_force_send context key is also removed when possible
as it is a standard parameter of posting API.
Task-3132710 (Mail: Configurable composer)
Part-of: odoo/odoo#99482
RATIONALE
Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.
SPECIFICATIONS
Change 'auto_delete_message' into 'auto_delete_keep_log' that has the inverse
meaning. Indeed it is unclear what 'auto_delete_message' really does. It is
used when automatically removing emails sent through mass mailing, to know
if message created through inherits are kept or not. Purpose of keeping them
is to have a log on the document. Deleting the message therefore removes the
log.
In this commit we change the meaning to something positive, keeping logs being
clearer when choosing which option to activate. Functional usage of the field
itself does not change with this commit.
Task-3035101 (Mail: Support batch-posting from composer)
Part-of: odoo/odoo#99482
RATIONALE
Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.
SPECIFICATIONS
Remove 'is_log' field on mail composer. Indeed its usage can be globally
replaced by using the 'note' subtype when posting. It is now better matching
the result of using the log a note mode of chatter.
Posting with a False subtype_id already automatically converts it into a
note subtype in 'message_post'. It is now done directly at composer level
to lessen magic and have more control on final output.
In case of outgoing emails subtype has no usage, as notification process is
not called. It is therefore forced to False when creating the mail records.
Task-3035101 (Mail: Support batch-posting from composer)
Part-of: odoo/odoo#99482
RATIONALE
Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.
SPECIFICATIONS
Purpose of this task is to correctly support scheduled_date from template on
both comment and mass mode in the composer.
It is currently mainly supported at template level, when using a template
to directly send emails. In this commit we add a field on composer that
takes the value from the template, and propagate it to the mail or messages
created when validating it.
As most template fields it can contain inline template code to be rendered
dynamically on target records, hence using a char field. Its rendering
is done using template that calls _parse_scheduled_datetime. It allows
to have an UTC and timezone agnostic value.
SCHEDULED_DATE SUPPORT
When posting a comment, scheduled posts uses the 'mail.message.schedule'
mechanism that creates the message but send notifications later.
When sending a mailing, emails have a scheduled_date set. As the 'send'
method does not check for scheduled_date (only the cron queue) we have
to filter emails scheduled in the future before calling the 'send'
method.
Task-2993872 (Mail: Support scheduled date in all composer flows)
Part-of: odoo/odoo#99482
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
RATIONALE
Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.
SPECIFICATIONS
Remove deprecated "mass_post" option from composer. It is either a comment
(using message_post) either a mass mail (creating emails). Mass post was
anyway nor used nor really supported. It will be replaced by supporting
having a comment on several IDs (batch comment mode, posting a message
on several records instead of being limited to one as currently).
This cleaning also allows to remove the 'notify' field that was an option
used for mass_post. All this should be supported through subtypes and
correct choice of post / mass mailing.
Task-3035101 (Mail: Support batch-posting from composer)
Part-of: odoo/odoo#99482
'email_from' fields are not necessary on 'sale.order.cancel' and 'survey.invite'
as anyway we always use the current user's email and field is not present in
form view. Override of default_get to raise about invalid email_from is not
necessary as anyway it raises when posting the message. Giving author_id to
message_post is sufficient as it computes email_from based on author when given.
Add 'render_model' in views, as it is part of the domain given to 'template_id'
field of composer mixin. When missing, also add 'lang' and 'template_id' that
come from the render mixin.
Use '_render_field' when possible instead of '_render_template' as its API
is simpler and uses field definition for rendering parameters.
Task-2710804 (Mail: Clean MailThread Posting API)
Part-of: odoo/odoo#99482
The field was not correctly aligned because the invisible rule was not
the same on the field and the sibling's DIV. So in some case, we can
have an empty DIV present with no label (e.g. when `is_log = false` and
`composition_mode = mass_mail`).
Note that now with grid, we need two filled columns otherwise we will
have a shift for the next following labels/fields, because grid will try
to fill the empty space.
Steps to reproduce:
* Open Helpdesk
* Select a Team
* Select the list view
* Check a row (line)
* Click on "Action" menu
* Click on "Send Email" => BUG
closesodoo/odoo#102941
X-original-commit: 52c8a8f4c16fe5765d64265f718164162f1cf172
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Followup of odoo/odoo@1a3e713
Bug
===
If the user doesn't have the template editor, he cannot open the template
preview.
Technical
=========
The reason for that is because the web editor moves some CSS properties,
and so when the user tries to open the preview, an access error is raised.
Ideally, the template form view should not be editable if the access
rules do not allow it. But in _postprocess_tag_field, we only check
for access right because we don't have the record. So a user without
write access rules, but having write access right can edit the template
in the UI, and gets an error when saving.
Also, the web editor should not save the HTML value if no change are
made on the field (like all other text / char field).
To mitigate the issue in stable, we add a computed field that check the
access rules and make the body readonly if he can not edit the template.
So the web editor is not loaded, the CSS properties are not moved. Other
possible solutions are way to complex technically speaking (editor internals
to update in frontend, complex comparison of html blobs in backend, cache
usage making fields_view_get override not working in all cases, ... )
As the HTML body look weird in readonly mode, add the same border as the web
editor.
Task-2845877
X-original-commit: dcf3ab5fb41aa9ef6e59b2155bfd192e551b6476
Part-of: odoo/odoo#99256
Some fields in composer model allows to control generated messages or emails
values. However they are not available in the form view. In this commit we
add them in form view as invisible, as a first step towards cleaning the
composer code and usage.
Next step will be to cleanup composer code to remove the onchange based on
template and have real computed fields. Those will require fields to be
available in views so adding them is a necessary first step.
Some tests are added to see the usage and purpose of some fields. This helps
having a better code coverage.
Query counters update when using the Form tool
* adding subtype_id: 2 queries
* adding author_id: 1 query
Task-2816845
Prepares Task-2088884
Part-of: odoo/odoo#98287
Improves UX by adding placeholders to clarify the purpose of some inputs and
changing some field layout to ease the edition (with the use of multi-lined
editor).
Details:
Some placeholders have been added:
- description field of survey.question
- default_note field of mail.activity.type
- summary of mail_activity_type_view_form
Some field layout have been turned into multi-lined editor:
- default_note field of mail.activity.type
- write a message in mass mail mode (email_compose_message_wizard_form)
added border for field help of edit action (class oe-bordered-editor)
Task-2766291
closesodoo/odoo#85046
Related: odoo/enterprise#24599
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Some html field are not in their ideal style.
As the style for html fields is now dependent of
where you are in the xml view ( in group or not),
we have to adapt some views and flags some fields
to ensure they have the correct look.
This change is only be a visual enhancement
and should not prevent the function of said html fields
even if the views are not updated.
task-2637488
# Conflicts:
# addons/mail/wizard/mail_compose_message_views.xml
# addons/website_slides/views/slide_channel_views.xml
# Conflicts:
# addons/sale/views/sale_views.xml
closesodoo/odoo#83792
Related: odoo/enterprise#23911
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
The purpose of this commit is, to add keyboard shortcut
to multiple actions.
So in this commit, added keyboard shortcut to several actions
in project, sale_project, web_calendar and added smart action
in command palette on statusbar.
task-2655790
closesodoo/odoo#79805
Related: odoo/enterprise#22267
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
RATIONALE
Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.
SPECIFICATIONS
Get rid of context usage (``custom_layout``) and use a real field on composer
model: ``email_layout_xmlid``. Use now a default value coming from context
(default_email_layout_xmlid) instead of custom_layout.
Support old context key in composer for backward compatibility, working like
a default value for the field itself.
Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
UPG odoo/upgrade#2829
Part-of: odoo/odoo#76418
On the CRM module, the user can send an email to all the contacts
associated to the leads matching some criteria by (1) displaying the
list view, (2) applying a search filter, (3) clicking on the "EMAIL"
button and (4) checking a checkbox on the mail composer to ask the
server to use the active search. To do the same thing, the user can
(1) display the list view, (2) apply a search filter, (3) select all
the records and (3) click on the "EMAIL" button.
To avoid redundancy and improve the usability of the composer, we will
remove the search domain passing from the mail composer. Note that it
will still be possible to pass a search domain programmatically.
To improve the guidance of the mail composer, we will add helper
messages, update the labels and move the options in a dedicated pane.
The wording of the buttons will also be updated dynamically based on
the selected options.
Example: When the user enters something in the `mass_mailing_name` field
to create a new mass mailing campaign from the new message, the label of
the "Send" button will be set to "Send Mass Mailing" which gives more
indication on what will happen when the user clicks on it.
task-2523036
Part-of: odoo/odoo#71413
Purpose
=======
Purpose of this commit is to add a new group for the mail template designer.
Goal is to make roles clearer: managers edit templates, users use them. This
commit allow some designers / managers to make email template and to let
others users use those email templates.
Specifications
==============
When this feature is enabled in the Settings page, a new group is required to
modify email templates in a composer like wizard or to make dynamic content.
This allows to separate managers editing / composing templates from standard
users that use them.
If the current does not have this group, the email body will be in readonly
mode if he selected an email template. That way we force him to use the email
template that the manager made.
Technical
=========
New Group
---------
Only users in this group will be able to create / write email template or
to write Jinja code in the mail composer (including other fields like subject
in mailing).
By default, all internal users have this group. Mass mailing users also have
this group as writing mailings is about the same management level as writing
templates.
Mail Composer Mixin
-------------------
In comment mode, the template is rendered and then saved on the body field
so non-"Mail Template Editor" users can load email templates.
But in mass mode, the body of the template is saved and then rendered and
many things change the body (HTML sanitizer, web editor move inline CSS
properties, add / remove spaces...). So in this case, we can not know if
the user changed the body or not. That is why we put the body field in
readonly mode so, it is not modified by the web editor.
Jinja code detection
--------------------
To detect dynamic Jinja content, we compile the template, and we browse the
AST. If we do not have a single "Template Data" node, we assume that the
template is dynamic.
When we detect the template as static, we do not render it. That way we
avoid unnecessary rendering.
Code cleaning
-------------
Move Jinja import into tools so that it is outside of mail framework code.
Task-2187263
closesodoo/odoo#75840
Related: odoo/enterprise#20547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As mail grows and will continue to grow, ordering views and having right
files is important to understand module organization and content.
Split main.py controller file into two files, one for mail related controllers
(redirections) and one for discuss.
Rename files according to guidelines for wizards and views.
No functional change comes with this commit. This is only code move.
Task-2631873
PR odoo/odoo#75571