sale.order.form.inherit" /> sale.order.form.inherit" /> sale.order.form.inherit"/>

odoo 8 inherit from inherit view

52 Views Asked by At

I have this odoo xml under the folder sale_order_dates:

<record id="view_sale_orderfor" model="ir.ui.view">
        <field name="name">sale.order.form.inherit5</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <group name="sale_pay" position="after">
                <group colspan="2" col="2" >
                    <separator string="Dates" colspan="2"/>
                    <field name="requested_date" on_change="onchange_requested_date(requested_date, commitment_date)" required="1"/>
                    <field name="commitment_date"/>
                    <field name="effective_date"/>
                </group>
            </group>
        </field>
    </record>

and I want to add 1 field qty1 under requested_date. I have tried this but got error.

<record id ="sale_order_form_ext_view2" model="ir.ui.view">
        <field name ="name">sale.order.form.ext.view2</field>
        <field name ="model">sale.order</field>
        <field name ="inherit_id" ref ="sale_order_dates.view_sale_orderfor"/>
        <field name ="arch" type ="xml">
            <data>
                <xpath expr ="//field[@name='requested_date']" position ="after">
                    <field name ="qty1" />
                </xpath>
            </data>
        </field>
    </record>

What should I do?

1

There are 1 best solutions below

0
Kenly On

The error happens when you try to update a module that depends on another module but is not specified under the depends entry in the manifest file

You did get that error because the sale_order_dates was already installed when you installed your custom module otherwise you should get the following error:

External ID not found in the system: sale_order_dates.view_sale_orderfor

To fix that error add the sale_order_dates to the module depends and restart Odoo