<odoo>
    <record id="mrp_bom_form_view" model="ir.ui.view">
        <field name="name">mrp.bom.form</field>
        <field name="model">mrp.bom</field>
        <field name="inherit_id" ref="mrp.mrp_bom_form_view" />
        <field name="arch" type="xml">
            <field name="consumption" position="after">
                <field
                    name="allow_in_regular_production"
                    attrs="{'invisible': [('type','!=','subcontract')]}"
                />
            </field>
            <page name="operations" position="attributes">
                <attribute
                    name="attrs"
                >{'invisible': [('type', '=', 'subcontract'),('allow_in_regular_production','=',False)]}</attribute>
            </page>
            <field name="operation_ids" position="attributes">
                <attribute
                    name="attrs"
                >{'invisible': [('type', '=', 'subcontract'),('allow_in_regular_production','=',False)]}</attribute>
            </field>
        </field>
    </record>
</odoo>
