Commit Graph
466 Commits
Author SHA1 Message Date
XavierDo 554414b90f [FIX] mail: fix use of resend wizard when user are in failure
The user right to edit partners was handled in order to set email fields as readonly
If a user is in the failed recipient, we need to check that the urrent user also has
right to write on users
2018-09-06 10:33:59 +02:00
Christophe Simonis 8285630ad2 [MERGE] forward port branch saas-11.3 up to 609491ad0e 2018-07-13 17:12:07 +02:00
Christophe Simonis f3929aa0f7 [MERGE] forward port branch saas-11.2 up to 87dadc5bc8 2018-07-13 14:32:05 +02:00
Christophe Simonis c952a11770 [MERGE] forward port branch 11.0 up to 6e6e3d4c96 2018-07-13 10:47:18 +02:00
Christophe Matthieu 6a5dc8bcd1 [FIX] mail: remove attachment feature in add followers modal
Before this fix, the attachments are don't save to the record and are
remove with the wizard. We can't add the attachments to mail.message
(like 'mail.compose.message') because it's auto_delete/unlink and the
attachments are removed before the recipient can read it.
2018-07-11 15:38:59 +02:00
Christophe Matthieu 3472a34e8a [FIX] mail: write all attachments only once
wrong indent.
2018-07-11 15:38:59 +02:00
XavierDo c8d283a592 [FIX]: mail: storing add_sign on mail message
Only the add_sign from notif_values is usefull for a resend. We can consider
that a mail on resend can be delete in every case, and we can find the
model_description from model since a resend can only be performed on
message linked to a model.

The other notif_values are now parameter in order to ease the understanding
of what can transit through this flow.

Task: #1860054
PR: #25622
2018-07-11 12:25:33 +02:00
XavierDo 62591c58f8 [FIX] mail: add ability to mark failure notification as read
The mark as read button was not working for mail failure. More than that,
we wanted a functionnality to be able to massively mark mail failure as canceled,
especially to be able to clean databases from failure after migration.

Task: #1860054
PR: #25622
2018-07-11 12:25:33 +02:00
Olivier Dony bf9a4663ff [IMP] mail: improve UI text in mail resend wizard 2018-06-23 03:12:05 +02:00
Olivier Dony cab349e7e4 [FIX] mail: access related fields for resend as normal user 2018-06-23 03:12:05 +02:00
Olivier Dony c77d3e5531 [FIX] mail: line endings: DOS->UNIX 2018-06-23 03:12:04 +02:00
Pratima Gupta 1184f7872d [IMP] mail: ease the use and specification of notification emails layout
This commit proposes to ease the use and specification of layout used to
encapsulate email body when sending notification emails. This is done
through two means

 * message_post_with_template now supports the custom layout parameter
   that allows to set the layout to use when sending notification emails
   in the message_post process. We have to rely on the context as it is
   the current way of using it in the composer. It is likely to change in
   a near future;
 * composer now supports through context (as we have no other choice)
   specific notification values to give to the notification layout rendering;

