<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="mrp_unbuild_form_view" model="ir.ui.view">
        <field name="name">mrp.unbuild.form</field>
        <field name="model">mrp.unbuild</field>
        <field name="inherit_id" ref="mrp.mrp_unbuild_form_view" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='location_dest_id']" position="before">
                <field
                    name="restore_rm_stock_in_origin_loc"
                    attrs="{'invisible': [('mo_id', '=', False)]}"
                />
            </xpath>
            <xpath expr="//field[@name='location_dest_id']" position="attributes">
                <attribute
                    name="attrs"
                >{'invisible': [('restore_rm_stock_in_origin_loc', '=', True)]}</attribute>
            </xpath>
        </field>
    </record>
    <record id="mrp_unbuild_form_view_simplified" model="ir.ui.view">
        <field name="name">mrp.unbuild.simplified.form</field>
        <field name="model">mrp.unbuild</field>
        <field name="inherit_id" ref="mrp.mrp_unbuild_form_view_simplified" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='location_dest_id']" position="before">
                <field
                    name="restore_rm_stock_in_origin_loc"
                    attrs="{'invisible': [('mo_id', '=', False)]}"
                />
            </xpath>
            <xpath expr="//field[@name='location_dest_id']" position="attributes">
                <attribute
                    name="attrs"
                >{'invisible': [('restore_rm_stock_in_origin_loc', '=', True)]}</attribute>
            </xpath>
        </field>
    </record>
</odoo>
