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 class="oe_th_150px" height="20px"></th>
65 <th width="10px"></th>
66 <th class="oe_th_110px">Est.Tot</th>
67 <th class="oe_th_110px">Invoiced</th>
68 <th class="oe_th_110px">Remaining</th>
69 <th class="oe_th_110px">Ready To Invoice</th>
70 <th width="10px"></th>
71 <th class="oe_th_150px"></th>
72 <th class="oe_th_150px"></th>
75 <th class="oe_border_right">Fix Price Invoices</th>
76 <td><field name="fix_price_invoices" nolabel="1"/></td>
77 <td class="oe_amount_center oe_th_110px"><field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
78 <td class="oe_amount_center oe_th_110px"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
79 <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
80 <td class="oe_amount_center oe_th_110px"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/></td>
81 <td width="10px"></td>
82 <td class="oe_th_150px"><button class= "oe_btn_width" 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>
83 <td class="oe_th_150px"><button class= "oe_btn_width" 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>
86 <th class="oe_border_right">Invoice On Timesheets</th>
87 <td><field name="invoice_on_timesheets" nolabel="1"/></td>
88 <td class="oe_amount_center oe_th_110px"><field name="quantity_max" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
89 <td class="oe_amount_center oe_th_110px"><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
90 <td class="oe_amount_center oe_th_110px oe_border_right"><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
91 <td class="oe_amount_center oe_th_110px"><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
92 <td width="10px"></td>
93 <td class="oe_th_150px"><button class= "oe_btn_width" name="%(action_timesheet_lines_tree)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/></td>
94 <td class="oe_th_150px"><button class= "oe_btn_width" 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>
97 <th class="oe_border_right">Charge Expenses</th>
98 <td><field name="charge_expenses" nolabel="1"/></td>
99 <td class="oe_amount_center oe_th_110px">todo</td>
100 <td class="oe_amount_center oe_th_110px">todo</td>
101 <td class="oe_amount_center oe_th_110px oe_border_right">todo</td>
102 <td class="oe_amount_center oe_th_110px">todo</td>
103 <td width="10px"></td>
104 <td class="oe_th_150px">todo</td>
105 <td class="oe_th_150px">todo</td>
108 <th class="oe_border_right">Total</th>
109 <td width="10px"></td>
110 <td class="oe_amount_center oe_th_110px oe_border_top">todo</td>
111 <td class="oe_amount_center oe_th_110px oe_border_top">todo</td>
112 <td class="oe_amount_center oe_th_110px oe_border_right oe_border_top">todo</td>
113 <td class="oe_amount_center oe_th_110px oe_border_top">todo</td>
117 <!-- <group colspan="4">-->
118 <!-- <group col="2" colspan="1" class="oe_form_group_label_border">-->
119 <!-- <label string=" "/><label string=" "/>-->
120 <!-- <field name="fix_price_invoices"/>-->
121 <!-- <field name="invoice_on_timesheets"/>-->
122 <!-- <field name="charge_expenses"/>-->
124 <!-- <group col="2" colspan="1">-->
125 <!-- <label string="Est.Tot"/>-->
126 <!-- <label string="Invoiced"/>-->
127 <!-- <field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
128 <!-- <field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
129 <!-- <field name="quantity_max" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
130 <!-- <field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
132 <!-- <group col="2" colspan="1" class="oe_form_group_odd_border">-->
133 <!-- <label string="Remaining"/>-->
134 <!-- <label string="To Invoice"/>-->
135 <!-- <field name="remaining_ca" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
136 <!-- <field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>-->
137 <!-- <field name="remaining_hours" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
138 <!-- <field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
140 <!-- <group col="2" colspan="1">-->
141 <!-- <label string=" "/><label string=" "/>-->
142 <!-- <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)]}"/>-->
143 <!-- <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)]}"/>-->
144 <!-- <button name="%(action_timesheet_lines_tree)d" string="Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',0)]}"/>-->
145 <!-- <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)]}"/>-->
152 <!--<group colspan="4" name="contract_lines" class="oe_form_group_label_border">
153 <table name="contract_data">
155 <th ><div class="oe_field_label" ></div></th>
157 <th ><div class="oe_float_field_view" >Est. Total</div></th>
158 <th ><div class="oe_field_view" >Invoiced</div></th>
159 <th ><div class="oe_field_view" >Remaining</div></th>
160 <th ><div class="oe_float_field_view" >Ready to Invoice</div></th>
163 <th><div class="oe_field_label">Fix price Invoices</div></th>
164 <td><div><field name="so_visible" nolabel="1"/></div></td>
165 <td><div class="oe_float_field_view"><field name="amount_max" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
166 <td><div class="oe_field_view"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
167 <td><div class="oe_field_view"><field name="remaining_ca" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
168 <td><div class="oe_float_field_view"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
169 <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>
170 <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>
173 <th><div class="oe_field_label">Invoice on timesheet</div></th>
174 <td><div><field name="timsheet_visible" nolabel="1"/></div></td>
175 <td><div class="oe_float_field_view" ><field name="quantity_max" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
176 <td><div class="oe_field_view" ><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
177 <td><div class="oe_field_view" ><field name="remaining_hours" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
178 <td><div class="oe_float_field_view" ><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
179 <td><button class="oe_title_button_right" name="%(account.action_account_tree1)d" string="Timesheets" type="action" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></td>
180 <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>
183 <th><div class="oe_field_label" >Charge Expenses</div></th>
184 <td><div><field name="expense_visible" nolabel="1"/></div></td>
185 <td><div class="oe_float_field_view" ><field name="expense_max" nolabel="1" attrs="{'invisible': [('expense_visible','=',0)]}"/></div></td>
186 <td><div class="oe_field_view" ></div></td>
187 <td><div class="oe_field_view" ></div></td>
188 <td><div class="oe_float_field_view"></div></td>
191 <th><div class="oe_field_label" >Total</div></th>
193 <td><div class="oe_totals" ></div></td>
194 <td><div class="oe_totals_view" ></div></td>
195 <td><div class="oe_totals_view" ></div></td>
196 <td><div class="oe_totals" ></div></td>
200 <group colspan="4" class="oe_form_group_label_border">
201 <field name="pricelist_id" />
202 <field name="to_invoice" widget="selection" />
205 <!-- <notebook position="inside">
206 <page string="Invoice Analysis">
207 <separator colspan="4" string="Work Done Stats"/>
209 <field name="total_cost"/>
210 <field name="remaining_ca"/>
211 <field name="ca_invoiced"/>
212 <field name="ca_theorical"/>
214 <field name="hours_quantity"/>
215 <field name="hours_qtt_invoiced"/>
216 <field name="remaining_hours"/>
218 <separator colspan="4" string="Analysis Stats"/>
220 <field name="revenue_per_hour"/>
221 <field name="real_margin"/>
222 <field name="real_margin_rate"/>
223 <field name="theorical_margin"/>
224 <separator colspan="4" string="Key Dates"/>
226 <field name="last_invoice_date"/>
227 <field name="last_worked_invoiced_date"/>
228 <field name="last_worked_date"/>
230 <page string="Stats by month">
231 <field colspan="4" name="month_ids" nolabel="1">
232 <tree string="Month">
233 <field name="month"/>
234 <field name="unit_amount" widget="float_time"/>
238 <page string="Stats by user">
239 <field colspan="4" name="user_ids" nolabel="1">
240 <tree string="Users">
242 <field name="unit_amount" widget="float_time"/>
251 <!-- Add information on Account analytic list for the project management -->
252 <record id="view_account_analytic_account_tree_c2c_2" model="ir.ui.view">
253 <field name="name">account.analytic.account.tree</field>
254 <field name="model">account.analytic.account</field>
255 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
256 <field name="type">tree</field>
257 <field name="arch" type="xml">
258 <field name="quantity" position="replace">
259 <field name="hours_quantity"/>
260 <field name="hours_qtt_non_invoiced"/>
261 <field name="remaining_hours"/>
262 <field name="quantity_max"/>
267 <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
268 <field name="name">account.analytic.account.tree</field>
269 <field name="model">account.analytic.account</field>
270 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
271 <field name="type">tree</field>
272 <field name="arch" type="xml">
273 <field name="date" position="before">
274 <field name="last_invoice_date"/>
275 <field name="ca_to_invoice"/>
280 <record id="template_of_contract_action" model="ir.actions.act_window">
281 <field name="name">Template Of Contract</field>
282 <field name="type">ir.actions.act_window</field>
283 <field name="res_model">account.analytic.account</field>
284 <field name="view_type">form</field>
285 <field name="view_mode">tree,form</field>
286 <field name="domain">[('type','=','template')]</field>
287 <field name="context">{'search_default_type':'template','default_type' : 'template'}</field>
289 <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config" />