[REM] crm: removed new_email_send, now unused and deprecated with chatter / templates.
authorThibault Delavallée <tde@openerp.com>
Fri, 26 Jul 2013 09:13:05 +0000 (11:13 +0200)
committerThibault Delavallée <tde@openerp.com>
Fri, 26 Jul 2013 09:13:05 +0000 (11:13 +0200)
bzr revid: tde@openerp.com-20130726091305-8lsmidcxyau3shw0

addons/crm/crm_lead.py

index 46a3f6e..c0f003f 100644 (file)
@@ -945,42 +945,6 @@ class crm_lead(format_address, osv.osv):
             vals.update(onchange_stage_values)
         return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
 
-    def new_mail_send(self, cr, uid, ids, context=None):
-        '''
-        This function opens a window to compose an email, with the edi sale template message loaded by default
-        '''
-        assert len(ids) == 1, 'This option should only be used for a single id at a time.'
-        ir_model_data = self.pool.get('ir.model.data')
-        try:
-            template_id = ir_model_data.get_object_reference(cr, uid, 'crm', 'email_template_opportunity_mail')[1]
-        except ValueError:
-            template_id = False
-        try:
-            compose_form_id = ir_model_data.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
-        except ValueError:
-            compose_form_id = False
-        if context is None:
-            context = {}
-        ctx = context.copy()
-        ctx.update({
-            'default_model': 'crm.lead',
-            'default_res_id': ids[0],
-            'default_use_template': bool(template_id),
-            'default_template_id': template_id,
-            'default_composition_mode': 'comment',
-        })
-        return {
-            'name': _('Compose Email'),
-            'type': 'ir.actions.act_window',
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_model': 'mail.compose.message',
-            'views': [(compose_form_id, 'form')],
-            'view_id': compose_form_id,
-            'target': 'new',
-            'context': ctx,
-        }
-
     # ----------------------------------------
     # Mail Gateway
     # ----------------------------------------