Commit Graph
430 Commits
Author SHA1 Message Date
Christophe Simonis f3ac68ed29 [MERGE] forward port branch 10.0 up to e2532f855f 2017-10-20 16:09:28 +02:00
Lucas Perais (lpe) e3f05496b1 [FIX] mail: fix template preview wizard view
Before this commit, when on a mail.template form, click on the Preview smart button.
A wizard popped up with two buttons, as the default for form views.
First this made no sense since the wizard doesn't represent a model that can be modified
Second, the button discard was unable to close the wizard.

After this commit, only a discard button is present which does its job.
2017-10-20 09:09:34 +02:00
Christophe Simonis 6956ad54de [MERGE] forward port branch 10.0 up to 6dc0f31415 2017-08-22 16:45:43 +02:00
Christophe Simonis 6dc0f31415 [MERGE] forward port branch saas-11 up to 92ec666f8d 2017-08-22 16:28:10 +02:00
Christophe Simonis 902fc764d5 [FIX] mail: only set header value for emails (not comments) 2017-08-22 13:32:34 +02:00
Christophe Simonis c023e1d562 [FIX] mail: add custom headers for mails send via the composer 2017-08-22 12:27:47 +02:00
Raphael Collet 5d746d0ac6 [IMP] base, *: tighten ir.model access rights
Remove unrestricted "read" access.  To make code internally using `ir.model`
work, add a private method `_get` on `ir.model` to retrieve the record
corresponding to a model name, without access rights issue.

Change signature of method `get_authorized_fields` to make it use a model name
instead of a model id.  This removes the necessity of a search on `ir.model`.
2017-01-03 16:52:49 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Ravi Gadhia 60bacefd01 [IMP] mail: add activities allowing to define next actions on various models
This commit introduces generic activities to use in your addons. Activities are
actions user have to take on a document like making a phonecall or organizing
a meeting. Activities come with the mail module as they are integrated in the
Chatter but are not bundled with mail.thread.

New models are

 * mail.activity.type: used to categorize activities. Each type is a different
   kind of activity e.g. call, mail, meeting. An activity can be generic i.e.
   available for all models using activities; or specific to a model in which
   case res_model_id field should be used.
 * mail.activity: an actual activity to perform. Activities are linked to
   documents using res_id and res_model_id fields. Activities have a deadline
   that can be used in kanban view to display a status. Once done activities
   are unlinked and a message is posted. This message has a new activity_type_id
   field that indicates the activity linked to the message.

This commit introduces a mail.activity mixin to use in various addons that
enables the activities feature. It works like the mail.thread mixin. It defines
a activity_ids one2many field toward activities using res_id and res_model_id.
Various related / computed fields are also added to have a global status of
activities on documents.

Activities come with a new JS widget for the form view. It is integrated in the
Chatter widget although it is a separate widget. It displays activities linked
to the current record and allow to schedule, edit and mark done activities.
Use widget="mail_activity" on activity_ids field in form view to use it.

There is also a kanban widget defined. It defines a small widget to integrate
in kanban vignettes. It allow to manage activities directly from the kanban
view. Use widget="kanban_activity" on activitiy_ids field in kanban view to
use it.

Next commits will aim at integrating activities inside main Odoo addons.

Thanks to R&D India for their work and testing on this task. Thanks to belgian
Usabiliteam for reviewing and testing it. Thanks to @jem-odoo for the final
review. May his soul lie in peace with the trumpets of paradise.
2016-12-21 10:56:15 +01:00
Christophe Simonis e91a8d428f [MERGE] forward port branch saas-11 up to 2a6e077f4a 2016-12-16 16:10:03 +01:00
Christophe Simonis 2a6e077f4a [MERGE] forward port branch 9.0 up to 1246a470df 2016-12-16 15:55:13 +01:00
Christophe Simonis 1246a470df [FIX] mail: correct MailComposer wizard
Oversight of previous forward-port.
2016-12-16 15:16:56 +01:00
Christophe Simonis 5f63878ff6 [MERGE] forward port branch saas-6 up to 2317801ddb 2016-12-16 14:44:42 +01:00
Christophe Simonis 2317801ddb [MERGE] forward port branch 8.0 up to 638989b84e 2016-12-16 12:45:13 +01:00
Thibault Delavallée b9c79b0a97 [IMP] mail: composer in mass mail mode does not use search domain by default
It now uses active_ids (checked records) by default. Composer allows you to
change and use active_domain (search criterion) instead.
2016-11-23 12:56:18 +01:00
kso 582dff36cf [IMP] mail: Add 'Create and Edit' on channel followers invite wizard
As there is no reason to remove it each 2 saas, there's also no reason to put it back alternatively.
2016-11-22 14:38:38 +01:00
Christophe Simonis a7ba6cde9c [MERGE] forward port branch saas-12 up to 7134aff 2016-09-28 16:28:31 +02:00
Christophe Simonis 2c6d32ca7d [MERGE] forward port branch saas-11 up to 34186fd 2016-09-28 14:46:29 +02:00
Christophe Simonis 12548d3e73 [MERGE] forward port branch saas-10 up to e8b8784 2016-09-28 13:17:37 +02:00
Christophe Simonis e8b8784d5c [MERGE] forward port branch 9.0 up to 9ba5698 2016-09-28 12:59:25 +02:00
Olivier Dony 40bce50ddb Revert "[FIX] mail: onchange_template_id"
This reverts commit dc02f773ce.

