161 lines
8.7 KiB
XML
161 lines
8.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Realization Tree View -->
|
|
<record id="hr_expense_realization_view_tree" model="ir.ui.view">
|
|
<field name="name">hr.expense.realization.view.tree</field>
|
|
<field name="model">hr.expense.realization</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Expense Realization">
|
|
<field name="name"/>
|
|
<field name="date"/>
|
|
<field name="employee_id"/>
|
|
<field name="expense_id"/>
|
|
<field name="total_amount" sum="Total Amount"/>
|
|
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'confirmed'" decoration-success="state == 'posted'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Realization Form View -->
|
|
<record id="hr_expense_realization_view_form" model="ir.ui.view">
|
|
<field name="name">hr.expense.realization.view.form</field>
|
|
<field name="model">hr.expense.realization</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Expense Realization">
|
|
<header>
|
|
<button name="action_confirm" string="Confirm" type="object" class="oe_highlight" invisible="state != 'draft'"/>
|
|
<button name="action_post" string="Post Journal" type="object" class="oe_highlight" groups="account.group_account_invoice" invisible="state != 'confirmed'"/>
|
|
|
|
<!-- Discrepancy Buttons -->
|
|
<field name="show_vendor_payment_btn" invisible="1"/>
|
|
<field name="show_customer_payment_btn" invisible="1"/>
|
|
<button name="action_create_vendor_payment"
|
|
string="Create Vendor Payment"
|
|
type="object"
|
|
class="oe_highlight"
|
|
groups="account.group_account_invoice"
|
|
invisible="not show_vendor_payment_btn"/>
|
|
<button name="action_create_customer_payment"
|
|
string="Create Customer Payment"
|
|
type="object"
|
|
class="oe_highlight"
|
|
groups="account.group_account_invoice"
|
|
invisible="not show_customer_payment_btn"/>
|
|
|
|
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,posted"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="action_view_payments" type="object" class="oe_stat_button" icon="fa-money" invisible="payment_count == 0">
|
|
<field name="payment_count" widget="statinfo" string="Payments"/>
|
|
</button>
|
|
</div>
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" readonly="1"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="expense_id" readonly="state != 'draft'"/>
|
|
<field name="employee_id"/>
|
|
<field name="date" readonly="state == 'posted'"/>
|
|
</group>
|
|
<group>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
|
<field name="total_amount"/>
|
|
<field name="move_id" invisible="not move_id"/>
|
|
</group>
|
|
</group>
|
|
<group string="Accounting Information" invisible="state == 'draft'" groups="account.group_account_invoice">
|
|
<group name="accounting_main">
|
|
<field name="journal_id" required="state == 'confirmed'" readonly="state == 'posted'"/>
|
|
<label for="default_counterpart_account_id" string="Counterpart Account"/>
|
|
<div class="o_row">
|
|
<field name="default_counterpart_account_id" placeholder="Select Default Account..." readonly="state == 'posted'"/>
|
|
<button name="action_apply_default_account"
|
|
type="object"
|
|
string="Set on Lines"
|
|
class="btn btn-secondary"
|
|
invisible="state == 'posted' or not default_counterpart_account_id"/>
|
|
</div>
|
|
</group>
|
|
<group name="accounting_info">
|
|
<div class="alert alert-info" role="alert" invisible="state != 'confirmed'">
|
|
Use the "Set on Lines" button to quickly assign the counterpart account to all receipt lines.
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Receipts" name="receipt_lines">
|
|
<field name="line_ids" readonly="state == 'posted'">
|
|
<tree editable="bottom">
|
|
<field name="description"/>
|
|
<field name="amount" sum="Total"/>
|
|
<field name="attachment_id" filename="attachment_name" widget="binary"/>
|
|
<field name="attachment_name" column_invisible="1"/>
|
|
<field name="counterpart_account_id" groups="account.group_account_invoice" required="parent.state == 'confirmed'"/>
|
|
<field name="move_id" groups="account.group_account_invoice" widget="many2one_clickable" readonly="1" invisible="not move_id"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
<page string="Notes" name="notes">
|
|
<field name="description" placeholder="Add some notes..."/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Realization Search View -->
|
|
<record id="hr_expense_realization_view_search" model="ir.ui.view">
|
|
<field name="name">hr.expense.realization.view.search</field>
|
|
<field name="model">hr.expense.realization</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Realization">
|
|
<field name="name"/>
|
|
<field name="employee_id"/>
|
|
<field name="expense_id"/>
|
|
<filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/>
|
|
<filter string="Confirmed" name="confirmed" domain="[('state', '=', 'confirmed')]"/>
|
|
<filter string="Posted" name="posted" domain="[('state', '=', 'posted')]"/>
|
|
<group expand="0" string="Group By">
|
|
<filter string="Employee" name="group_employee" context="{'group_by': 'employee_id'}"/>
|
|
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
|
|
<filter string="Date" name="group_date" context="{'group_by': 'date'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Realization Action -->
|
|
<record id="action_hr_expense_realization" model="ir.actions.act_window">
|
|
<field name="name">Realization Report</field>
|
|
<field name="res_model">hr.expense.realization</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="search_view_id" ref="hr_expense_realization_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create a new Realization Report
|
|
</p>
|
|
<p>
|
|
Manage employee receipts and their final accounting reconciliation.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Menu Structure Adjustment -->
|
|
<menuitem id="menu_hr_expense_realization"
|
|
name="Realization Report"
|
|
parent="hr_expense.menu_hr_expense_root"
|
|
action="action_hr_expense_realization"
|
|
sequence="3"/>
|
|
</odoo>
|