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 <record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
33 <field name="name">account.analytic.account.invoice.form.inherit</field>
34 <field name="model">account.analytic.account</field>
35 <field name="type">form</field>
36 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
37 <field eval="18" name="priority"/>
38 <field name="arch" type="xml">
39 <xpath expr='//field[@name="parent_id"]' position='after'>
40 <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'}"/>
42 <xpath expr='//group[@name="project"]' position="after">
43 <group col="6" colspan="3" class="oe_form_group_label_border">
44 <field name="quantity_max"/><label string="/"/> <label string="Remaining"/> <field name="remaining_hours" nolabel="1"/>
47 <xpath expr='//separator[@name="description"]' position='before'>
48 <separator colspan="4" string="Invoicing" name="invoicing"/>
50 <group col="2" colspan="1" class="oe_form_group_label_border">
51 <label string=" "/><label string=" "/>
52 <field name="fix_price_invoices"/>
53 <field name="invoice_on_timesheets"/>
54 <field name="charge_expenses"/>
56 <group col="2" colspan="1">
57 <label string="Est.Tot"/>
58 <label string="Invoiced"/>
59 <field name="amount_max" nolabel="1" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>
61 <group col="2" colspan="1" class="oe_form_group_odd_border">
62 <label string="Remaining"/>
63 <label string="Ready To Invoice"/>
64 <label string="TODO" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>
65 <label string="TODO" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>
67 <group col="2" colspan="1">
68 <label string=" "/><label string=" "/>
69 <button name="%(sale.action_order_form)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('fix_price_invoices','=',0)]}"/>
70 <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)]}"/>
76 <!--<group colspan="4" name="contract_lines" class="oe_form_group_label_border">
77 <table name="contract_data">
79 <th ><div class="oe_field_label" ></div></th>
81 <th ><div class="oe_float_field_view" >Est. Total</div></th>
82 <th ><div class="oe_field_view" >Invoiced</div></th>
83 <th ><div class="oe_field_view" >Remaining</div></th>
84 <th ><div class="oe_float_field_view" >Ready to Invoice</div></th>
87 <th><div class="oe_field_label">Fix price Invoices</div></th>
88 <td><div><field name="so_visible" nolabel="1"/></div></td>
89 <td><div class="oe_float_field_view"><field name="fix_exp_max" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
90 <td><div class="oe_field_view"><field name="ca_invoiced" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
91 <td><div class="oe_field_view"></div></td>
92 <td><div class="oe_float_field_view"><field name="ca_to_invoice" nolabel="1" attrs="{'invisible': [('so_visible','=',0)]}"/></div></td>
93 <td><button class="oe_title_button_right" name="%(sale.action_order_form)d" string="Sales" type="action" context="{'default_project_id': active_id,'search_default_project_id': active_id}" attrs="{'invisible': [('so_visible','=',0)]}"/></td>
94 <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>
97 <th><div class="oe_field_label">Invoice on timesheet</div></th>
98 <td><div><field name="timsheet_visible" nolabel="1"/></div></td>
99 <td><div class="oe_float_field_view" ><field name="timesheet_max" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
100 <td><div class="oe_field_view" ><field name="hours_qtt_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
101 <td><div class="oe_field_view" ></div></td>
102 <td><div class="oe_float_field_view" ><field name="hours_qtt_non_invoiced" nolabel="1" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></div></td>
103 <td><button class="oe_title_button_right" name="%(hr_timesheet_invoice.act_account_analytic_account_2_report_timehsheet_account)d" string="Timesheets" type="action" attrs="{'invisible': [('timsheet_visible','=',0)]}"/></td>
104 <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>
107 <th><div class="oe_field_label" >Charge Expenses</div></th>
108 <td><div><field name="expense_visible" nolabel="1"/></div></td>
109 <td><div class="oe_float_field_view" ><field name="expense_max" nolabel="1" attrs="{'invisible': [('expense_visible','=',0)]}"/></div></td>
110 <td><div class="oe_field_view" ></div></td>
111 <td><div class="oe_field_view" ></div></td>
112 <td><div class="oe_float_field_view"></div></td>
115 <th><div class="oe_field_label" >Total</div></th>
117 <td><div class="oe_totals" ></div></td>
118 <td><div class="oe_totals_view" ></div></td>
119 <td><div class="oe_totals_view" ></div></td>
120 <td><div class="oe_totals" ></div></td>
124 <group colspan="4" class="oe_form_group_label_border">
125 <field name="pricelist_id" />
126 <field name="to_invoice" widget="selection" />
129 <!-- <notebook position="inside">
130 <page string="Invoice Analysis">
131 <separator colspan="4" string="Work Done Stats"/>
133 <field name="total_cost"/>
134 <field name="remaining_ca"/>
135 <field name="ca_invoiced"/>
136 <field name="ca_theorical"/>
138 <field name="hours_quantity"/>
139 <field name="hours_qtt_invoiced"/>
140 <field name="remaining_hours"/>
142 <separator colspan="4" string="Analysis Stats"/>
144 <field name="revenue_per_hour"/>
145 <field name="real_margin"/>
146 <field name="real_margin_rate"/>
147 <field name="theorical_margin"/>
148 <separator colspan="4" string="Key Dates"/>
150 <field name="last_invoice_date"/>
151 <field name="last_worked_invoiced_date"/>
152 <field name="last_worked_date"/>
154 <page string="Stats by month">
155 <field colspan="4" name="month_ids" nolabel="1">
156 <tree string="Month">
157 <field name="month"/>
158 <field name="unit_amount" widget="float_time"/>
162 <page string="Stats by user">
163 <field colspan="4" name="user_ids" nolabel="1">
164 <tree string="Users">
166 <field name="unit_amount" widget="float_time"/>
175 <!-- Add information on Account analytic list for the project management -->
176 <record id="view_account_analytic_account_tree_c2c_2" model="ir.ui.view">
177 <field name="name">account.analytic.account.tree</field>
178 <field name="model">account.analytic.account</field>
179 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
180 <field name="type">tree</field>
181 <field name="arch" type="xml">
182 <field name="quantity" position="replace">
183 <field name="hours_quantity"/>
184 <field name="hours_qtt_non_invoiced"/>
185 <field name="remaining_hours"/>
186 <field name="quantity_max"/>
191 <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
192 <field name="name">account.analytic.account.tree</field>
193 <field name="model">account.analytic.account</field>
194 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
195 <field name="type">tree</field>
196 <field name="arch" type="xml">
197 <field name="date" position="before">
198 <field name="last_invoice_date"/>
199 <field name="ca_to_invoice"/>
204 <record id="template_of_contract_action" model="ir.actions.act_window">
205 <field name="name">Template Of Contract</field>
206 <field name="type">ir.actions.act_window</field>
207 <field name="res_model">account.analytic.account</field>
208 <field name="view_type">form</field>
209 <field name="view_mode">tree,form</field>
210 <field name="domain">[('type','=','template')]</field>
211 <field name="context">{'search_default_type':'template','default_type' : 'template'}</field>
213 <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config" />