summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2015-01-12 15:46:52 +0100
committerDamien Bouvy <dbo@odoo.com>2015-01-13 10:36:47 +0100
commit573cc737ddf385dc7dd4b386e4a9fe74e00570ed (patch)
tree0d1082bfcfeed35f5b4f194a49865fd19496a62f /addons
parentdf2ddd895192a142aff3b0160764824b2ea6dffd (diff)
[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.
Diffstat (limited to 'addons')
-rw-r--r--addons/mail/wizard/mail_compose_message.py4
-rw-r--r--addons/mail/wizard/mail_compose_message_view.xml2
2 files changed, 5 insertions, 1 deletions
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 @@
<field name="body"/>
<field name="attachment_ids" widget="many2many_binary" string="Attach a file"/>
<footer>
- <button string="Send" name="send_mail" type="object" class="oe_highlight"/>
+ <button string="Send" name="send_mail_action" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />