<?xml version="1.0"?>
<form string="Expense Reports" class="o_expense_sheet">
                <field name="can_reset" invisible="1"/>
                <field name="can_approve" invisible="1"/>
                <field name="company_id" invisible="1"/>
                 <header>
                    <button name="action_submit_sheet" states="draft" string="Submit to Manager" type="object" class="oe_highlight o_expense_sheet_submit" data-hotkey="l"/>
                    <button name="approve_expense_sheets" string="Approve" type="object" data-hotkey="v" context="{'validate_analytic': True}" attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', '!=', 'submit')]}" class="oe_highlight o_expense_sheet_approve"/>
                    <button name="action_sheet_move_create" string="Post Journal Entries" type="object" data-hotkey="y" class="oe_highlight o_expense_sheet_post" attrs="{'invisible': [('state', '!=', 'approve')]}" groups="account.group_account_invoice"/>
                    <button name="action_register_payment" string="Register Payment" type="object" data-hotkey="w" class="oe_highlight o_expense_sheet_pay" context="{'dont_redirect_to_payments': True}" attrs="{'invisible': ['|', ('payment_state', 'in', ('paid', 'in_payment')), ('state', 'not in', ('post', 'done'))]}" groups="account.group_account_invoice"/>
                    <button name="action_unpost" type="object" data-hotkey="c" attrs="{'invisible': [('state', '!=', 'post')]}" string="Reset to Draft" groups="account.group_account_readonly,account.group_account_invoice"/>
                    <button name="610" states="submit,approve" context="{'hr_expense_refuse_model':'hr.expense.sheet'}" string="Refuse" type="action" groups="hr_expense.group_hr_expense_team_approver" data-hotkey="x"/>
                    <button name="reset_expense_sheets" string="Reset to Draft" type="object" attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['submit', 'cancel', 'approve'])]}" data-hotkey="q"/>
                    <field name="state" widget="statusbar" statusbar_visible="draft,submit,approve,post,done" force_save="1"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button name="action_open_account_move" class="oe_stat_button" icon="fa-file-text-o" type="object" attrs="{'invisible': ['|', ('state', 'not in', ['post', 'done']), ('account_move_id', '=', False)]}" groups="account.group_account_invoice">
                            Journal Entry
                        </button>
                        <field name="account_move_id" invisible="1"/>
                        <button name="action_get_expense_view" class="oe_stat_button" icon="fa-file-text-o" type="object" attrs="{'invisible': [('expense_number', '=', 0)]}">
                            <field name="expense_number" widget="statinfo" string="Expenses"/>
                        </button>
                    </div>
                    <field name="payment_state" invisible="True"/>
                    <!-- Paid by Company  -->
                    <widget name="web_ribbon" title="Paid" bg_color="bg-success" attrs="{'invisible': ['|', ('payment_mode', '=', 'own_account'), ('payment_state', 'not in', ['paid', 'in_payment', 'partial'])]}"/>
                    <!-- Paid by Employee -->
                    <widget name="web_ribbon" title="Paid" bg_color="bg-success" attrs="{'invisible': ['|', ('payment_mode', '=', 'company_account'), ('payment_state', '!=', 'paid')]}"/>
                    <widget name="web_ribbon" title="Partial" bg_color="bg-info" attrs="{'invisible': ['|', ('payment_mode', '=', 'company_account'), ('payment_state', '!=', 'partial')]}"/>
                    <widget name="web_ribbon" title="In Payment" attrs="{'invisible': ['|', ('payment_mode', '=', 'company_account'), ('payment_state', '!=', 'in_payment')]}"/>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name" placeholder="e.g. Trip to NY" attrs="{'readonly': [('is_editable', '=', False)]}" force_save="1"/>
                        </h1>
                    </div>
                    <group>
                        <group name="employee_details">
                            <field name="employee_id" context="{'default_company_id': company_id}" widget="many2one_avatar_employee"/>
                            <field name="payment_mode"/>
                            <field name="journal_id" groups="account.group_account_invoice,account.group_account_readonly" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('payment_mode', '!=', 'own_account')]}" context="{'default_company_id': company_id}"/>
                            <field name="bank_journal_id" groups="account.group_account_invoice,account.group_account_readonly" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('payment_mode', '!=', 'company_account')]}" context="{'default_company_id': company_id}"/>
                            <field name="address_id" invisible="1" context="{'default_company_id': company_id}"/>
                            <field name="department_id" invisible="1" context="{'default_company_id': company_id}"/>
                        </group>
                        <group>
                            <field name="company_id" groups="base.group_multi_company"/>
                            <field name="user_id" widget="many2one_avatar_user"/>
                            <field name="accounting_date" groups="account.group_account_invoice,account.group_account_readonly" attrs="{'invisible': [('state', 'not in', ['approve', 'post', 'done'])], 'readonly': [('state', 'in', ['post', 'done'])]}"/>
                        </group>
                    </group>
                     <notebook>
                        <page name="expenses" string="Expense">
                            <field name="is_editable" invisible="1"/>
                            <field name="expense_line_ids" nolabel="1" widget="many2many" mode="tree,kanban" domain="[                                         ('state', '=', 'draft'),                                         ('employee_id', '=', employee_id),                                         ('company_id', '=', company_id),                                         ('payment_mode', '=?', payment_mode),                                     ]" options="{'reload_on_button': True}" context="{                                         'form_view_ref' : 'hr_expense.hr_expense_view_form_without_header',                                         'default_company_id': company_id,                                         'default_employee_id': employee_id,                                         'default_payment_mode': payment_mode or 'own_account',                                     }" attrs="{'readonly': [('is_editable', '=', False)]}" force_save="1">
                                <tree decoration-danger="is_refused" editable="bottom" class="o_expense_line_list">
                                    <field name="date" optional="show"/>
                                    <field name="product_id"/>
                                    <field name="name"/>
                                    <field name="description" optional="hide"/>
                                    <field name="employee_id" invisible="1"/>
                                    <field name="state" invisible="1"/>
                                    <field name="attachment_number" invisible="1"/>
                                    <button name="action_get_attachment_view" type="object" icon="fa-paperclip" aria-label="View Attachments" title="View Attachments" class="float-end pe-0" readonly="True" attrs="{'invisible': [('attachment_number', '=', 0)]}"/>
                                    <field name="reference" optional="hide" readonly="True"/>
                                    <field name="analytic_distribution" widget="analytic_distribution" groups="analytic.group_analytic_accounting" optional="show" options="{'product_field': 'product_id', 'account_field': 'account_id', 'business_domain': 'expense'}"/>
                                    <field name="account_id" optional="hide" groups="account.group_account_readonly"/>
                                    <field name="product_has_cost" invisible="True"/>
                                    <field name="unit_amount" optional="hide" widget="monetary" attrs="{'readonly': [('product_has_cost', '=', False)]}" options="{'currency_field': 'company_currency_id', 'field_digits': True}"/>
                                    <field name="currency_id" optional="hide" readonly="True"/>
                                    <field name="quantity" optional="hide" attrs="{'readonly': [('product_has_cost', '=', False)]}"/>
                                    <field name="company_id" invisible="1"/>
                                    <field name="tax_ids" string="Taxes" optional="show" widget="many2many_tags" context="{'default_company_id': company_id}"/>
                                    <field name="amount_tax" optional="hide" context="{'default_company_id': company_id}" readonly="True" groups="base.group_multi_currency"/>
                                    <field name="total_amount" optional="show" attrs="{'readonly': [('product_has_cost', '=', True)]}"/>
                                    <field name="amount_tax_company" optional="hide" readonly="True"/>
                                    <field name="company_currency_id" invisible="1"/>
                                    <field name="total_amount_company" optional="show" groups="base.group_multi_currency" readonly="True"/>
                                    <field name="is_refused" invisible="True"/>
                                </tree>
                            </field>
                            <field name="currency_id" invisible="1"/>
                            <group class="oe_subtotal_footer oe_right" colspan="2" name="expense_total">
                                <field name="untaxed_amount"/>
                                <div class="oe_inline o_td_label">
                                    <label for="total_amount_taxes"/>
                                </div>
                                <field name="total_amount_taxes" nolabel="1"/>
                                <div class="oe_inline o_td_label">
                                    <label for="total_amount"/>
                                </div>
                                <field name="total_amount" nolabel="1" class="oe_subtotal_footer_separator"/>
                                <field name="amount_residual" class="oe_subtotal_footer_separator" attrs="{'invisible': [('state', 'not in', ('post', 'done'))]}"/>
                            </group>
                        </page>
                     </notebook>
                </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>
            