Odoo Help

0

every context value of buttons in tree lines are same

By
jianxin
on 2/3/16, 5:32 AM 419 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?

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

1 follower(s)

Stats

Asked: 2/3/16, 5:32 AM
Seen: 419 times
Last updated: 2/3/16, 6:03 AM