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

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

By
Jessie
on 9/30/13, 12:38 AM 2,131 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.

0
Jessie
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
0

Ray Carnes

--Ray Carnes--
15687
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

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. 

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.

0

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),        
    }
 crm_phonecall()

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"/>
              </xpath> 

          </field>
    </record>

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,
            'contact_name':lead.contact_name
        }
        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),
  }
 crm_lead()

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.

Jessie
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

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

0 follower(s)

Stats

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