<?xml version="1.0"?>
<form string="Expenses" class="o_expense_form" js_class="hr_expense_form_view">
                <header>
                  <button name="action_submit_expenses" string="Create Report" type="object" class="oe_highlight o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '&lt;=', 0), ('sheet_id', '!=', False)]}" data-hotkey="v"/>
                  <widget name="attach_document" string="Attach Receipt" action="attach_document" attrs="{'invisible': [('attachment_number', '&lt;', 1)]}"/>
                  <widget name="attach_document" string="Attach Receipt" action="attach_document" highlight="1" attrs="{'invisible': [('attachment_number', '&gt;=', 1)]}"/>
                  <button name="action_submit_expenses" string="Create Report" type="object" class="o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '&gt;=', 1), ('sheet_id', '!=', False)]}" data-hotkey="v"/>
                  <field name="state" widget="statusbar" statusbar_visible="draft,reported,approved,done,refused"/>
                  <button name="action_view_sheet" type="object" string="View Report" class="oe_highlight" attrs="{'invisible': [('sheet_id', '=', False)]}" data-hotkey="w"/>
                  <button name="action_split_wizard" string="Split Expense" type="object" attrs="{'invisible': ['|', ('sheet_id', '!=', False), ('product_has_cost', '=', True)]}"/>
                </header>
                <sheet>
                    <div class="oe_title">
                        <label for="name"/>
                        <h1>
                            <field name="name" placeholder="e.g. Lunch with Customer" attrs="{'readonly': [('sheet_is_editable', '=', False)]}"/>
                        </h1>
                    </div>
                    <group>
                        <group>
                            <field name="product_has_cost" invisible="1"/>
                            <field name="product_has_tax" invisible="1"/>
                            <field name="same_currency" invisible="1"/>
                            <field name="is_editable" invisible="1"/>
                            <field name="is_ref_editable" invisible="1"/>
                            <field name="currency_id" invisible="1"/>
                            <field name="company_id" invisible="1"/>
                            <field name="company_currency_id" invisible="1"/>
                            <field name="amount_tax_company" invisible="1"/>
                            <field name="unit_amount" invisible="1"/>
                            <field name="attachment_number" invisible="1"/>
                            <field name="total_amount_company" invisible="1"/>
                            <field name="duplicate_expense_ids" invisible="1"/>
                            <field name="sheet_is_editable" invisible="1"/>
                            <field name="currency_rate" invisible="1"/>
                            <label for="product_id"/>
                            <div>
                                <field name="product_id" required="1" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" context="{'default_detailed_type': 'service', 'default_can_be_expensed': 1, 'tree_view_ref': 'hr_expense.product_product_expense_tree_view', 'form_view_ref': 'hr_expense.product_product_expense_form_view'}" class="w-100"/>
                                <div class="fst-italic" attrs="{'invisible': ['|', ('product_description', '=', False), ('product_id', '=', False)]}">
                                    <field name="product_description"/>
                                </div>
                            </div>
                            <field name="unit_amount" required="1" force_save="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'invisible': [('product_has_cost', '=', False)], 'readonly': ['|', ('sheet_is_editable', '=', False), ('product_has_cost', '=', True)]}"/>
                            <field name="product_uom_category_id" invisible="1"/>
                            <label for="quantity" attrs="{'invisible': [('product_has_cost', '=', False)]}"/>
                            <div attrs="{'invisible': [('product_has_cost', '=', False)]}">
                                <div class="o_row">
                                    <field name="quantity" class="oe_inline" attrs="{'readonly': [('sheet_is_editable', '=', False)]}"/>
                                    <field name="product_uom_id" required="1" force_save="1" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
                                </div>
                            </div>

                            <label for="total_amount" string="Total" attrs="{'invisible': [('product_has_cost', '=', True)]}"/>
                            <div class="o_row" attrs="{'invisible': [('product_has_cost', '=', True)]}">
                                <field name="total_amount" widget="monetary" options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" class="oe_inline"/>
                                <field name="currency_id" groups="base.group_multi_currency"/>
                            </div>
                            <label for="total_amount_company" attrs="{'invisible': [('same_currency', '=', True), ('product_has_cost', '=', False)]}"/>
                            <div class="o_row" attrs="{'invisible': [('same_currency', '=', True), ('product_has_cost', '=', False)]}">
                                <field name="total_amount_company" widget="monetary" options="{'currency_field': 'company_currency_id'}" class="oe_inline"/>
                                <field name="label_convert_rate" class="ps-0"/>
                            </div>
                            <label for="tax_ids"/>
                            <div class="d-flex o_row">
                                <div class="p-2">
                                    <field name="tax_ids" force_save="1" widget="many2many_tags" attrs="{'readonly': [('is_editable', '=', False)]}" context="{'default_company_id': company_id, 'default_type_tax_use': 'purchase', 'default_price_include': 1}" options="{'no_create': True}"/>
                                </div>
                                <div class="d-flex pt-2">
                                    <span class="oe_inline o_form_label ms-1 me-1"> ( </span>
                                    <field name="amount_tax" class="ps-0"/>
                                    <span class="oe_inline o_form_label ms-1 me-3"> ) </span>
                                </div>
                            </div>
                            <t groups="hr_expense.group_hr_expense_team_approver">
                                <field name="employee_id" options="{'relation': 'hr.employee.public'}" groups="!hr.group_hr_user" context="{'default_company_id': company_id}" widget="many2one_avatar_employee"/>
                                <field name="employee_id" options="{'relation': 'hr.employee'}" groups="hr.group_hr_user" context="{'default_company_id': company_id}" widget="many2one_avatar_employee"/>
                            </t>
                            <label id="lo" for="payment_mode" attrs="{'invisible': [('product_has_cost', '=', True)]}"/>
                            <div id="payment_mode" attrs="{'invisible': [('product_has_cost', '=', True)]}">
                                <field name="payment_mode" widget="radio"/>
                            </div>
                        </group><group>
                            <field name="reference" groups="account.group_account_readonly" attrs="{'readonly': [('is_ref_editable', '=', False)], 'invisible': [('product_has_cost', '=', True)]}"/>
                            <field name="date" attrs="{'readonly': [('sheet_is_editable', '=', False)]}"/>
                            <field name="accounting_date" attrs="{'invisible': ['|', ('accounting_date', '=', False), ('state', 'not in', ['approved', 'done'])]}"/>
                            <field name="account_id" options="{'no_create': True}" domain="[('account_type', 'not in', ('asset_receivable','liability_payable','asset_cash','liability_credit_card')), ('deprecated', '=', False), ('company_id', '=', company_id)]" groups="account.group_account_readonly" attrs="{'readonly': ['|', ('is_editable', '=', False), ('sheet_is_editable', '=', False)]}" context="{'default_company_id': company_id}"/>
                            <field name="sheet_id" invisible="1"/>
                            <field name="analytic_distribution" widget="analytic_distribution" groups="analytic.group_analytic_accounting" options="{'product_field': 'product_id', 'account_field': 'account_id', 'business_domain': 'expense'}" attrs="{'readonly': [('is_editable', '=', False)]}"/>
                            <field name="company_id" groups="base.group_multi_company"/>
                        </group>
                    </group>
                    <div>
                        <field name="description" placeholder="Notes..."/>
                    </div>
                </sheet>
                <div class="o_attachment_preview"/>
                <div class="oe_chatter">
                    <field name="message_follower_ids"/>
                    <field name="activity_ids"/>
                    <field name="message_ids"/>
                </div>
                </form>
            