跳至內容
選單
此問題已被標幟
2 回覆
6687 瀏覽次數

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
4540
0
3月 15
3530
0
4月 25
935
2
1月 24
2191
Database Odoo 已解決
1
3月 18
3664