콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4067 화면

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

아바타
취소

(Please post your question only once. I had to delete 4 other versions of this question)

작성자

(Hey i am really sorry, i got 404 error on posting, so just clicked on page refresh. extremely sorry about it)