[IMP] email_template: use button name as action name
authorOlivier Dony <odo@openerp.com>
Wed, 25 Jan 2012 17:42:49 +0000 (18:42 +0100)
committerOlivier Dony <odo@openerp.com>
Wed, 25 Jan 2012 17:42:49 +0000 (18:42 +0100)
The action name is what gets displayed in the sidebar
and there is no reason to have a different name for
the action and button anyway.

lp bug: https://launchpad.net/bugs/886144 fixed

bzr revid: odo@openerp.com-20120125174249-wxor3br5xbqtluld

addons/email_template/email_template.py

index fe4155c..35803c2 100644 (file)
@@ -180,8 +180,9 @@ class email_template(osv.osv):
             src_obj = template.model_id.model
             model_data_id = data_obj._get_id(cr, uid, 'mail', 'email_compose_message_wizard_form')
             res_id = data_obj.browse(cr, uid, model_data_id, context=context).res_id
+            button_name = _('Send Mail (%s)') % template.name
             vals['ref_ir_act_window'] = action_obj.create(cr, uid, {
-                 'name': template.name,
+                 'name': button_name,
                  'type': 'ir.actions.act_window',
                  'res_model': 'mail.compose.message',
                  'src_model': src_obj,
@@ -193,7 +194,7 @@ class email_template(osv.osv):
                  'auto_refresh':1
             }, context)
             vals['ref_ir_value'] = self.pool.get('ir.values').create(cr, uid, {
-                 'name': _('Send Mail (%s)') % template.name,
+                 'name': button_name,
                  'model': src_obj,
                  'key2': 'client_action_multi',
                  'value': "ir.actions.act_window," + str(vals['ref_ir_act_window']),