I have this field below
name = fields.Text("Input text here")
And I want to pass its value to the wizard when I click a button. Here's the code:
@api.multi
def open_wizard(self):
return {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'customer.wizard',
'target': 'new',
'type': 'ir.actions.act_window',
'context': {'current_id': self.id}
}
And here is my XML. But it still didn't work as I expected.
For the button:
<button name="open_wizard" string="Submit" type="object" class="oe_highlight" context="
{'name': name}"/>
For the wizard itself. I want the value to be on the 'Resi' field:
<record id="view_test_report_wizard" model="ir.ui.view">
<field name="name">Customer Wizard</field>
<field name="model">customer.wizard</field>
<field name="arch" type="xml">
<form string="Choose The Details">
<group>
<tree>
<group>
<field string="Resi" name="name" context="{'name' : name}"/>
<field name="tanggal"/>
<field name="kotaasal"/>
<field name="kotatujuan"/>
<field name="id_customer"/>
</group>
</tree>
</group>
<footer>
<button string="Back" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
Do you have any solution? Thank you