Odoo Help

0

"TypeError: val is null" on overriding button context params

By
vivek
on 11/1/13, 1:09 PM 580 views

I need to make a many2many relationship between leads and customers. I successfully did that and also I would like to add additional params to context for button "Meetings" only when called from Lead.

My Code is below

<record model="ir.ui.view" id="view_partner_form_custom">
    <field name="name">res.partner.form</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_partner_form" />
    <field name="arch" type="xml">
<xpath expr="//button[@string='Meetings']" position="attributes">
      <attribute name="context">{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id], 'search_default_lead_id': context.get('lead_id'), 'default_lead_id': context.get('lead_id')}</attribute>
</xpath>
</field>
</record>

The above code works fine and when clicking on meeting button in lead -> customer form -> meetings button but not working fine when clicking on customer form -> Meetings button

And i get the below error

TypeError: val is null

I could see that the below lines are problematic

'search_default_lead_id': context.get('lead_id'), 'default_lead_id': context.get('lead_id')

But the default search from lead for meetings should be based on that particular lead and customer id. Kindly clarify. Also feel free to update the post for better clarity. Thanks

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.

Register

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)

Stats

Asked: 11/1/13, 1:09 PM
Seen: 580 times
Last updated: 3/16/15, 8:10 AM