Skip to Content
Menu
This question has been flagged
2222 Views

  I added buttons in tree view lines and set a context for these buttons. The view definition is as below. 

   <field name="arch" type="xml">

      <tree>

          <field name="name" />

          <field name="user_id" invisible="1"/>

          <field name="partner_id" invisible="1"/> 

          <button name="do_apply_rfd" string="apply" type="object" context="{'ctx_partner_id': partner_id}"/>  

    </tree>

  </field>


after I applied this and click these buttons. I observed  the context value in function do_apply_rfd and I found value of ctx_partner_id are same for different buttons. The value is the relevant partner_id of the button which I clicked first. That means ctx_partner_id is never changed after i clicked the first button.

Is this normal? what's the root cause?

If this is normal, how to pass context to the function?

Avatar
Discard
Related Posts Replies Views Activity
0
Apr 24
397
4
Nov 23
4244
0
Oct 23
377
0
Dec 22
1334
2
Dec 23
17348