I'm kinda new to Odoo (working on Odoo 8), I made a wizard that has a one2many field, referring to another Transient Model
I added a button inside the tree view that's supposed to display details of the line (each line has its button)
when i get the details for a line at the first time i do get the data i passed on the context, however the data doesn't update when i click details for another line, it displays the context i passed at first
any way i can fix this please ?
The first time Odoo calls the button, the action context is a list holding the button context attribute as a string:
The next time it is called (without refreshing the page), the context is evaluated as a compound context and the evaluation context is wrong because it uses the values of the first record and this is why the default values did not change.
If you alter the evaluation context in the handle_button, Odoo should load the correct default values
Example:
Solution
Instead of using the button context to set the default values, you can use directly the action context
Example: