Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

check a lead type is 'lead' or 'opportunity' and display to leads wall

By
Jothimani
on 5/26/14, 2:10 AM 766 views

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/26/14, 2:10 AM
Seen: 766 times
Last updated: 3/16/15, 8:10 AM