This question has been flagged
2 Replies
5057 Views

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

Avatar
Discard
Best Answer

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.



Avatar
Discard
Author Best Answer

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

Avatar
Discard