<odoo>
    <record id="view_purchase_order_inherit" model="ir.ui.view">
        <field name="name">Purchase Order Inherit Dropship Subcontractor</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_form"/>
        <field name="arch" type="xml">
            <field name="dest_address_id" position="before">
                <field name="default_location_dest_id_is_subcontracting_loc" invisible="1"/>
            </field>
            <field name="dest_address_id" position="attributes">
                <attribute name="invisible">default_location_dest_id_usage != 'customer' and not default_location_dest_id_is_subcontracting_loc</attribute>
                <attribute name="required">default_location_dest_id_usage == 'customer' or default_location_dest_id_is_subcontracting_loc</attribute>
            </field>
        </field>
    </record>
</odoo>
