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

I'm writing a modul, now I can add a field like this:

<record id="sale_order_form_ext_view" model="ir.ui.view">

<field name="name">sale.order.form.ext</field>

<field name="model">sale.order</field>

<field name="type">form</field>

<field name="inherit_id" ref="sale.view_order_form" />

<field name="arch" type="xml">

<xpath expr="//field[@name='carrier_id']" position="before">

<field string="Liefertermin" name="delivery_date" placeholder="Liefertermin"/>

<field string="Lieferung" name="delivery" placeholder="Lieferung" />

</xpath>

</field>

</record>

 


But when I want to put it under the order_policy, it doesn't work : 

<record id="sale_order_form_ext_view" model="ir.ui.view">

<field name="name">sale.order.form.ext</field>

<field name="model">sale.order</field>

<field name="type">form</field>

<field name="inherit_id" ref="sale.view_order_form" />

<field name="arch" type="xml">

<xpath expr="//field[@name='order_policy']" position="before">

<field string="Liefertermin" name="delivery_date" placeholder="Liefertermin"/>

<field string="Lieferung" name="delivery" placeholder="Lieferung" />

</xpath>

</field>

</record>

 


Why is that so difficult? The field order_policy is at "other information" but on the same sale_order

アバター
破棄
最善の回答

Field carrier_id is added by the module delivery - view: delivery.sale.order_withcarrier.form.view (inherit sale.view_order_form)

Field order_policy is added by the module sale_stock - view: sale.order.form.sale.stock (inherit sale.view_order_form)

If your module does not depend on the module sale_stock you get the problem. Verify __openerp__.py and depends in  your module.



アバター
破棄
著作者 最善の回答

Ok I found the solution, I was all time in inherid_id: 

<field name="inherit_id" ref="sale.view_order_form" />

But I need to take the real inherid_path of the field like this:


<field name="inherit_id" ref="sale_stock.view_order_form_inherit" />


So thanks for your help..

アバター
破棄
関連投稿 返信 ビュー 活動
2
3月 15
4404
0
3月 15
3456
0
4月 25
788
2
1月 24
2085
Database Odoo 解決済
1
3月 18
3507