Odoo Help


every context value of buttons in tree lines are same

on 2/3/16, 5:32 AM 372 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">


          <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}"/>  



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?

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 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.


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)


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