コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3992 ビュー

To add a new field to a form in XML you just type:

    <record model="ir.ui.view" id="sale_margin_percent_3">
<field name="name">sale.order.line.tree.margin.view.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree//field[@name='price_unit']" position="after">
<field name="sale_margin_percent" groups="base.group_user"/>
</xpath>
</field>
</record>

which would add "sale_margin_percent" field after "price_unit" in "order_line".

So far, so good.

However, what would you need to add to specify that the new field has a given "on_change" attribute?


アバター
破棄
最善の回答

Try this:

<field name="sale_margin_percent" on_change="here_your_method(...)" groups="base.group_user"/> 
アバター
破棄
著作者

So simple, thanks!

関連投稿 返信 ビュー 活動
2
3月 17
7671
2
7月 15
6046
1
7月 15
6966
2
7月 15
5368
1
1月 23
2565