I'm trying to create a hierarchy for custom sales quotation views. I have two types of quotations; spot and tariff. They cannot be defined in the same sale.order model without violating several best practices (DRY, NF, etc.). That's why I have created an abstract class that inherits from sale.order and adds common fields and functions for both of the quotations types. The quotations then inherit sale.order (with the additional fields and functions) and redefine the model name, sale.spot and sale.tariff respectively.
The model inheritance seems to be working just as I expected, but I'm having great difficulties inheriting the views. I created a form view view_order_form_general that changes some fields in the original sale.order form view (sale.view_order_form) and my spot & tariff form views inherit from view_order_form_general. When I load the form view, there are zero modifications. If I make the spot view inherit directly from sale.view_order_form, then the modifications are applied. But only the spot modifications. Not the general ones.
Is there something that prevents multi-level inheritance or is there something else that I'm missing here?
I tried to add a drawing here to further explain the inheritance, but apparently you need 30 karma for that..
sale_general.xml (omitted openerp and data tags):
<!-- General form view -->
<record id="view_order_form_general" model="ir.ui.view">
<field name="name">sale.order.form.general</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
... general modifications ...
</data>
</field>
</record>
sale_spot.xml (omitted openerp and data tags):
<!-- Spot form view -->
<record id="view_order_form_spot" model="ir.ui.view">
<field name="name">sale.order.form.spot</field>
<field name="model">sale.spot</field>
<field name="inherit_id" ref="view_order_form_general"/>
<field name="arch" type="xml">
<data>
... spot quotation specific modifications ...
</data>
</field>
</record><!-- Action for displaying spot view -->
<record id="action_spot_quotations" model="ir.actions.act_window">
<field name="name">Spot quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.spot</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="search_view_id" ref="sale.view_sales_order_filter"/>
<field name="context">{}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a spot quotation.
</p>
</field>
</record><!-- Which form to show for a spot quotation -->
<record id="action_spot_quotations_form" model="ir.actions.act_window.view">
<field name="view_mode">form</field>
<field name="view_id" ref="view_order_form_spot" />
<field name="act_window_id" ref="action_spot_quotations" />
</record>