1 <?xml version="1.0" encoding="utf-8"?>
8 Remove information on Account data => because they move on analysis sheet
9 create a page with invoicing informations
11 <record id="account_analytic_account_invoice_stat_form" model="ir.ui.view">
12 <field name="name">account.analytic.account.invoice.stat.form.inherit</field>
13 <field name="model">account.analytic.account</field>
14 <field name="type">form</field>
15 <field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
16 <field eval="18" name="priority"/>
17 <field name="arch" type="xml">
18 <group name="invoice_stats" position="inside">
19 <field name="hours_qtt_non_invoiced" attrs="{'invisible': [('to_invoice','=',0)]}"/>
20 <field name="ca_to_invoice" attrs="{'invisible': [('to_invoice','=',0)]}"/>
21 <label string="" colspan="1"/>
23 name="%(hr_timesheet_invoice.action_hr_timesheet_invoice_create_final)d"
24 string="Create Invoice"
26 attrs="{'readonly':[('ca_to_invoice','=',0.0)], 'invisible': [('to_invoice','=',0)]}"
27 icon="gtk-go-forward"/>
32 id="action_sales_order_line"
33 name="Sales Order Lines"
34 res_model="sale.order.line"
35 src_model="account.analytic.account"
38 id="action_timesheet_lines_tree"
39 name="Timesheet Lines"
40 res_model="account.analytic.line"
41 src_model="account.analytic.account"
44 <record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
45 <field name="name">account.analytic.account.invoice.form.inherit</field>
46 <field name="model">account.analytic.account</field>
47 <field name="type">form</field>
48 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
49 <field eval="18" name="priority"/>
50 <field name="arch" type="xml">
51 <xpath expr='//field[@name="parent_id"]' position='after'>
52 <field name="template_id" on_change="on_change_template(template_id)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
54 <xpath expr='//group[@name="project"]' position="after">
55 <group col="6" colspan="3" class="oe_form_group_label_border">
56 <field name="quantity_max"/><label string="/"/> <label string="Remaining"/> <field name="remaining_hours" nolabel="1"/>
59 <xpath expr='//separator[@name="description"]' position='before'>
60 <separator colspan="4" string="Invoicing" name="invoicing"/>
61 <group col="1" colspan="4">
64 <th height="20px"></th>
69 <th>Ready To Invoice</th>
74 <th>Fix Price Invoices</th>
75 <td><field name="fix_price_invoices" nolabel="1"/></td>
76 <td><field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
77 <td><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
78 <td><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
79 <td><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
80 <td><button name="%(action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
81 <td><button name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
84 <th>Invoice On Timesheets</th>
85 <td><field name="invoice_on_timesheets" nolabel="1"/></td>
86 <td><field name="quantity_max" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
87 <td><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
88 <td><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
89 <td><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
90 <td><button name="%(action_timesheet_lines_tree)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
91 <td><button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
94 <th>Charge Expenses</th>
95 <td><field name="charge_expenses" nolabel="1"/></td>
115 <!-- <group colspan="4">-->
116 <!-- <group col="2" colspan="1" class="oe_form_group_label_border">-->
117 <!-- <label string=" "/><label string=" "/>-->
118 <!-- <field name="fix_price_invoices"/>-->
119 <!-- <field name="invoice_on_timesheets"/>-->
120 <!-- <field name="charge_expenses"/>-->
122 <!-- <group col="2" colspan="1">-->
123 <!-- <label string="Est.Tot"/>-->
124 <!-- <label string="Invoiced"/>-->
125 <!-- <field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
126 <!-- <field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
127 <!-- <field name="quantity_max" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
128 <!-- <field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
130 <!-- <group col="2" colspan="1" class="oe_form_group_odd_border">-->
131 <!-- <label string="Remaining"/>-->
132 <!-- <label string="To Invoice"/>-->
133 <!-- <field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
134 <!-- <field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
135 <!-- <field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
136 <!-- <field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
138 <!-- <group col="2" colspan="1">-->
139 <!-- <label string=" "/><label string=" "/>-->
140 <!-- <button name="%(action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
141 <!-- <button name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
142 <!-- <button name="%(action_timesheet_lines_tree)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
143 <!-- <button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
150 <!--<group colspan="4" name="contract_lines" class="oe_form_group_label_border">
151 <table name="contract_data">
153 <th ><div class="oe_field_label" ></div></th>
155 <th ><div class="oe_float_field_view" >Est. Total</div></th>
156 <th ><div class="oe_field_view" >Invoiced</div></th>
157 <th ><div class="oe_field_view" >Remaining</div></th>
158 <th ><div class="oe_float_field_view" >Ready to Invoice</div></th>
161 <th><div class="oe_field_label">Fix price Invoices</div></th>
162 <td><div><field name="so_visible" nolabel="1"/></div></td>
163 <td><div class="oe_float_field_view"><field name="amount_max" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
164 <td><div class="oe_field_view"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
165 <td><div class="oe_field_view"><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
166 <td><div class="oe_float_field_view"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
167 <td><button class="oe_title_button_right" name="%(action_sales_order_line)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('so_visible','=',0)]}"/></td>
168 <td><button class="oe_title_button_left" name="%(sale.action_order_line_tree2)d" string="Lines To Invoice" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('so_visible','=',0)]}"/></td>
171 <th><div class="oe_field_label">Invoice on timesheet</div></th>
172 <td><div><field name="timsheet_visible" nolabel="1"/></div></td>
173 <td><div class="oe_float_field_view" ><field name="quantity_max" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
174 <td><div class="oe_field_view" ><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
175 <td><div class="oe_field_view" ><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
176 <td><div class="oe_float_field_view" ><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
177 <td><button class="oe_title_button_right" name="%(account.action_account_tree1)d" string="Timesheets" type="action" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></td>
178 <td><button class="oe_title_button_left" name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Invoice Timesheets" type="action" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></td>
181 <th><div class="oe_field_label" >Charge Expenses</div></th>
182 <td><div><field name="expense_visible" nolabel="1"/></div></td>
183 <td><div class="oe_float_field_view" ><field name="expense_max" nolabel="1" attrs="{'invisible': [('expense_visible','=',0)]}"/></div></td>
184 <td><div class="oe_field_view" ></div></td>
185 <td><div class="oe_field_view" ></div></td>
186 <td><div class="oe_float_field_view"></div></td>
189 <th><div class="oe_field_label" >Total</div></th>
191 <td><div class="oe_totals" ></div></td>
192 <td><div class="oe_totals_view" ></div></td>
193 <td><div class="oe_totals_view" ></div></td>
194 <td><div class="oe_totals" ></div></td>
198 <group colspan="4" class="oe_form_group_label_border">
199 <field name="pricelist_id" />
200 <field name="to_invoice" widget="selection" />
203 <!-- <notebook position="inside">
204 <page string="Invoice Analysis">
205 <separator colspan="4" string="Work Done Stats"/>
207 <field name="total_cost"/>
208 <field name="remaining_ca"/>
209 <field name="ca_invoiced"/>
210 <field name="ca_theorical"/>
212 <field name="hours_quantity"/>
213 <field name="hours_qtt_invoiced"/>
214 <field name="remaining_hours"/>
216 <separator colspan="4" string="Analysis Stats"/>
218 <field name="revenue_per_hour"/>
219 <field name="real_margin"/>
220 <field name="real_margin_rate"/>
221 <field name="theorical_margin"/>
222 <separator colspan="4" string="Key Dates"/>
224 <field name="last_invoice_date"/>
225 <field name="last_worked_invoiced_date"/>
226 <field name="last_worked_date"/>
228 <page string="Stats by month">
229 <field colspan="4" name="month_ids" nolabel="1">
230 <tree string="Month">
231 <field name="month"/>
232 <field name="unit_amount" widget="float_time"/>
236 <page string="Stats by user">
237 <field colspan="4" name="user_ids" nolabel="1">
238 <tree string="Users">
240 <field name="unit_amount" widget="float_time"/>
249 <!-- Add information on Account analytic list for the project management -->
250 <record id="view_account_analytic_account_tree_c2c_2" model="ir.ui.view">
251 <field name="name">account.analytic.account.tree</field>
252 <field name="model">account.analytic.account</field>
253 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
254 <field name="type">tree</field>
255 <field name="arch" type="xml">
256 <field name="quantity" position="replace">
257 <field name="hours_quantity"/>
258 <field name="hours_qtt_non_invoiced"/>
259 <field name="remaining_hours"/>
260 <field name="quantity_max"/>
265 <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
266 <field name="name">account.analytic.account.tree</field>
267 <field name="model">account.analytic.account</field>
268 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
269 <field name="type">tree</field>
270 <field name="arch" type="xml">
271 <field name="date" position="before">
272 <field name="last_invoice_date"/>
273 <field name="ca_to_invoice"/>
278 <record id="template_of_contract_action" model="ir.actions.act_window">
279 <field name="name">Template Of Contract</field>
280 <field name="type">ir.actions.act_window</field>
281 <field name="res_model">account.analytic.account</field>
282 <field name="view_type">form</field>
283 <field name="view_mode">tree,form</field>
284 <field name="domain">[('type','=','template')]</field>
285 <field name="context">{'search_default_type':'template','default_type' : 'template'}</field>
287 <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config" />