[FIX] account: missing parameter in send_mail
d88c34d1 added an auto_commit parameter to send_email of
mail.compose.message but apparently missed updating at least one
override.
Fix that oversight.
This commit is contained in:
@@ -1275,12 +1275,12 @@ class MailComposeMessage(models.Model):
|
||||
_inherit = 'mail.compose.message'
|
||||
|
||||
@api.multi
|
||||
def send_mail(self):
|
||||
def send_mail(self, auto_commit=False):
|
||||
context = self._context
|
||||
if context.get('default_model') == 'account.invoice' and \
|
||||
context.get('default_res_id') and context.get('mark_invoice_as_sent'):
|
||||
invoice = self.env['account.invoice'].browse(context['default_res_id'])
|
||||
invoice = invoice.with_context(mail_post_autofollow=True)
|
||||
invoice.write({'sent': True})
|
||||
invoice.sent = True
|
||||
invoice.message_post(body=_("Invoice sent"))
|
||||
return super(MailComposeMessage, self).send_mail()
|
||||
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
|
||||
|
||||
Reference in New Issue
Block a user