This commit caused a side-effect that is worse than the issue
it tried to fix, which was purely cosmetic.
Now in mass-mail mode the template is only rendered once
and all recipients receive the same PDF, which completely
defeats the goal of a dynamic report. We have static
attachments for that.

Original fix related to opw-657152
Reverts PR #10568
2016-09-27 19:39:30 +02:00
Thibault Delavallée 7f8fb0dbfb [FIX] mail: add default recipients only when not having one specified 2016-09-13 18:02:44 +02:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Thibault Delavallée 38e181ee2c [IMP] mail: send email notifications after transaction commit
Using after commit event notifications emails are now send once the current
transaction is finished. This allows having issues with emails being sent
while the transaction failed sometimes after email sending, but still in the
same transaction.

A small hook is done to allow invitation emails to be sent directly as some
data related to mail.message is unlinked directly in the wizard.
2016-09-01 13:22:59 +02:00
Christophe Simonis 235ed4b2c1 [MERGE] forward port branch saas-12 up to 9ad5f26 2016-08-20 18:08:19 +02:00
Christophe Simonis 9ad5f26b3f [MERGE] forward port branch saas-11 up to 3a2147d 2016-08-20 17:18:31 +02:00
Christophe Simonis 3a2147d95c [MERGE] forward port branch saas-10 up to bc1a0a3 2016-08-20 16:57:36 +02:00
Christophe Simonis bc1a0a32ca [MERGE] forward port branch 9.0 up to 58cbcba 2016-08-19 16:59:29 +02:00
Raphael Collet 38e7a1318a [REM] most uses of self.pool 2016-08-16 09:55:46 +02:00
Raphael Collet bf668b64c1 [IMP] all: clean usage of safe_eval
Specifically: do not import `safe_eval` as `eval`, keep it explicit instead.
2016-08-11 15:36:56 +02:00
Thibault Delavallée efd55ab8a5 [REF] various: rename openerp node to odoo in xml files 2016-08-10 15:48:10 +02:00
Thibault Delavallée c8a313d51e [IMP] various: use odoo for imports instead of openerp and update class names 2016-08-10 15:48:07 +02:00
Thibault Delavallée 90a5079d01 [FIX] various: fix fields index parameter in new API still called select 2016-08-09 10:26:53 +02:00
Raphael Collet 8be3781501 [REM] ir_actions: remove no-longer-supported field auto_refresh from act_window 2016-06-21 17:56:56 +02:00
Raphael Collet 6037f3a56d [REF] fields: change API and semantics of converter methods
The cache data format has been split between a cache format and a record format
(returned by accessing a field on a record).  We have the following converters:

                                   ANY FORMAT
                                       |
                                       | convert_to_cache
                                       v
                                  CACHE FORMAT
                                       |
                                       | convert_to_record
                                       v
                                 RECORD FORMAT
                                       |
                                       | convert_to_read
                                       | convert_to_write
                                       | convert_to_onchange
                                       | convert_to_export
                                       | convert_to_display_name
                                       v
                                 OTHER FORMATS

Modify the API of the converter methods to make them uniform (pass value and
record), and adapt their documentation.
2016-04-25 13:37:11 +02:00
Christophe Simonis ddb0fb2739 [MERGE] forward port of branch saas-9 up to 59d3f63 2016-03-24 16:53:45 +01:00
qdp-odoo 7a3d63b377 [MERGE] forward port of branch saas-7 up to revision 71d16a369e 2016-03-16 10:27:19 +01:00
Denis Ledoux 002722b967 [FIX] mail: Discuss > Send mail sends a private message
For a message to be considered as a private message,
the message must have:
 - `no_auto_thread` set to `False`
   in other words, it must not be attached to a thread
 - no `model` or `res_id` must be set on the message
   meaning the message is not attached to a specific
   record thread.

See `_get_message_id` in `mail/models/mail_message.py`.

