[MERGE] addons 16 survey
[odoo/odoo.git] / addons / hr_timesheet_invoice / hr_timesheet_invoice_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record id="account_analytic_account_form_form" model="ir.ui.view">
5             <field name="name">account.analytic.account.invoice.form</field>
6             <field name="model">account.analytic.account</field>
7             <field name="priority">30</field>
8             <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
9             <field name="arch" type="xml">
10                 <xpath expr='//separator[@name="description"]' position='before'>
11                     <group string="Invoice on Timesheets Options" name="invoice_on_timesheets" col="4">
12                         <field name="pricelist_id" groups="product.group_sale_pricelist"/>
13                         <field name="to_invoice"/>
14                     </group>
15                  </xpath>
16                 <xpath expr="//field[@name='use_timesheets']" position="replace">
17                     <field name="use_timesheets" on_change="on_change_use_timesheets(use_timesheets, context)"/>
18                 </xpath>
19                 <xpath expr="/form/sheet" position='before'>
20                     <header>
21                         <button name="set_pending" string="Pending" type="object" states="open" />
22                         <button name="set_close" string="Contract Finished" type="object" states="open,pending" />
23                         <button name="set_open" string="Re-open project" type="object" states="pending,close" />
24                         <button name="set_open" string="Re-open project" type="object" states="cancelled,draft"/>
25                         <button name="set_cancel" string="Cancel Contract" type="object" states="open,pending"/>
26                         <field name="state" readonly="1" widget="statusbar"
27                             statusbar_visible="open,pending,close" statusbar_colors='{"pending":"red", "template":"blue"}'/>
28                     </header>
29                 </xpath>
30             </field>
31         </record>
32
33         <record id="hr_timesheet_line_form" model="ir.ui.view">
34             <field name="name">hr.analytic.timesheet.form</field>
35             <field name="model">hr.analytic.timesheet</field>
36             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
37             <field name="arch" type="xml">
38                 <xpath expr="//group[@string='Accounting']" position='after'>
39                     <group string="Invoicing">
40                         <field name="to_invoice"/>
41                         <field name="invoice_id"/>
42                     </group>
43                 </xpath>
44             </field>
45         </record>
46
47         <record id="hr_timesheet_line_form2" model="ir.ui.view">
48             <field name="name">hr.analytic.timesheet.form2</field>
49             <field name="model">hr.analytic.timesheet</field>
50             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
51             <field name="arch" type="xml">
52                 <field name="account_id" position="replace">
53                     <field domain="[('type','in',['normal','contract']),('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
54                 </field>
55             </field>
56         </record>
57
58         <record id="hr_timesheet_line_tree" model="ir.ui.view">
59             <field name="name">hr.analytic.timesheet.tree</field>
60             <field name="model">hr.analytic.timesheet</field>
61             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
62             <field name="arch" type="xml">
63                 <field name="amount" position="after">
64                     <field name="to_invoice"/>
65                 </field>
66             </field>
67         </record>
68
69         <record id="hr_timesheet_line_tree2" model="ir.ui.view">
70             <field name="name">hr.analytic.timesheet.tree2</field>
71             <field name="model">hr.analytic.timesheet</field>
72             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
73             <field name="arch" type="xml">
74                 <field name="account_id" position="replace">
75                     <field domain="[('type','in',['normal','contract']),('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
76                 </field>
77             </field>
78         </record>
79
80         <!-- Inherits for account analytic lines -->
81         <record id="view_account_analytic_line_search_inherit" model="ir.ui.view">
82             <field name="name">account.analytic.line.search.to_invoice</field>
83             <field name="model">account.analytic.line</field>
84             <field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
85             <field name="arch" type="xml">
86                 <xpath expr="//filter[@name='others']" position="after">
87                     <separator/>
88                     <filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/>
89                     <filter name="invoiced" string="Invoiced" domain="[('invoice_id','!=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/> 
90                 </xpath>
91             </field>
92         </record>
93
94         <record id="view_hr_timesheet_line_search_to_invoice" model="ir.ui.view">
95             <field name="name">hr.analytic.timesheet.search.to_invoice</field>
96             <field name="model">hr.analytic.timesheet</field>
97             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
98             <field name="arch" type="xml">
99                 <xpath expr="//field[@name='account_id']" position="after">
100                     <separator/>
101                     <filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/>
102                     <filter name="invoiced" string="Invoiced" domain="[('invoice_id','!=',False), ('to_invoice','&lt;&gt;',False)]" icon="terp-dolar"/> 
103                 </xpath>
104             </field>
105         </record>
106
107
108         <record id="view_account_analytic_line_tree_inherit" model="ir.ui.view">
109             <field name="name">account.analytic.line.tree.to_invoice</field>
110             <field name="model">account.analytic.line</field>
111             <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
112             <field name="arch" type="xml">
113                 <field name="account_id" position="after">
114                     <field name="to_invoice"/>
115                 </field>
116             </field>
117         </record>
118           <record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
119             <field name="name">account.analytic.line.form.to_invoice</field>
120             <field name="model">account.analytic.line</field>
121             <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
122             <field name="arch" type="xml">
123                 <field name="amount" position="before">
124                     <field name="to_invoice"/>
125                     <field name="invoice_id"/>
126                 </field>
127             </field>
128         </record>
129
130         <!-- Menus -->
131         <record id="action_hr_analytic_timesheet_open_tree" model="ir.actions.act_window">
132             <field name="name">Invoice Tasks Work</field>
133             <field name="res_model">account.analytic.line</field>
134             <field name="view_type">form</field>
135             <field name="view_mode">tree,form</field>
136             <field name="domain">[]</field>
137             <field name="context">{'search_default_to_invoice': 1}</field>
138             <field name="search_view_id" ref="account.view_account_analytic_line_filter"/>            
139             <field name="help" type="html">
140               <p class="oe_view_nocontent_create">
141                 Click to add some tasks work to be invoiced.
142               </p><p>
143                 This list shows every task you can invoice to the customer.
144                 Select the lines and invoice from the '<i>more...</i>' contextual
145                 menu to generate invoices automatically.
146               </p>
147             </field>
148         </record>
149         <menuitem
150             action="action_hr_analytic_timesheet_open_tree"
151             id="menu_hr_analytic_timesheet_tree"
152             parent="account.menu_finance_periodical_processing_billing"
153             sequence="1"/>
154
155         <record id="view_hr_timesheet_invoice_factor_search" model="ir.ui.view">
156             <field name="name">hr_timesheet_invoice.factor.search</field>
157             <field name="model">hr_timesheet_invoice.factor</field>
158             <field name="arch" type="xml">
159                 <search string="Type of invoicing">
160                     <field name="name" string="Type of invoicing"/>
161                 </search>
162             </field>
163         </record>
164         <record id="view_hr_timesheet_invoice_factor_form" model="ir.ui.view">
165             <field name="name">hr_timesheet_invoice.factor.form</field>
166             <field name="model">hr_timesheet_invoice.factor</field>
167             <field name="arch" type="xml">
168                 <form string="Type of invoicing" version="7.0">
169                     <group col="4">
170                         <field name="name"/>
171                         <field name="customer_name"/>
172                         <field name="factor"/>
173                     </group>
174                 </form>
175             </field>
176         </record>
177         <record id="view_hr_timesheet_invoice_factor_tree" model="ir.ui.view">
178             <field name="name">hr_timesheet_invoice.factor.tree</field>
179             <field name="model">hr_timesheet_invoice.factor</field>
180             <field name="arch" type="xml">
181                 <tree string="Types of invoicing">
182                     <field name="name"/>
183                     <field name="customer_name"/>
184                     <field name="factor"/>
185                 </tree>
186             </field>
187         </record>
188         <record id="action_hr_timesheet_invoice_factor_form" model="ir.actions.act_window">
189             <field name="name">Types of Invoicing</field>
190             <field name="type">ir.actions.act_window</field>
191             <field name="res_model">hr_timesheet_invoice.factor</field>
192             <field name="view_type">form</field>
193             <field name="view_id" ref="view_hr_timesheet_invoice_factor_tree"/>
194             <field name="search_view_id" ref="view_hr_timesheet_invoice_factor_search"/>
195             <field name="help" type="html">
196               <p class="oe_view_nocontent_create">
197                 Click to add a new type of invoicing.
198               </p><p>
199                 OpenERP allows you to create default invoicing types. You might
200                 have to regularly assign discounts because of a specific
201                 contract or agreement with a customer. From this menu, you can
202                 create additional types of invoicing to speed up your
203                 invoicing.
204               </p>
205             </field>
206         </record>
207         <menuitem
208             action="action_hr_timesheet_invoice_factor_form"
209             id="hr_timesheet_invoice_factor_view"
210             parent="account.menu_configuration_misc" sequence="25" groups="base.group_no_one"/>
211
212     </data>
213 </openerp>