【发布时间】:2020-10-13 05:07:03
【问题描述】:
我在下面有这个字段
name = fields.Text("Input text here")
我想在单击按钮时将其值传递给向导。代码如下:
@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}
}
这是我的 XML。但它仍然没有像我预期的那样工作。
对于按钮:
<button name="open_wizard" string="Submit" type="object" class="oe_highlight" context="
{'name': name}"/>
对于向导本身。我希望该值位于“Resi”字段中:
<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>
你有什么解决办法吗?谢谢
【问题讨论】: