I have created a model and a view that inherits the sale.order view and adds som custom field to it. I do not want to modify the original sale order view.
This code will (almost) do what I need:
<record id="work_order_form" model="ir.ui.view">
<field name="name">Workorder Form View</field>
<field name="model">sale.order</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="sale.view_order_form"/>
<!--<field name="mode">primary</field> -->
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="custom_field_1"/>
<field name="custom_field_2"/>
</xpath>
</field>
</record>
Now within my model it will open the work order view and display my custom fields.Good!
Going back to the sales model you have two options 1. Quotation and 2. Order.
When I open a Sales order it has not changed the original sale.order.form view. Good!
But, still within the sale model if you open or create a new quotation though, it will also add my custom fields.
Within developer mode I can see that somehow my model has chaged the original quotation view (sale.view_order_form) into my view (work_order_form).
Somehow the quotation view (usually the same view as sale.order) has changed to the workorder view
A Sale Order (choose Order from Menu) is not affected.
I played around with the priority (changed it to higher or lower priorities) but that didn't really get a better result.
Can someone help and explain this strange behavior? Thanks