This commit is related to task 51122 (and PR #24052).
2018-06-08 15:20:04 +02:00
XavierDo 133eeb1bbf [ADD] mail, mass_mailing: allow a user to resend a mail with failures
When a mail is in failure state, a red envelope appears next to the message
in a thread but it was difficult to send the mail again.
This tasks will allow users to send mail again easily, or mark notification
as cancelled if the user want to ignore this failure.
A notification will appear in sender systray while mail are in failure.

Task: #46158
PR: #24628
2018-06-07 11:46:28 +02:00
Thibault Delavallée 324ae5ed8f [REF] mail: get rid of thread_model context key
message_post and various mail.thread related code still support a thread_model
context key allowing to redirect message post on another model. Purpose of
this commit is to get rid of that context key and support model / res_id
fields coming from either the record on which we run, either parameters of
message_post. Indeed those parameter match the one used as fields on mail
message. It makes sense to support them for customization if necessary
instead of using a context key.

This context key exists since a lot of time. It is difficult to find the
source as history is quite complex when the mail was refactored in 2012.
See notably 6aa4f80b2d and 2c4ed841b9 for example.
2018-05-07 11:00:03 +02:00
Thibault Delavallée 282733cf8d [REF] mail: make notification methods semi-generic
mail.thread mixing class defines several methods used in notification process
that are not specific to mail.thread enabled models. It means some models
could override it while some other models do not even have a direct access
to that method.

When calling those methods we have to manually check for method being
available on a record or call a default implementation from mail.thread
even if the model does not inherit from the mixin.

In this commit we propose to hide this check in generic wrappers located
in mail.thread class. It checks for method existence on record and call
the model-specific implementation or falls back on standard behavior. It
allows to be sure the right method is called.

Functionally behavior should stay globally the same. However when updating
some addons code has been updated. Previous code could lead to records not
having correct alias which should not be the case anymore. This commit is
linked to task ID 47934.
2018-05-07 10:58:54 +02:00
qsm-odoo fbfd011904 [REF] *: get rid of introduced @​extend
During first scss convertion, classes called as mixins were changed to
an @​extend instruction which was the best approximation given the fact
there is no equivalent in sass to do that. The problem is that the
instruction is slowing the scss computation a lot and might also break
the style in unexpected ways because of the complex unwanted selectors
the instruction induces.

This commit removes the need of extends. This is done case per case.
Sometimes this involves adding classes in xml, sometimes to change the
style a little, ... The button rendering refactoring which was made
at the start of the LESS to SASS merge was also done in prevision of
this.

After this commit, sass computation is like 5-6 times faster than less
computation while it was like 10 times *slower* before this commit.
2018-04-18 15:59:18 +02:00
Thibault Delavallée 4451e505cd [IMP] mail: use xmlid_to_res_id instead of ref in remaining places of mail
As explained in previous commit we can use xmlid_to_res_id instead of ref()
which leads to some query gain. This commit update some other less important
places: when setting activities as done and in the composer. This lead to
a gain in tests involving activities and composer, including tracking
triggering a template. On community runbot this leads to a gain of about 1K
queries.
2018-03-28 16:57:05 +02:00
Thibault Delavallée 8a026e26c6 [IMP] mail: update _notify API
Purpose of this commit is to allow to give additional values when rendering
notification emails and to make some parameters explicit.

This commit updates the _notify API. It allow to propagate a dictionary
containing values given to the rendering of the notification template.
This allow to have more complex templates and/or to control the rendering
depending on some parameters. Indeed currently only some fixed values and
values coming form the message to notify are given to the rendering
context.

First use will be soon when pushing notification emails not necessarily
linked to documents. In this process some values will be given by the caller
and not only by the message context anymore.

This commit also moves some context key used to control the notification
process directly in values given to the _notify method. It allows to make
those parameters explicit and rely less on context.

The _notify method now takes a values dictionary that may contain

 * add_sign: add user signature to notification email, default is True.
   It replaces the ``mail_notify_user_signature`` context key;
 * mail_auto_delete: auto delete send emails, default is True. It
   replaces the ``mail_auto_delete`` context key;
 * other values are given to the context used to render the notification
   template, allowing customization.

It allows to remove some context switch notably in the composer. A values
dictionary is computed and given to message_post and then propagated to
the notification mechanism.
2018-02-20 14:32:09 +01:00
Thibault Delavallée d1ec600c43 [IMP] mail: move custom_layout context management in wizard
Purpose of this commit is to clean the use of custom_layout in context
in order to have more explicit argument.

Several mail.compose.message instances are called using the
custom_layout magic key. As this parameter is now managed directly
by message_post API we can remove its management in the notification
process and add it explicitly in the wizard's message_post call.
2018-01-29 16:35:36 +01:00
Thibault Delavallée cae1c3977f [REF] mail: rename notification methods and make them private
Purpose of this commit is to perform a light cleaning of the email
notification process. It renames method by prefixing them by _notify
in order to easily spot them. It also makes them private because they
should not be called outside of other methods. Indeed those methods
are technical and do not provide useful information to external
people.

Future commits will probably improve the notification process in order
to clean it and try to reduce its query count.

This commit perform the following renaming

 * message_get_email_values -> _notify_specific_email_values
 * message_get_recipient_values -> _notify_email_recipients
 * _message_notification_recipients -> _notify_classify_recipients
 * message_get_reply_to -> _notify_get_reply_to
2018-01-29 16:33:07 +01:00
Thibault Delavallée fc1348dd3d [REM] mail: remove unnecessary methods from mail.thread
* one dead method;
 * one unnecessary method to inline;
 * one unnecessary wrapper;
2018-01-08 15:04:56 +01:00
Richard Mathot eb61925344 [FIX] base_partner_merge: this wizard does not depend on mail anymore
We then extract the logging of the merge in a separate submethod, and
log in chatters only when available.
2017-12-21 12:59:23 +01:00
Christophe Simonis de987831da [MERGE] forward port branch 11.0 up to d70518d04f 2017-10-21 15:22:36 +02:00
Christophe Simonis 10128fa7e8 [MERGE] forward port branch saas-16 up to dc2a6c6cd2 2017-10-20 19:27:04 +02:00
Christophe Simonis 5ea0f55d65 [MERGE] forward port branch saas-15 up to bee0c11ef7 2017-10-20 17:57:21 +02:00
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
Prakash Prajapati e302ca7b3d [IMP] mail: display latest records first when previewing templates
And also avoid resetting the body if there is no record chosen.

Closes #18566 .
2017-10-18 13:20:39 +02:00
Hetashree Chauhan 8efecd31bd [IMP] mail: labels for sending mail to all recipients has been changed 2017-09-26 12:21:25 +02:00
Christophe Simonis 30bd5ac0e9 [MERGE] forward port branch saas-16 up to aec6248bb3 2017-08-23 16:44:58 +02:00
Christophe Simonis 59f8b849fb [MERGE] forward port branch saas-15 up to d5f2a38b50 2017-08-23 11:23:08 +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
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
qdp-odoo 9d1df81af5 [IMP] account: onboarding of the invoicing app
-added tour for invoicing
-allow to set easily the number of the first invoice/bill/refund of a journal, from the invoice screen
-small usability fixes and refactoring
2017-07-12 17:48:43 +02:00
Raphael Collet b8cf940247 [ADD] base: new wizard to uninstall a module (#17284)
The "Uninstall" button on the module form no longer changes the state of
modules, so that cancelling the wizard will not unexpectedly perform the
uninstallation.  The uninstallation is performed only by clicking on the
"Confirm" button on the wizard.

Moreover, the wizard provides clearer information about the impact of the
uninstallation: what apps/modules will be uninstalled and what documents
(models) will be lost.
2017-06-28 15:36:17 +02:00
Deep Patel b6660433c6 [IMP] mail : Display Log instead of Send in full mail composer
Purpose
=======

Improve label in full mail composer.

Specification
=============

In full mail composer if it's log than send button string should be "Log".
2017-05-19 15:50:00 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +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