diff options
| author | Dharmraj Jhala <dja@odoo.com> | 2020-07-15 10:42:44 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-08-24 06:57:33 +0000 |
| commit | 08c0dc929da38595e29a9d1db93065547cd98ad1 (patch) | |
| tree | a2fa1dd3435e1136f30d2a17db6b4ab1ca44a41f /addons/account/wizard | |
| parent | 47f5e14eca4e13010cc11f688ea92f65a2695d38 (diff) | |
[IMP] account, purchase, sale: allow sending email to self
Currently, if users try to send invoices / quotations / purchase orders to
themselves in order to look at final result, they can't do so because our
default chatter protection prevents sending mails to authors themselves.
This commit uses 'mail_notify_author' context key and allows users to send
mails from the header buttons available on SO / PO / invoices to themselves
if they are in recipients.
This commit targets only those buttons as this is the main case where we
want to allow people to send emails to themselves. In order to avoid
side effects no other use case is supported.
Task ID-2294130
closes odoo/odoo#55809
X-original-commit: 09918f320ba712b0bd90a6852825fad864655b04
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/account/wizard')
| -rw-r--r-- | addons/account/wizard/account_invoice_send.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/wizard/account_invoice_send.py b/addons/account/wizard/account_invoice_send.py index 3529e2a9fe7..daf1ae3cfe0 100644 --- a/addons/account/wizard/account_invoice_send.py +++ b/addons/account/wizard/account_invoice_send.py @@ -86,7 +86,7 @@ class AccountInvoiceSend(models.TransientModel): def _send_email(self): if self.is_email: # with_context : we don't want to reimport the file we just exported. - self.composer_id.with_context(no_new_invoice=True).send_mail() + self.composer_id.with_context(no_new_invoice=True, mail_notify_author=self.env.user.partner_id in self.composer_id.partner_ids).send_mail() if self.env.context.get('mark_invoice_as_sent'): #Salesman send posted invoice, without the right to write #but they should have the right to change this flag |
