<?xml version="1.0"?>
<form string="Maintenance Request">
                <field name="company_id" invisible="1"/>
                <field name="category_id" invisible="1"/>
                <header>
                    <button string="Cancel" name="archive_equipment_request" type="object" invisible="archive"/>
                    <button string="Reopen Request" name="reset_equipment_request" type="object" invisible="not archive"/>
                    <field name="stage_id" widget="statusbar" options="{'clickable': '1'}" invisible="archive"/>
                </header>
                <sheet>
                    <div invisible="not archive">
                        <span class="badge text-bg-warning float-end">Cancelled</span>
                    </div>
                    <field name="kanban_state" widget="state_selection"/>
                    <div class="oe_title">
                        <label for="name" string="Request"/>
                        <h1>
                            <field name="name" placeholder="e.g. Screen not working"/>
                        </h1>
                    </div>
                    <group>
                        <group>
                            <field name="owner_user_id" string="Requested By" invisible="1"/>
                            <field name="equipment_id" context="{'default_company_id':company_id, 'default_category_id':category_id}"/>
                            <field name="category_id" groups="maintenance.group_equipment_manager" context="{'default_company_id':company_id}" invisible="not equipment_id"/>
                            <field name="request_date" readonly="True"/>
                            <field name="done" invisible="1"/>
                            <field name="close_date" readonly="True" invisible="not done"/>
                            <field name="archive" invisible="1"/>
                            <field name="maintenance_type" widget="radio"/>
                        </group>
                        <group>
                            <field name="maintenance_team_id" options="{'no_create': True, 'no_open': True}"/>
                            <field name="user_id" string="Responsible"/>
                            <field name="schedule_date"/>
                            <label for="duration"/>
                            <div>
                                <field name="duration" widget="float_time" class="oe_inline"/> <span class="ml8">hours</span>
                            </div>
                            <label for="recurring_maintenance" invisible="maintenance_type == 'corrective'"/>
                            <div class="d-inline-flex" invisible="maintenance_type == 'corrective'">
                                <field name="recurring_maintenance" nolabel="1" class="ms-0" style="width: fit-content;"/>
                            </div>
                            <label for="repeat_interval" invisible="not recurring_maintenance"/>
                            <div class="d-flex" invisible="not recurring_maintenance">
                                <field name="repeat_interval" required="recurring_maintenance" class="me-2" style="max-width: 2rem !important;"/>
                                <field name="repeat_unit" required="recurring_maintenance" class="me-2" style="max-width: 4rem !important;"/>
                                <field name="repeat_type" required="recurring_maintenance" class="me-2" style="max-width: 15rem !important;"/>
                                <field name="repeat_until" invisible="repeat_type != 'until'" required="repeat_type == 'until'" class="me-2"/>
                            </div>
                            <field name="priority" widget="priority"/>
                            <field name="email_cc" string="Email cc" groups="base.group_no_one"/>
                            <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Notes">
                            <field name="description" placeholder="Internal Notes"/>
                        </page>
                        <page string="Instructions">
                            <group col="1">
                                <field name="instruction_type" widget="radio" nolabel="1"/>
                                <field name="instruction_pdf" help="Upload your PDF file." widget="pdf_viewer" invisible="instruction_type != 'pdf'" required="instruction_type == 'pdf'" nolabel="1"/>
                                <field name="instruction_google_slide" placeholder="Google Slide Link" widget="embed_viewer" invisible="instruction_type != 'google_slide'" required="instruction_type == 'google_slide'" nolabel="1"/>
                                <field name="instruction_text" placeholder="Your instructions" invisible="instruction_type != 'text'" nolabel="1"/>
                            </group>
                        </page>
                    </notebook>
                </sheet>
                <chatter/>
            </form>
        