1 <?xml version="1.0" encoding="utf-8"?>
4 <record model="ir.actions.act_window" id="action_sales_order">
5 <field name="name">Sales Orders</field>
6 <field name="res_model">sale.order</field>
7 <field name="src_model">account.analytic.account</field>
10 <!-- Inherited Analytic Account form for contracts -->
11 <record id="account_analytic_account_form_form" model="ir.ui.view">
12 <field name="name">account.analytic.account.invoice.form.inherit</field>
13 <field name="model">account.analytic.account</field>
14 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
15 <field eval="40" name="priority"/>
16 <field name="arch" type="xml">
17 <xpath expr='//div[@name="duration"]' position="after" version="7.0">
18 <label for="quantity_max"/>
20 <field name="quantity_max"/>
21 <div attrs="{'invisible': [('hours_quantity','=',0)]}" class="oe_grey">
22 <field name="hours_quantity" class="oe_inline"/> Units Consumed
24 <div attrs="{'invisible': [('quantity_max','=',0)]}" class="oe_grey">
25 <field name="remaining_hours" class="oe_inline"/> Units Remaining
29 <xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
31 <xpath expr='//separator[@name="description"]' position='before'>
32 <separator name="toinvoice" string="Invoicing"/>
33 <table class="oe_form_analytic_account">
35 <th class="oe_timesheet_grey" width="160px"></th>
36 <th class="oe_timesheet_grey" width="25px"></th>
37 <th class="oe_timesheet_grey" width="100px"><label string="Expected"/></th>
38 <th class="oe_timesheet_grey" width="100px"><label string="Invoiced"/></th>
39 <th class="oe_timesheet_grey" width="100px"><label string="Remaining"/></th>
40 <th class="oe_timesheet_grey" width="100px"><label string="To Invoice"/></th>
41 <th width="30px"></th>
44 <td class="oe_timesheet_grey">
45 <label for="fix_price_invoices"/>
46 </td><td class="oe_timesheet_grey">
47 <field name="fix_price_invoices" class="oe_inline"/>
49 <field class="oe_inline" name="amount_max" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
51 <field class="oe_inline" name="ca_invoiced" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
53 <field class="oe_inline" name="remaining_ca" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
55 <field class="oe_inline" name="fix_price_to_invoice" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
56 </td><td attrs="{'invisible': [('fix_price_invoices','=',False)]}" class="oe_timesheet_action">
57 <span attrs="{'invisible': [('fix_price_to_invoice','=',0.0)]}" class="oe_grey">
58 <button name="open_sale_order_lines"
60 string="⇒ To invoice" type="object"
61 context="{'default_partner_id': [partner_id],'default_project_id': active_id,'search_default_uninvoiced': 1,'search_default_project_id': active_id,'search_default_partner_id': [partner_id]}"/>
65 <span attrs="{'invisible': ['|',('fix_price_to_invoice','<>',0.0 ),('partner_id','=',False)]}" class="oe_grey">
66 No order to invoice, create
68 <button name="%(action_sales_order)d" string="Sale Orders"
71 context="{'default_partner_id': [partner_id], 'search_default_project_id': [active_id],'default_project_id': [active_id]}"
75 <td class="oe_timesheet_grey">
76 <label for="invoice_on_timesheets"/>
77 </td><td class="oe_timesheet_grey">
78 <field name="invoice_on_timesheets"/>
80 <field class="oe_inline" name="hours_qtt_est" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
82 <field class="oe_inline" name="timesheet_ca_invoiced" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
84 <field class="oe_inline" name="remaining_hours_to_invoice" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
86 <field class="oe_inline" name="ca_to_invoice" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
87 </td><td class="oe_timesheet_action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
88 <span attrs="{'invisible': [('ca_to_invoice','=',0.0)]}" class="oe_grey">
89 <button name="%(hr_timesheet_invoice.action_hr_timesheet_invoice_create_final)d"
95 <span attrs="{'invisible': [('ca_to_invoice','<>',0.0)]}" class="oe_grey">
96 Nothing to invoice, create
99 <button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d"
100 string="Timesheets" type="action"
102 context="{'default_account_id': active_id,'search_default_account_id': active_id}"/>
104 </tr><tr name='total'>
105 <th class="oe_timesheet_grey">
106 <label string="Total"/>
107 </th><td class="oe_timesheet_grey">
108 </td><td class="oe_timesheet_grey">
109 <field name="est_total" class="oe_inline" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
110 </td><td class="oe_timesheet_grey">
111 <field name="invoiced_total" class="oe_inline"/>
112 </td><td class="oe_timesheet_grey">
113 <field name="remaining_total" class="oe_inline"/>
114 </td><td class="oe_timesheet_grey">
115 <field name="toinvoice_total" class="oe_inline"/>
120 <group name='invoice_on_timesheets' attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
121 <p class="oe_grey oe_edit_only" colspan="2">
122 When invoicing on timesheet, OpenERP uses the
123 pricelist of the contract which uses the price
124 defined on the product related to each employee to
125 define the customer invoice price rate.
128 <field name="pricelist_id"
130 attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
131 <field name="to_invoice"
134 attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
141 <!-- Inherited Analytic Account form for template required -->
142 <record id="view_account_analytic_account_template_required" model="ir.ui.view">
143 <field name="name">account.analytic.account.form.template.required</field>
144 <field name="model">account.analytic.account</field>
145 <field name="groups_id" eval="[(6, 0, [ref('group_template_required')])]"/>
146 <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
147 <field name="arch" type="xml">
148 <field name="template_id" position="attributes">
149 <attribute name="attrs">{'required': [('type','=','contract')], 'invisible': [('type','in',['view', 'normal','template'])]}</attribute>
154 <!-- Inherited Analytic Account list for contracts -->
155 <record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
156 <field name="name">account.analytic.account.list.contract</field>
157 <field name="model">account.analytic.account</field>
158 <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
159 <field name="arch" type="xml">
160 <field name="date_start" position="before">
161 <field name="last_invoice_date"/>
162 <field name="toinvoice_total"/>
163 <field name="remaining_hours"/>
164 <field name="pricelist_id" invisible="1"/>
169 <!-- Analytic Account search view for contract -->
170 <record id="view_account_analytic_account_overdue_search" model="ir.ui.view">
171 <field name="name">account.analytic.account.search</field>
172 <field name="model">account.analytic.account</field>
173 <field name="arch" type="xml">
174 <search string="Contracts">
175 <field name="name" filter_domain="['|', ('name','ilike',self),('code','ilike',self)]" string="Contract"/>
177 <field name="partner_id"/>
178 <field name="manager_id"/>
179 <field name="parent_id"/>
180 <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="Contracts in progress (open, draft)"/>
181 <filter name="pending" string="To Renew" domain="[('state','=','pending')]" help="Pending contracts"/>
182 <filter name="closed" string="Closed" domain="[('state','=','pending')]" help="Closed contracts"/>
183 <filter name="cancelled" string="Cancelled" domain="[('state','=','cancel')]" help="Cancelled contracts"/>
186 string="Expired or consumed"
187 domain="[('state','in',('open','draft','pending')), '|', '&', ('date', '!=', False), ('date', '<=', time.strftime('%%Y-%%m-%%d')), ('is_overdue_quantity', '=', True)]"
188 help="End date passed or prepaid unit consumed" />
190 string="Expiring soon"
191 domain="[('date', '!=', False), ('date', '<=', (context_today() + datetime.timedelta(30)).strftime('%%Y-%%m-%%d') )]"
192 help="End date is in the next month" />
194 <filter string="Customer Contracts" help="Contracts assigned to a customer." name="has_partner" domain="[('partner_id', '!=', False)]"/>
195 <filter string="Contracts not assigned" help="Contracts that are not assigned to an account manager." domain="[('manager_id', '=', False)]"/>
197 <group expand="0" string="Group By...">
198 <filter string="Status" domain="[]" context="{'group_by':'state'}"/>
199 <filter string="Account Manager" domain="[]" context="{'group_by':'manager_id'}"/>
200 <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
201 <filter string="Parent" domain="[]" context="{'group_by':'parent_id'}"/>
202 <filter string="Template" domain="[]" context="{'group_by':'template_id'}"/>
203 <filter string="Start Date" domain="[]" context="{'group_by' : 'date_start'}" />
204 <filter string="End Date" domain="[]" context="{'group_by' : 'date'}" />
205 <filter string="Pricelist" domain="[]" context="{'group_by' : 'pricelist_id'}" />
211 <!-- Action Sales/Sales/Contracts -->
212 <record id="action_account_analytic_overdue_all" model="ir.actions.act_window">
213 <field name="name">Contracts</field>
214 <field name="res_model">account.analytic.account</field>
215 <field name="view_type">form</field>
216 <field name="view_mode">tree,form</field>
217 <field name="context">{'default_type':'contract', 'search_default_open':1, 'search_default_pending':1, 'default_manager_id':uid}</field>
218 <field name="domain">[('type','=','contract')]</field>
219 <field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
220 <field name="help" type="html">
221 <p class="oe_view_nocontent_create">
222 Click to create a new contract.
224 Use contracts to follow tasks, issues, timesheets or invoicing based on
225 work done, expenses and/or sales orders. OpenERP will automatically manage
226 the alerts for the renewal of the contracts to the right salesperson.
230 <menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="1"/>
231 <menuitem action="action_account_analytic_overdue_all" id="menu_action_account_analytic_overdue_all" sequence="7" parent="base.menu_sales"/>
233 <!-- Action Sales/Invoicing/Time and Material to Invoice -->
234 <record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
235 <field name="name">Time & Materials to Invoice</field>
236 <field name="res_model">account.analytic.line</field>
237 <field name="view_type">form</field>
238 <field name="view_mode">tree,form</field>
239 <field name="domain">[('invoice_id','=',False)]</field>
240 <field name="context">{'search_default_to_invoice': 1, 'search_default_sales': 1}</field>
241 <field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
242 <field name="help" type="html">
244 You will find here timesheets and purchases you did for
245 contracts that can be reinvoiced to the customer. If you want
246 to record new activities to invoice, you should use the timesheet
251 <menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5"/>
252 <menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="base.menu_invoiced" sequence="5"/>
254 <!-- Action Sales/Invoicing/Contract to renew -->
255 <record id="action_account_analytic_overdue" model="ir.actions.act_window">
256 <field name="name">Contracts to Renew</field>
257 <field name="res_model">account.analytic.account</field>
258 <field name="view_type">form</field>
259 <field name="view_mode">tree,form</field>
260 <field name="context">{'search_default_manager_id':uid, 'search_default_pending':1, 'search_default_renew':1}</field>
261 <field name="domain">[('type','=','contract')]</field>
262 <field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
263 <field name="help" type="html">
264 <p class="oe_view_nocontent_create">
265 Click to define a new contract.
267 You will find here the contracts to be renewed because the
268 end date is passed or the working effort is higher than the
269 maximum authorized one.
271 OpenERP automatically sets contracts to be renewed in a pending
272 state. After the negociation, the salesman should close or renew
277 <menuitem action="action_account_analytic_overdue" id="menu_action_account_analytic_overdue" sequence="50" parent="base.menu_invoiced"/>
279 <!-- Action Sales/Configuration/Contract template -->
280 <record id="template_of_contract_action" model="ir.actions.act_window">
281 <field name="name">Contract Template</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>
288 <field name="help" type="html">
289 <p class="oe_view_nocontent_create">
290 Click here to create a template of contract.
292 Templates are used to prefigure contract/project that
293 can be selected by the salespeople to quickly configure the
294 terms and conditions of the contract.
298 <menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config"/>