Hello,
I want to make a new column after product_id here in sale.order (see screenshot)
http://diezcode.ch/spalte-einsetzten.PNG
I have made a module with a new field(char) for product. But I want it in the column in sale.order ,
Ok I found a way like this:
With this way you can add a column in the sale.order.line and then you can edit it with no problems:
<record model="ir.ui.view" id="sale_margin_percent_1">
<field name="name">sale.margin.percent.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']/form//field[@name='product_id']" position="before">
<field name="new_field"/>
</xpath>
</field> </record>
<record model="ir.ui.view" id="sale_margin_percent_2">
<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='product_id']" position="before">
<field name="new_field"/>
</xpath>
</field>
</record>