action_type字段的父级
<group>
<field name="action_type"/>
</group>
这是我的代码on_change无法正常工作而不会覆盖
<record id="hr_custom_action_form" model="ir.ui.view">
<field name="name">hr.infraction.action.wizard.form</field>
<field name="model">hr.infraction.action.wizard</field>
<field name="inherit_id" ref="hr_infraction.hr_infraction_action_wizard_form"/>
<field name="arch" type="xml">
<xpath expr="/form/group/group/field[@name='action_type']">
<field name="action_type" on_change="take_action(context)"/>
</xpath>
<xpath expr="/form/group[2]" position="after">
<group string="Discount Days" attrs="{'invisible': [('action_type','!=','discount_days')]}">
<group>
<field name="penalty_days_value"/>
</group>
<group></group>
</group>
</xpath>
</field>
</record>
答案 0 :(得分:1)
尝试这个,
<field name="action_type" position="attributes">
<attribute name="on_change">take_action(context)</attribute>
</field>