This question has been flagged

Hello everyone,

here i want to check a lead type is 'lead' or 'opportunity',

and lead type is "lead" means, show a notificaton like "This lead converted to opportunity not yet" to relevent lead wall....

Here i tried this code in mail_message.py in mail module,

    def check_lead_type(self, cr, uid, ids, context=None):
        for lead_check in self.pool.get('crm.lead').browse(cr, uid, ids, context=context):

            name=lead_check.name
            lead_id=lead_check.id
            lead_type=lead_check.type

            if lead_type=='lead':

                values = {
                   'res_id':lead_id,
                    'body': "<div><p>This Lead is not converted to opportunity yet....</p></div>",
                   'record_name': name,
                   'model':'crm.lead',
                   'type':'notification',
                }
        return {'value' : values}

 

Please anyone help me to correct code for this,

Thanks in advance

Avatar
Discard