<?xml version="1.0"?>
<form string="Production Workcenter" delete="0" create="0">
            <field name="is_user_working" invisible="1"/>
            <field name="working_state" invisible="1"/>
            <field name="production_state" invisible="1"/>
            <header>
                <field name="state" widget="statusbar" statusbar_visible="pending,waiting,ready,progress,done"/>
            </header>
            <sheet>
                <div class="oe_button_box" name="button_box">
                    <button class="oe_stat_button" name="action_see_move_scrap" type="object" icon="oi-arrows-v" invisible="scrap_count == 0">
                        <div class="o_field_widget o_stat_info">
                            <span class="o_stat_value"><field name="scrap_count"/></span>
                            <span class="o_stat_text">Scraps</span>
                        </div>
                    </button>
                </div>
                <field name="company_id" invisible="1"/>
                <field name="product_tracking" invisible="1"/>
                <field name="product_id" invisible="1"/>
                <field name="finished_lot_id" invisible="1"/>
                <group>
                    <group>
                        <field name="name" readonly="1"/>
                        <field name="workcenter_id" readonly="state in ['cancel', 'done', 'progress']"/>
                    </group>
                    <group>
                        <field name="product_id" readonly="1"/>
                        <field name="qty_remaining" string="Quantity" readonly="1"/>
                        <field name="finished_lot_id" readonly="1"/>
                    </group>
                </group>
                <group>
                    <group>
                        <label for="date_start" string="Start Date"/>
                        <div class="oe_inline">
                            <field name="is_planned" invisible="1"/>
                            <field name="date_start" class="mr8 oe_inline" readonly="state in ['cancel', 'done']"/>
                            <strong class="mr8 oe_inline">to</strong>
                            <field name="date_finished" class="oe_inline" readonly="state in ['cancel', 'done']"/>
                            <field name="show_json_popover" invisible="1"/>
                            <field name="json_popover" widget="mrp_workorder_popover" class="oe_inline mx-2" invisible="not show_json_popover"/>
                        </div>
                        <label for="duration_expected"/>
                        <div class="o_row">
                            <field name="duration_expected" widget="float_time" readonly="state in ['cancel', 'done']"/>
                            <span>minutes</span>
                        </div>
                    </group>
                    <group>
                        <field name="production_id"/>
                    </group>
                </group>
                <notebook>
                    <page string="Time Tracking" name="time_tracking" groups="mrp.group_mrp_manager">
                        <field name="time_ids" nolabel="1" context="{'default_workcenter_id': workcenter_id, 'default_workorder_id': id}">
                            <list editable="bottom">
                                <field name="user_id"/>
                                <field name="duration" widget="float_time" readonly="id"/>
                                <field name="date_start"/>
                                <field name="date_end"/>
                                <field name="workcenter_id" column_invisible="True"/>
                                <field name="company_id" column_invisible="True"/>
                                <field name="loss_id" string="Productivity" optional="show"/>
                            </list>
                            <form>
                                <group>
                                    <group>
                                        <field name="date_start"/>
                                        <field name="date_end"/>
                                        <field name="duration" widget="float_time"/>
                                        <field name="company_id" invisible="1"/>
                                    </group>
                                    <group>
                                        <field name="user_id"/>
                                        <field name="workcenter_id"/>
                                        <field name="company_id" invisible="1"/>
                                        <field name="loss_id"/>
                                    </group>
                                </group>
                            </form>
                        </field>
                        <div>
                            <label for="duration" class="pe-2"/>
                            <field name="duration" widget="float_time" readonly="1"/>
                            <span>&amp;nbsp;(minutes)</span>
                        </div>
                </page>
                <page string="Components" name="components">
                    <field name="move_raw_ids" readonly="1">
                        <list>
                            <field name="state" column_invisible="True"/>
                            <field name="product_id" readonly="state == 'done'"/>
                            <field name="product_qty" string="To Consume"/>
                            <field name="quantity" string="Quantity"/>
                            <field name="picked" string="Consumed"/>
                            <field name="product_qty_available" string="On Hand" invisible="not is_storable"/>
                            <field name="product_virtual_available" string="Forecasted" invisible="not is_storable"/>
                        </list>
                    </field>
                </page>
                <page string="Work Instruction" name="workorder_page_work_instruction" invisible="not worksheet and not worksheet_google_slide and not operation_note">
                    <field name="worksheet_type" invisible="1"/>
                    <field name="worksheet" widget="pdf_viewer" invisible="worksheet_type != 'pdf'"/>
                    <field name="worksheet_google_slide" widget="embed_viewer" invisible="worksheet_type != 'google_slide'"/>
                    <field name="operation_note" invisible="worksheet_type != 'text'"/>
                </page>
                <field name="allow_workorder_dependencies" invisible="1"/>
                <page string="Blocked By" name="dependencies" invisible="not allow_workorder_dependencies">
                    <field name="blocked_by_workorder_ids" nolabel="1">
                        <list editable="bottom">
                            <field name="company_id" column_invisible="True"/>
                            <field name="name" string="Operation" readonly="state in ['cancel', 'done']"/>
                            <field name="company_id" optional="hide" groups="base.group_multi_company"/>
                            <field name="workcenter_id" readonly="state in ['cancel', 'done', 'progress']"/>
                            <field name="date_start" readonly="1"/>
                            <field name="date_finished" readonly="1"/>
                            <field name="duration_expected" widget="float_time" sum="expected duration" readonly="state in ['cancel', 'done']"/>
                            <field name="production_state" column_invisible="True"/>
                            <field name="state" widget="badge" decoration-warning="state == 'progress'" decoration-success="state == 'done'" decoration-info="state not in ('progress', 'done', 'cancel')" column_invisible="parent.state == 'draft'" invisible="production_state == 'draft'"/>
                            <button class="oe_link float-end" string="View WorkOrder" name="action_open_wizard" type="object"/>
                        </list>
                    </field>
                </page>
                </notebook>
            </sheet>
            </form>
        