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?