Odoo Help

Welcome!

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.

0

every context value of buttons in tree lines are same

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

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

1 follower(s)

Stats

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