[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.

This commit is contained in:
Damien Bouvy
2015-01-13 10:36:47 +01:00
parent df2ddd8951
commit 573cc737dd
2 changed files with 5 additions and 1 deletions
@@ -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
@@ -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" />