[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:
@@ -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" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user