<form string="Scrap">
                    <header>
                        <button name="action_validate" invisible="state != '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" invisible="not picking_id" icon="fa-cogs"/>
                            <field name="picking_id" invisible="1" readonly="state == 'done'"/>
                            <button class="oe_stat_button" name="action_get_stock_move_lines" type="object" invisible="not move_ids" icon="fa-exchange">
                                    <div class="o_stat_info">
                                        <span class="o_stat_text">Product Moves</span>
                                    </div>
                            </button>
                            <field name="move_ids" invisible="1"/>
                        </div>
                        <div class="oe_title">
                            <h1><field name="name" nolabel="1"/></h1>
                        </div>
                        <group>
                            <group>
                                <field name="product_id" context="{'default_is_storable': True}" readonly="state == 'done'"/>
                                <field name="tracking" invisible="1"/>
                                <label for="scrap_qty"/>
                                <div class="o_row">
                                    <field name="scrap_qty" readonly="state == 'done' or tracking == 'serial'"/>
                                    <field name="product_uom_category_id" invisible="1"/>
                                    <field name="product_uom_id" readonly="state == 'done' or tracking == 'serial'" groups="uom.group_uom" force_save="1"/>
                                </div>
                                <field name="lot_id" context="{'default_product_id': product_id}" invisible="not product_id or tracking == 'none'" readonly="state == 'done'" required="tracking != 'none'" groups="stock.group_production_lot"/>
                                <field name="should_replenish" readonly="state == 'done'"/>
                                <field name="scrap_reason_tag_ids" widget="many2many_tags" options="{'no_create_edit': True}"/>
                            </group>
                            <group>
                                <field name="company_id" invisible="1" readonly="state == 'done'"/>
                                <field name="package_id" groups="stock.group_tracking_lot" readonly="state == 'done'"/>
                                <field name="owner_id" groups="stock.group_tracking_owner" readonly="state == 'done'"/>
                                <field name="location_id" options="{'no_create': True, 'no_open': True}" groups="stock.group_stock_multi_locations" force_save="1" readonly="state == 'done'"/>
                                <field name="scrap_location_id" options="{'no_create': True, 'no_open': True}" groups="stock.group_stock_multi_locations" force_save="1" readonly="state == 'done'"/>
                                <field name="origin"/>
                                <field name="date_done" invisible="state == 'draft'"/>
                                <field name="picking_id" invisible="not picking_id" readonly="state == 'done'"/>
                                <field name="company_id" groups="base.group_multi_company" readonly="state == 'done'"/>
                            </group>
                        </group>
                    </sheet>
                    <chatter/>
                </form>