Before this revision, the mails sent from
`Discuss` > `Send mail` were not regarded
as private messages,
but as a kind of mass mailing messages,
with a `reply-to` wrongly set.
Any attempt to reply to these mails
failed with a delivery failure notification.

This was because the `message-id` of these messages
contained `reply-to`, and such message-ids are
treated as a special case in the messages routing
(basically, the match on the mail references is disabled
for these messages containing `reply-to` in
their message-id).

opw-669241
2016-03-08 15:38:10 +01:00
Nicolas Martinelli 88e7122020 [FIX] mail: mail_server_id
When a specific SMTP server is set on a mail template, it is never used
when the mail is sent. There are two reasons:
- `mail_server_id` is a read-only field set by an onchange. However, a
  read-only field is not sent to the server, so the information is lost.
- The information is stored in the context of the object `Mail`, but it
  is never used. Moreover, when the method `message_post` is called, the
  `Mail` object is not used to post the message, so the information is
  lost again.

The fix includes two parts:
- the `mail_server_id` field is not read-only anymore. Actually, there
  is no reason to make it read-only.
- the information is stored directly in the mail values and used at the
  appropriate moment.

Fixes #6554 (from v9.0)
opw-669958
2016-03-03 13:24:41 +01:00
Yannick Tivisse 9a85d870fd [IMP] mail: Do not create channels or partners from an invitation on a chatter
Use case: I can create a Channel on a chatter, for example on a task
If I choose create and edit, there's another window coming where I
can set up the Channel. In this situation I can't add any members.
But then as the channel is empty and I (as the creator) am not by default
in that channel, I can't find it in my Channels in Discuss...
2016-02-02 09:56:52 +01:00
Thibault Delavallée 0408f7931f [IMP] mail: compose options for mass mailing
Composer in mass mailing mode currently keeps a copy of the emails in the
document communication history (chatter). It is done by keeping the
mail_message that is used to create the mail_mail record. It is now possible
to customize this behavior. Using auto_delete_message one can choose to not
keep a copy of the sent emails.

Note that the notification field on the mail_mail is used to know if the
associated mail_message has to be unlinked when unlinking the mail_mail.

Auto deletion of sent emails is based on the option on the template used
to generate the emails. It is now possible to bypass the template behavior
if requested, using the auto_delete field in the composer. If this field
is not set, the previous behavior applies.

It is now also possible to tune the message_type and subtype_id of the
posted message. Previously all messages posted through the composer
were comments with a computed subtype being either a comment or a note.
Those values are now default values but can be changed in the wizard
and correctly taken into account when posting the message.

Those modification do not change anything in the default behavior of the
composer and templates. They are mainly introduced for use in future
improvements in various addons, like sending reminder emails that are
not stored.
2016-02-01 12:03:17 +01:00
Christophe Simonis 7e44ddcda3 [MERGE] forward port of branch saas-7 up to 6f923cb 2016-01-27 12:23:09 +01:00
Goffin Simon dc02f773ce [FIX] mail: onchange_template_id
When using context action for a template, the report was not shown in
the compose message as an attachment.

opw:657152
2016-01-21 14:36:20 +01:00
Thibault Delavallée 2bfb880503 [FIX] mail: auto delete
Correctly set the auto delete property coming from the template in the composer.
Set the mail_auto_delete context key for message_post, and directly set the
auto_delete field value in mass mailing mode.
2016-01-13 10:34:09 +01:00
Christophe Simonis 3c7b08c030 [MERGE] forward port of branch saas-7 up to 9ad5c66 2016-01-12 18:48:20 +01:00
Christophe Simonis 33299fd689 [MERGE] forward port of branch saas-6 up to 5eee559 2016-01-12 18:46:23 +01:00
Christophe Simonis 5eee5591ab [MERGE] forward port of branch 8.0 up to 37ed5ce 2016-01-12 18:24:27 +01:00
Thibault Delavallée 148c1ed51c [FIX] mail: html issue in invite email
Thanks Vitor Fernandes <vmlf01@gmail.com> for pointing it out.
2016-01-11 12:48:09 +01:00
Christophe Simonis 99b6cd8119 [MERGE] forward port of branch saas-7 up to 2a834c2 2016-01-07 18:19:52 +01:00
Goffin Simon 61cf01b7a8 [FIX] mail: mailing domain not set properly
When selecting contacts from Contacts list views and clicking on
action window "Partner Mass Mailing", the 'active_domain' must be
filled in the wizard with the selecting contacts. In this way,
the right mailing_domain will be set when creating the related
mail.mass_mailing record (in addons/mass_mailing/wizard/mail_compose_message.py
in function get_mail_values).

opw:659383
2016-01-07 16:58:52 +01:00