how to get current value of a record line in a XML tree view
Hi everyone , thank you very much for your help and support . I have started my first module with odoo 11 but i am facing a problem. Please forgive my poor level in english , i am doing my best.So, here is my problem: I have created two models : let 's say model 1 and model 2.In the xml tree view of model 1 , for each record line i added a button "pay now" . what i want is that when i click on the "pay now" button (on model1 tree view) it opens a form of model 2 (in a popup window) with the defaults values filled by some informations providing by model 1 's line selected on tree view.
here is my tree view ....
let s take these fields names as examples:
field1 | field2 | field3 | field4 | field5
the button code for the tree view is
<button name="%(custom_action_id)d" string="Pay now" class="oe_highlight" type="action"/>
the action code called by the button is
<record id="custom_action_id" model="ir.actions.act_window">
<field name="name">list examples</field>
what i want is that if i click on pay now the model2 form opens ,having by default the fields filled by values of the line selected on tree view.
here is an example of the form called:
remark: field6's value should be equal to field2 's value and field5's value should be equal to field1's value . Field5 's type is Many2one while field1's type (which will provide field5's value) is a char type.
Once again thank you to anyone who will take the time to read my post.