Odoo Help


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.


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

on 11/1/13, 1:09 PM 426 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>

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

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)


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