1 <?xml version="1.0" encoding="utf-8"?>
7 <record id="view_expenses_line_tree" model="ir.ui.view">
8 <field name="name">hr.expense.line.tree</field>
9 <field name="model">hr.expense.line</field>
10 <field name="arch" type="xml">
11 <tree string="Expense Lines">
12 <field name="sequence" invisible="1"/>
13 <field name="date_value"/>
16 <field domain="[('type','in',['normal','contract']), ('parent_id','!=',False)]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
17 <field name="unit_amount"/>
18 <field name="unit_quantity"/>
19 <field name="total_amount" sum="Total"/>
24 <record id="view_expenses_tree" model="ir.ui.view">
25 <field name="name">hr.expense.expense.tree</field>
26 <field name="model">hr.expense.expense</field>
27 <field name="arch" type="xml">
28 <tree string="Expenses" colors="blue:state=='draft'" fonts="bold: message_unread == True">
29 <field name="employee_id"/>
30 <field name="department_id" invisible="1"/>
32 <field name="user_id" invisible="1"/>
33 <field name="name" string="Expense Sheet"/>
34 <field name="currency_id" groups="base.group_multi_currency"/>
35 <field name="amount" sum="Total Amount"/>
37 <field name="message_unread" invisible="1"/>
42 <record id="view_editable_expenses_tree" model="ir.ui.view">
43 <field name="name">hr.expense.expense.tree</field>
44 <field name="model">hr.expense.expense</field>
45 <field name="arch" type="xml">
46 <tree colors="blue:state == 'draft';black:state in ('confirm','accepted','done');gray:state == 'cancelled'" string="Expenses" editable="top">
47 <field name="employee_id"/>
49 <field name="department_id"/>
50 <field name="name" string="Expense Sheet"/>
51 <field name="amount"/>
53 <button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
54 <button name="refuse" states="confirm,draft,accepted" string="Refuse" type="workflow" icon="gtk-no" groups="base.group_hr_user"/>
59 <record id="view_expenses_form" model="ir.ui.view">
60 <field name="name">hr.expense.form</field>
61 <field name="model">hr.expense.expense</field>
62 <field eval="25" name="priority"/>
63 <field name="arch" type="xml">
64 <form string="Expenses Sheet">
66 <button name="confirm" states="draft" string="Submit to Manager" type="workflow" class="oe_highlight"/>
67 <button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
68 <button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
69 <button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" />
70 <button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice,account.group_account_user" class="oe_highlight"/>
71 <button name="action_view_move" states="done" string="Open Accounting Entries" type="object" groups="account.group_account_invoice,account.group_account_user"/>
72 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,done,paid" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/>
77 <field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
79 <field name="department_id"/>
80 <field name="company_id" groups="base.group_multi_company"/>
83 <field name="name" string="Expense Sheet" placeholder="e.g. Business travel at Chicago"/>
84 <field name="user_valid" attrs="{'invisible': [('state','=','draft')]}" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_hr_user']}"/>
85 <field name="currency_id" groups="base.group_multi_currency" on_change="onchange_currency_id(currency_id, company_id)"/>
88 <field name="journal_id" widget="selection" attrs="{'readonly':[('state','=','done')]}" domain="[('type', '=', 'purchase')]" string="Journal" groups="account.group_account_user"/>
89 <field name="employee_payable_account_id" widget="selection" attrs="{'readonly':[('state','=','done')]}" domain="[('type', '=', 'payable')]" groups="account.group_account_user"/>
92 <label class="oe_grey" groups="account.group_account_user" string="If this field is empty, entries will be generated in the purchase journal."/>
96 <page string="Expense Lines">
97 <field name="line_ids" context="{'currency_id': currency_id, 'default_analytic_account': context.get('analytic_account', '')}">
98 <form string="Expense Lines">
101 <field name="product_id" on_change="onchange_product_id(product_id, context)" context="{'default_hr_expense_ok':1}"/>
104 <field domain="[('type','=','normal')]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
107 <field name="unit_amount"/>
108 <label for="unit_quantity"/>
110 <field name="unit_quantity" class="oe_inline"/>
111 <field name="uom_id" on_change="onchange_uom(product_id, uom_id, context)" class="oe_inline"/>
113 <field name="date_value" />
117 <tree string="Expense Lines" editable="bottom">
118 <field name="sequence" invisible="1"/>
119 <field name="product_id" on_change="onchange_product_id(product_id, context)" context="{'default_hr_expense_ok':1}"/>
120 <field name="date_value" string="Expense Date"/>
121 <field name="name" string="Description"/>
123 <field domain="[('type','in',['normal','contract'])]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
124 <field name="uom_id" on_change="onchange_uom(product_id, uom_id, context)"/>
125 <field name="unit_amount"/>
126 <field name="unit_quantity"/>
127 <field name="total_amount" sum="Total"/>
132 <separator string="Description"/>
133 <field name="note" placeholder="Free Notes"/>
135 <group class="oe_subtotal_footer oe_right">
136 <field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"/>
142 <div class="oe_chatter">
143 <field name="message_follower_ids" widget="mail_followers"/>
144 <field name="message_ids" widget="mail_thread"/>
151 <record id="view_hr_expense_filter" model="ir.ui.view">
152 <field name="name">hr.expense.expense.filter</field>
153 <field name="model">hr.expense.expense</field>
154 <field name="arch" type="xml">
155 <search string="Expense">
156 <field name="name" string="Expenses"/>
158 <field name="employee_id"/>
159 <field name="department_id" string="Department" context="{'invisible_department': False}"/>
160 <filter domain="[('state','=','draft')]" string="New" help="New Expense"/>
161 <filter domain="[('state','=','confirm')]" string="To Approve" name="confirm" help="Confirmed Expenses"/>
162 <filter domain="[('state','=','accepted')]" string="To Pay" name="approved" help="Expenses to Invoice"/>
164 <filter domain="[('user_id', '=', uid)]" string="My Expenses"/>
166 <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
167 <group expand="0" string="Group By">
168 <filter string="Employee" domain="[]" context="{'group_by':'employee_id'}"/>
169 <filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
170 <filter string="Expenses Month" domain="[]" context="{'group_by':'date'}" help="Expenses by Month"/>
176 <record id="expense_all" model="ir.actions.act_window">
177 <field name="name">Expenses</field>
178 <field name="res_model">hr.expense.expense</field>
179 <field name="view_type">form</field>
180 <field name="search_view_id" ref="view_hr_expense_filter"/>
181 <field name="view_id" ref="view_expenses_tree"/>
182 <field name="help" type="html">
183 <p class="oe_view_nocontent_create">
184 Click to register new expenses.
186 Odoo will ensure the whole process is followed; the expense
187 sheet is validated by manager(s), the employee is reimbursed
188 from his expenses, some expenses must be re-invoiced to the
194 <record id="view_product_hr_expense_form" model="ir.ui.view">
195 <field name="name">product.template.expense.form</field>
196 <field name="model">product.template</field>
197 <field name="inherit_id" ref="product.product_template_form_view"/>
198 <field name="arch" type="xml">
199 <div name="options" position="inside">
201 <field name="hr_expense_ok"/>
202 <label for="hr_expense_ok"/>
208 <record id="hr_expense_product" model="ir.actions.act_window">
209 <field name="name">Expense Products</field>
210 <field name="res_model">product.product</field>
211 <field name="view_type">form</field>
212 <field name="view_mode">kanban,tree,form</field>
213 <field name="context">{"default_hr_expense_ok":1}</field>
214 <field name="domain">[('hr_expense_ok','=',True)]</field>
215 <field name="search_view_id" ref="product.product_search_form_view"/>
216 <field name="help" type="html">
217 <p class="oe_view_nocontent_create">
218 Click to create a new expense category.
223 <record id="action_approved_expense" model="ir.actions.act_window">
224 <field name="name">Expenses</field>
225 <field name="res_model">hr.expense.expense</field>
226 <field name="view_type">form</field>
227 <field name="view_mode">tree,form</field>
228 <field name="view_id" ref="view_expenses_tree"/>
229 <field name="domain">[('state','=','accepted')]</field>
232 <record id="action_request_approve_expense" model="ir.actions.act_window">
233 <field name="name">Expenses to Approve</field>
234 <field name="res_model">hr.expense.expense</field>
235 <field name="view_type">form</field>
236 <field name="context">{'search_default_confirm':1, 'needaction_menu_ref': 'hr_expense.menu_expense_all'}</field>
237 <field name="search_view_id" ref="view_hr_expense_filter"/>
238 <field name="view_id" ref="view_expenses_tree"/>
239 <field name="help" type="html">
240 <p class="oe_view_nocontent_create">
241 Click to register new expenses.
243 OpenERP will ensure the whole process is followed; the expense
244 sheet is validated by manager(s), the employee is reimbursed
245 from his expenses, some expenses must be re-invoiced to the
251 <menuitem id="menu_expense_approved" parent="account.menu_finance_payables" action="action_approved_expense" sequence="8"/>
252 <menuitem id="menu_hr_product" name="Expense Products" parent="hr.menu_hr_configuration_expenses" action="hr_expense_product" groups="base.group_hr_manager"/>
253 <menuitem id="next_id_49" name="Expenses" sequence="15" parent="hr.menu_hr_root"/>
254 <menuitem action="expense_all" id="menu_expense_all" name="Expenses" parent="next_id_49"/>
255 <menuitem action="action_request_approve_expense" id="menu_expense_to_approve" name="Expenses to Approve" parent="next_id_49" groups="base.group_hr_user"/>