From 573cc737ddf385dc7dd4b386e4a9fe74e00570ed Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Mon, 12 Jan 2015 15:46:52 +0100 Subject: [PATCH] [FIX] mail: action buttons passed arguments positionnally, which caused the context to be passed as another argument. An intermediary function screens the arguments before calling send_mail. --- addons/mail/wizard/mail_compose_message.py | 4 ++++ addons/mail/wizard/mail_compose_message_view.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 712ffb5b2c4..49eaa599888 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -227,6 +227,10 @@ class mail_compose_message(osv.TransientModel): #------------------------------------------------------ # Wizard validation and send #------------------------------------------------------ + # action buttons call with positionnal arguments only, so we need an intermediary function + # to ensure the context is passed correctly + def send_mail_action(self, cr, uid, ids, context=None): + self.send_mail(cr, uid, ids, context=context) def send_mail(self, cr, uid, ids, auto_commit=False, context=None): """ Process the wizard content and proceed with sending the related diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index b217839bacf..58baf8dd029 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -61,7 +61,7 @@