<?xml version="1.0"?>
<form string="Scrap">
                    <header>
                        <button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight" context="{'not_unlink_on_discard': True}" data-hotkey="v"/>
                        <field name="state" widget="statusbar" statusbar_visible="draft,done"/>
                    </header>
                    <sheet>
                        <div class="oe_button_box" name="button_box">
                            <button class="oe_stat_button" name="action_get_stock_picking" string="Stock Operation" type="object" attrs="{'invisible':[('picking_id','=',False)]}" icon="fa-cogs"/>
                            <field name="picking_id" invisible="1"/>
                            <button class="oe_stat_button" name="action_get_stock_move_lines" string="Product Moves" type="object" attrs="{'invisible':[('move_id','=',False)]}" icon="fa-exchange"/>
                            <field name="move_id" invisible="1"/>
                        </div>
                        <div class="oe_title">
                            <h1><field name="name" nolabel="1"/></h1>
                        </div>
                        <group>
                            <group>
                                <field name="product_id" context="{'default_detailed_type': 'product'}"/>
                                <label for="scrap_qty"/>
                                <div class="o_row">
                                    <field name="scrap_qty"/>
                                    <field name="product_uom_category_id" invisible="1"/>
                                    <field name="product_uom_id" groups="uom.group_uom" force_save="1"/>
                                </div>
                            </group>
                            <group>
                                <field name="company_id" invisible="1"/>
                                <field name="lot_id" context="{'default_product_id': product_id, 'default_company_id': company_id}" attrs="{'invisible': ['|',('product_id', '=', False),('tracking', '=', 'none')], 'required': [('tracking', '!=', 'none')]}" groups="stock.group_production_lot"/>
                                <field name="tracking" invisible="1"/>
                                <field name="package_id" groups="stock.group_tracking_lot"/>
                                <field name="owner_id" groups="stock.group_tracking_owner"/>
                                <field name="location_id" options="{'no_create': True, 'no_open': True}" groups="stock.group_stock_multi_locations" force_save="1"/>
                                <field name="scrap_location_id" options="{'no_create': True, 'no_open': True}" groups="stock.group_stock_multi_locations" force_save="1"/>
                                <field name="origin"/>
                                <field name="date_done" attrs="{'invisible': [('state', '=', 'draft')]}"/>
                                <field name="picking_id" attrs="{'invisible': [('picking_id', '=', False)]}"/>
                                <field name="company_id" groups="base.group_multi_company"/>
                            </group>
                        </group>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids"/>
                        <field name="message_ids"/>
                    </div>
                </form>
            