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="type">tree</field>
10 <field name="model">hr.expense.line</field>
11 <field name="arch" type="xml">
12 <tree string="Expense Lines">
13 <field name="sequence" invisible="1"/>
14 <field name="date_value"/>
17 <field domain="[('type','in',['normal','contract']), ('parent_id','!=',False)]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
18 <field name="unit_amount"/>
19 <field name="unit_quantity"/>
20 <field name="total_amount" sum="Total"/>
25 <record id="view_expenses_tree" model="ir.ui.view">
26 <field name="name">hr.expense.expense.tree</field>
27 <field name="model">hr.expense.expense</field>
28 <field name="type">tree</field>
29 <field name="arch" type="xml">
30 <tree string="Expenses" colors="blue:state=='draft'">
31 <field name="employee_id"/>
32 <field name="department_id" invisible="1"/>
34 <field name="user_id" invisible="1"/>
36 <field name="currency_id"/>
37 <field name="amount"/>
43 <record id="view_editable_expenses_tree" model="ir.ui.view">
44 <field name="name">hr.expense.expense.tree</field>
45 <field name="model">hr.expense.expense</field>
46 <field name="type">tree</field>
47 <field name="arch" type="xml">
48 <tree colors="blue:state == 'draft';black:state in ('confirm','accepted','invoiced','paid');gray:state == 'cancelled'" string="Expenses" editable="top">
49 <field name="employee_id"/>
51 <field name="department_id"/>
53 <field name="amount"/>
55 <button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
56 <button name="refuse" states="confirm,draft,accepted" string="Refuse" type="workflow" icon="gtk-no" groups="base.group_hr_user"/>
61 <record id="view_expenses_form" model="ir.ui.view">
62 <field name="name">hr.expense.form</field>
63 <field name="type">form</field>
64 <field name="model">hr.expense.expense</field>
65 <field name="arch" type="xml">
66 <form string="Expenses Sheet" version="7.0">
68 <button name="confirm" states="draft" string="Submit to Manager" type="workflow" class="oe_highlight"/>
69 <button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
70 <button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" />
71 <button name="invoice" states="accepted" string="Invoice" type="object" groups="base.group_hr_user" class="oe_highlight"/>
72 <button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
73 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/>
78 <field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
80 <field name="department_id"/>
81 <field name="company_id" groups="base.group_multi_company"/>
85 <field name="user_valid"/>
86 <field name="currency_id"/>
90 <page string="Description">
91 <field name="line_ids" context="{'currency_id': currency_id}">
92 <form string="Expense Lines" version="7.0">
95 <field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" context="{'default_hr_expense_ok':1}"/>
98 <field domain="[('type','=','normal')]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
101 <field name="unit_amount"/>
102 <label for="unit_quantity"/>
104 <field name="unit_quantity" class="oe_inline"/>
105 <field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" class="oe_inline"/>
107 <field name="date_value" />
112 <separator string="Notes"/>
113 <field name="note" placeholder="Free Notes"/>
115 <page string="Other Info">
117 <group string="Accounting Data">
118 <field name="journal_id"/>
119 <field name="invoice_id" context="{'type':'in_invoice', 'journal_type': 'purchase'}"/>
125 <div class="oe_chatter">
126 <field name="message_ids" widget="mail_thread"/>
133 <record id="view_hr_expense_filter" model="ir.ui.view">
134 <field name="name">hr.expense.expense.filter</field>
135 <field name="model">hr.expense.expense</field>
136 <field name="type">search</field>
137 <field name="arch" type="xml">
138 <search string="Expense">
139 <field name="name" string="Expenses"/>
141 <filter icon="terp-document-new" domain="[('state','=','draft')]" string="New" help="New Expense"/>
142 <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" help="Confirmed Expense"/>
143 <filter icon="terp-dolar" domain="[('state','=','accepted')]" string="To Pay" help="Expenses to Invoice"/>
144 <field name="employee_id"/>
145 <field name="department_id" string="Department" context="{'invisible_department': False}"/>
146 <field name="user_id" string="User"/>
147 <group expand="0" string="Group By...">
148 <filter string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
149 <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
150 <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
156 <record id="expense_all" model="ir.actions.act_window">
157 <field name="name">Expenses</field>
158 <field name="res_model">hr.expense.expense</field>
159 <field name="view_type">form</field>
160 <field name="search_view_id" ref="view_hr_expense_filter"/>
161 <field name="view_id" ref="view_expenses_tree"/>
162 <field name="help" type="html">
163 <p class="oe_view_nocontent_create">
164 Click to register new expenses.
166 OpenERP will ensure the whole process is followed; the expense
167 sheet is validated by manager(s), the employee is reimbursed
168 from his expenses, some expenses must be re-invoiced to the
174 <menuitem id="next_id_49" name="Expenses" sequence="15" parent="hr.menu_hr_root"/>
175 <menuitem action="expense_all" id="menu_expense_all" name="Expenses" parent="next_id_49"/>
177 <record id="view_product_hr_expense_form" model="ir.ui.view">
178 <field name="name">product.product.expense.form</field>
179 <field name="model">product.product</field>
180 <field name="inherit_id" ref="product.product_normal_form_view"/>
181 <field name="type">form</field>
182 <field name="arch" type="xml">
183 <field name="purchase_ok" position="after">
184 <field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>