Odoo Help


Urgent: How to display Contact Name in Schedule Calls???

on 9/30/13, 12:38 AM 2,965 views

Hi all,

I need to display the contact name from lead and display it in Schedule Calls. May I know how to do it?

Many thanks.


Ray Carnes

--Ray Carnes--
| 9 7 9
Keyport, United States
--Ray Carnes--

Senior ERP Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0 and 11.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 9/30/13, 1:57 AM

A lead in OpenERP is a source of information that someone in your company needs to qualify before deciding if anyone should spend time and energy following up.

It could be a name from a list you bought, a business card from a tradeshow, an incoming email to your website, an email from a registration page, a message that a caller left, etc.

The out of the box workflow (ie: without customization) that the software supports is to convert a lead into an opportunity if call needs to be scheduled - then the contact information (person & company) will show up as you expect.

I understand what you want to do, and it is certainly is possible with customization, but this is my advice - convert the lead into an opportunity if you think it is worth a scheduled call.

Leave it a lead until someone spends time deciding if it is worth anyone's time following up. If you know enough to know when a return call should be scheduled (if someone has asked you to call back), you probably know enough to justify converting it into an opportunity.

On 9/30/13, 5:28 AM

Hi lhadiesleo,

Thanks for your help.

I open crm_phonecall.py and edit it as below (follow your screen shot no 1) but I got this error. "TypeError: The model "crm.phonecall" specifies an unexisting parent class "crm.phonecall". You may need to add a dependency on the parent class' module." I am newbie in python language. May I know how to solve this problem? Many thanks.

class crm_phonecall(base_state, osv.osv): """ Model for CRM phonecalls """ _name = "crm.phonecall" _description = "Phonecall" _order = "id desc" _inherit = ['mail.thread','crm.phonecall'] _columns = { # base_state required fields 'contact_name': fields.char('Contact Name', size=64), 'date_action_last': fields.datetime('Last Action', readonly=1), ...

just copy and paste my code.. i know it will work fine.. :D

Lady Sharmane Udtuhan
on 10/3/13, 4:57 AM

Your right, i understood it.. Hmm by the way try to do this.. in your .py inherit the crm.phonecall class and put the field contact name

class crm_phonecall(osv.osv): 
_inherit = "crm.phonecall"
_columns = {
   'contact_name': fields.char('Contact Name', size=64),        

and in your .xml add the contact_name field

   <record id="call_contact_name" model="ir.ui.view">
        <field name="name">call.contact.name</field>
        <field name="model">crm.phonecall</field>
        <field name="type">form</field>
        <field name="priority">10</field>
        <field name="inherit_id" ref="crm.crm_case_phone_form_view"/>
          <field name="arch" type="xml">

               <xpath expr ="//field[@name='date']" position="before">
                    <field name="contact_name"/>


Inherit the crm.lead class and get its "schedule_phonecall" method which is responsible 4 transferring tha data from lead to schedule calls.. Add the contact_name inside the "VALS"

class crm_lead(osv.osv): 
_inherit = "crm.lead"
def schedule_phonecall(self, cr, uid, ids, schedule_time, call_summary, desc, phone, contact_name, user_id=False, section_id=False, categ_id=False, action='schedule', context=None):
    :param string action: ('schedule','Schedule a call'), ('log','Log a call')
    phonecall = self.pool.get('crm.phonecall')
    model_data = self.pool.get('ir.model.data')
    phonecall_dict = {}
    if not categ_id:
        res_id = model_data._get_id(cr, uid, 'crm', 'categ_phone2')
        if res_id:
            categ_id = model_data.browse(cr, uid, res_id, context=context).res_id
    for lead in self.browse(cr, uid, ids, context=context):
        if not section_id:
            section_id = lead.section_id and lead.section_id.id or False
        if not user_id:
            user_id = lead.user_id and lead.user_id.id or False
        vals = {
            'name': call_summary,
            'opportunity_id': lead.id,
            'user_id': user_id or False,
            'categ_id': categ_id or False,
            'description': desc or '',
            'date': schedule_time,
            'section_id': section_id or False,
            'partner_id': lead.partner_id and lead.partner_id.id or False,
            'partner_phone': phone or lead.phone or (lead.partner_id and lead.partner_id.phone or False),
            'partner_mobile': lead.partner_id and lead.partner_id.mobile or False,
            'priority': lead.priority,
        new_id = phonecall.create(cr, uid, vals, context=context)
        phonecall.case_open(cr, uid, [new_id], context=context)
        if action == 'log':
            phonecall.case_close(cr, uid, [new_id], context=context)
        phonecall_dict[lead.id] = new_id
        self.schedule_phonecall_send_note(cr, uid, [lead.id], new_id, action, context=context)
    return phonecall_dict

_columns = {
   'contact_name': fields.char('Contact Name', size=64),

Although the contact_name will not appear in this window

image description

but in your schedule log calls menu.. it will appear, if you put contact_name in your lead form

image description

Hi lhadiesleo, I think you misunderstanding what I need to modify it. For example, I put the name "Jessie" as Contact Name in Lead Form (your screen shot no 1) and I need the Contact Name "Jessie" display in Schedule Calls List, there don't have a field name to display the contact name. May I know how to do it, need to add on a new field name? Many thanks.

on 9/30/13, 2:29 AM

hope that will help you :D i've already tested it. and it works fine to me :D

Lady Sharmane Udtuhan
on 9/30/13, 4:11 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/30/13, 12:38 AM
Seen: 2965 times
Last updated: 3/16/15, 8:10 AM