Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6570 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.



Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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..

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
4407
0
thg 3 15
3460
0
thg 4 25
798
2
thg 1 24
2097
Database Odoo Đã xử lý
1
thg 3 18
3512