[IMP] improve Accounting reports wizards and Supplier invoice/refund.
[odoo/odoo.git] / addons / account / account_invoice_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- Invoices -->
6         <record id="view_invoice_line_calendar" model="ir.ui.view">
7             <field name="name">account.invoice.calendar</field>
8             <field name="model">account.invoice</field>
9             <field name="type">calendar</field>
10             <field name="arch" type="xml">
11                 <calendar string="Invoices" color="journal_id" date_start="date_invoice">
12                     <field name="partner_id"/>
13                     <field name="amount_total"/>
14                 </calendar>
15             </field>
16         </record>
17
18         <record model="ir.ui.view" id="view_invoice_graph">
19             <field name="name">account.invoice.graph</field>
20             <field name="model">account.invoice</field>
21             <field name="type">graph</field>
22             <field name="arch" type="xml">
23                 <graph string="Invoices" type="bar">
24                     <field name="partner_id"/>
25                     <field name="amount_total" operator="+"/>
26                 </graph>
27             </field>
28         </record>
29
30         <record id="view_invoice_line_tree" model="ir.ui.view">
31             <field name="name">account.invoice.line.tree</field>
32             <field name="model">account.invoice.line</field>
33             <field name="type">tree</field>
34             <field name="arch" type="xml">
35                 <tree string="Invoice Line">
36                     <field name="name"/>
37                     <field name="account_id" groups="account.group_account_user"/>
38                     <field name="quantity"/>
39                     <field name="uos_id" groups="product.group_uom"/>
40                     <field name="price_unit"/>
41                     <field name="discount" groups="sale.group_discount_per_so_line"/>
42                     <field name="price_subtotal"/>
43                 </tree>
44             </field>
45         </record>
46
47         <record id="view_invoice_line_form" model="ir.ui.view">
48             <field name="name">account.invoice.line.form</field>
49             <field name="model">account.invoice.line</field>
50             <field name="type">form</field>
51             <field name="arch" type="xml">
52                 <form string="Invoice Line" version="7.0">
53                     <group>
54                         <group>
55                           <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
56                           <field name="name"/>
57                           <label string="Quantity" for="quantity" align="1.0"/>
58                           <div>
59                              <field name="quantity" class="oe_inline"/>
60                              <field name="uos_id" class="oe_inline"
61                                on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
62                           </div>
63                           <field name="price_unit"/>
64                           <field name="discount"/>
65                         </group>
66                         <group>
67                            <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
68                            <field name="company_id" groups="base.group_multi_company" readonly="1"/>
69                            <field name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
70                            <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
71                         </group>
72                     </group>
73                     <separator string="Notes"/>
74                     <field name="note"/>
75                 </form>
76             </field>
77         </record>
78
79         <record id="view_invoice_tax_tree" model="ir.ui.view">
80             <field name="name">account.invoice.tax.tree</field>
81             <field name="model">account.invoice.tax</field>
82             <field name="type">tree</field>
83             <field name="arch" type="xml">
84                 <tree string="Manual Invoice Taxes">
85                     <field name="sequence"/>
86                     <field name="manual"/>
87                     <field name="name"/>
88                     <field name="account_id" groups="base.group_account_user"/>
89                     <field name="base"/>
90                     <field name="amount"/>
91                 </tree>
92             </field>
93         </record>
94
95         <record id="view_invoice_tax_form" model="ir.ui.view">
96             <field name="name">account.invoice.tax.form</field>
97             <field name="model">account.invoice.tax</field>
98             <field name="type">form</field>
99             <field name="arch" type="xml">
100                 <form string="Manual Invoice Taxes" version="7.0">
101                     <group col="4">
102                         <field name="name"/>
103                         <field name="sequence"/>
104                         <field name="account_id" groups="account.group_account_user"/>
105                         <field name="manual"/>
106                         <field name="amount"/>
107                         <field name="base" readonly="0"/>
108                         <separator colspan="4" string="Tax Codes"/>
109                         <field name="base_code_id"/>
110                         <field name="base_amount"/>
111                         <field name="tax_code_id"/>
112                         <field name="tax_amount"/>
113                         <field name="factor_base" invisible="True"/>
114                         <field name="factor_tax" invisible="True"/>
115                     </group>
116                 </form>
117             </field>
118         </record>
119
120         <record id="invoice_tree" model="ir.ui.view">
121             <field name="name">account.invoice.tree</field>
122             <field name="model">account.invoice</field>
123             <field name="type">tree</field>
124             <field name="arch" type="xml">
125                 <tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
126                     <field name="date_invoice"/>
127                     <field name="number"/>
128                     <field name="partner_id" groups="base.group_user"/>
129                     <field name="reference" invisible="1"/>
130                     <field name="name" invisible="1"/>
131                     <field name="journal_id" invisible="1"/>
132                     <field name="period_id" invisible="1" groups="account.group_account_user"/>
133                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
134                     <field name="user_id"/>
135                     <field name="date_due"/>
136                     <field name="origin"/>
137                     <field name="currency_id"/>
138                     <field name="residual" sum="Residual Amount"/>
139                     <field name="amount_untaxed" sum="Untaxed Amount"/>
140                     <field name="amount_total" sum="Total Amount"/>
141                     <field name="state"/>
142                 </tree>
143             </field>
144         </record>
145
146         <record id="invoice_supplier_form" model="ir.ui.view">
147             <field name="name">account.invoice.supplier.form</field>
148             <field name="model">account.invoice</field>
149             <field name="type">form</field>
150             <field name="priority">2</field>
151             <field name="arch" type="xml">
152                 <form version="7.0">
153                 <header>
154                     <span groups="base.group_user">
155                         <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight"/>
156                         <button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' />
157                         <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
158                         <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
159                         <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
160                     </span>
161                     <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
162                 </header>
163                 <sheet string="Supplier Invoice">
164                   <div class="oe_title">
165                   <h1>
166                      <label string="Draft Invoice/ref " attrs="{'invisible': [('state','not in',('draft',))]}"/>
167                      <label string="Pro Forma Invoice " attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
168                      <label string="Invoice " attrs="{'invisible': [('state','in',('draft','proforma','proforma2'))]}"/>
169                      <span attr="{'invisible': [('origin','=',False)]}"> - </span> 
170                      <field name="origin" placeholder="PO 002" class="oe_inline"/>
171                      <field name="number" readonly="1" class="oe_inline"/>
172                   </h1>
173                     </div>
174                     <group>
175                        <group>
176                          <field string="Supplier" name="partner_id"
177                               on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
178                               context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
179                               domain="[('supplier', '=', True)]"/>
180                           <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
181                           <field name="reference_type" class="oe_inline" nolabel="1"/>
182                          <div>
183                           <field name="reference" placeholder="Payment Reference" class="oe_inline"/>
184                          </div>
185                        </group>
186                        <group>
187                           <field name="date_invoice"/>
188                           <field name="date_due"/>
189                           <field name="fiscal_position" widget="selection"/>
190                           <field name="currency_id"/>
191                           <field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"
192                                  groups="account.group_account_user"/>
193                           <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
194                                  name="account_id" groups="account.group_account_user"/>
195                           <field name="type" invisible="1"/>
196                         </group>
197                     </group>
198                     <notebook>
199                         <page string="Invoice">
200                             <field context="{'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line">
201                                 <tree string="Invoice lines">
202                                     <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
203                                     <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)" groups="base.group_account_user"/>
204                                     <field name="invoice_line_tax_id" view_mode="2" context="{'type':parent.type}" domain="[('parent_id','=',False)]"/>
205                                     <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
206                                     <field name="quantity"/>
207                                     <field name="price_unit"/>
208                                     <field name="price_subtotal"/>
209                                     <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)" invisible="1"/>
210                                     <!-- Removed if subtotal is set -->
211                                     <field name="name" invisible="1"/>
212                                     <field name="uos_id" invisible="1"/>
213                                 </tree>
214                             </field>
215                             <group>
216                                 <div>
217                                     <field name="tax_line">
218                                         <tree editable="bottom" string="Taxes">
219                                             <field name="name"/>
220                                             <field name="account_id" groups="account.group_account_invoice"/>
221                                             <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
222                                             <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
223
224                                             <field invisible="True" name="base_amount"/>
225                                             <field invisible="True" name="tax_amount"/>
226                                             <field name="factor_base" invisible="True"/>
227                                             <field name="factor_tax" invisible="True"/>
228                                         </tree>
229                                     </field>
230                                 </div>
231                                 <group class="oe_subtotal_footer">
232                                     <field name="amount_untaxed"/>
233                                     <button colspan="2" name="button_reset_taxes" states="draft" string="Compute Taxes" type="object" icon="terp-stock_format-scientific" help="This action will erase taxes"/>
234                                     <field name="amount_tax"/>
235                                     <field name="amount_total" class="oe_subtotal_footer_separator"/>
236                                     <field name="residual" style="margin-top: 10px"/>
237                                     <field name="reconciled" invisible="1"/>
238                                 </group>
239                             </group>
240                             <label for="comment" string="Terms and Conditions"/>
241                             <field name="comment"/>
242                         </page>
243                         <page string="Other Info">
244                            <group>
245                              <group>
246                                <field name="payment_term" widget="selection"/>
247                                <field name="move_id" groups="account.group_account_user"/>
248                                <field name="period_id" domain="[('state', '=', 'draft')]"
249                                 groups="account.group_account_user" widget="selection"/>
250                              </group>
251                              <group>
252                                <field name="user_id"/>
253                                 <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
254                              </group>
255                            </group> 
256                         </page>
257                         <page string="Payments">
258                             <field name="payment_ids">
259                                 <tree string="Payments">
260                                     <field name="date" string="Payment Date"/>
261                                     <field name="move_id"/>
262                                     <field name="ref"/>
263                                     <field name="name"/>
264                                     <field name="journal_id"/>
265                                     <field name="debit"/>
266                                     <field name="credit"/>
267                                     <field name="amount_currency"/>
268                                     <field name="currency_id"/>
269                                 </tree>
270                             </field>
271                         </page>
272                     </notebook>
273                 </sheet>
274                 <footer>
275                     <field name="message_ids" widget="mail_thread"/>
276                 </footer>
277                 </form>
278             </field>
279         </record>
280
281         <record id="invoice_form" model="ir.ui.view">
282             <field name="name">account.invoice.form</field>
283             <field name="model">account.invoice</field>
284             <field name="type">form</field>
285             <field name="arch" type="xml">
286                 <form version="7.0">
287                 <header>
288                     <span groups="base.group_user">
289                         <button name="action_invoice_sent" type="object" string="Send by Email" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}" class="oe_highlight"/>
290                         <button name="invoice_print" string="Print Invoice" type="object" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}" class="oe_highlight"/>
291                         <button name="invoice_open" states="draft" string="Validate" class="oe_highlight"/>
292                         <button name="invoice_open" states="proforma2" string="Validate"/>
293                         <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
294                         <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='paid'/>
295                         <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
296                         <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object"/>
297                         <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
298                         <!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
299                     </span>
300                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
301                 </header>
302                 <sheet string="Invoice">
303                     <h1>
304                         <label string="Draft Invoice " attrs="{'invisible': [('state','not in',('draft',))]}"/>
305                         <label string="Pro Forma Invoice " attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
306                         <label string="Invoice " attrs="{'invisible': [('state','in',('draft','proforma','proforma2'))]}"/>
307                         <field name="number" readonly="1" class="oe_inline"/>
308                     </h1>
309                     <label string="Concerns" for="name" class="oe_edit_only"/>
310                     <h2>
311                         <field name="name" placeholder="Project XYZ"/>
312                     </h2>
313                     <field name="type" invisible="1"/>
314                     <group>
315                         <group>
316                             <field string="Customer" name="partner_id"
317                                 on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
318                                 groups="base.group_user" context="{'search_default_customer': 1}"
319                                 domain="[('customer', '=', True)]"/>
320                             <field name="fiscal_position" widget="selection" />
321                             <field name="payment_term" widget="selection"/>
322                         </group>
323                         <group>
324                             <field name="date_invoice"/>
325                             <field name="period_id" domain="[('state', '=', 'draft')]"
326                                 groups="account.group_account_user" widget="selection"/>
327                             <field name="journal_id" groups="account.group_account_user"
328                                 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
329                             <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"
330                                 name="account_id" groups="account.group_account_user"/>
331
332                             <label for="currency_id"/>
333                             <div>
334                                 <field name="currency_id" class="oe_inline"/>
335                                 <button name="%(action_account_change_currency)d" type="action"
336                                   icon="terp-stock_effects-object-colorize"
337                                   attrs="{'invisible':[('state','!=','draft')]}"
338                                   groups="account.group_account_user"/>
339                             </div>
340                         </group>
341                     </group>
342                     <field name="sent" invisible="1"/>
343                     <notebook colspan="4">
344                         <page string="Invoice">
345                             <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}"/>
346                             <group>
347                                 <div>
348                                     <field name="tax_line" nolabel="1">
349                                         <tree editable="bottom" string="Taxes">
350                                             <field name="name"/>
351                                             <field name="account_id" groups="account.group_account_user"/>
352                                             <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
353                                             <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
354                                             <field invisible="True" name="base_amount"/>
355                                             <field invisible="True" name="tax_amount"/>
356                                             <field name="factor_base" invisible="True"/>
357                                             <field name="factor_tax" invisible="True"/>
358                                         </tree>
359                                     </field>
360
361                                 </div>
362                                 <group class="oe_subtotal_footer">
363                                     <field name="amount_untaxed"/>
364                                     <button  colspan="2" name="button_reset_taxes" states="draft,proforma2" string="Compute Taxes"
365                                         type="object" groups="account.group_account_user" icon="terp-stock_format-scientific"
366                                         help="This action will erase taxes"/>
367                                     <field name="amount_tax"/>
368                                     <field name="amount_total" class="oe_subtotal_footer_separator"/>
369
370                                     <field name="residual" style="margin-top: 10px" groups="account.group_account_user"/>
371                                     <field name="reconciled" invisible="1"/>
372                                 </group>
373                             </group>
374                         </page>
375                         <page string="Other Info">
376                            <group>
377                              <group>
378                               <field name="user_id"/>
379                               <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
380                               <field name="move_id" groups="account.group_account_user"/>
381                              </group>
382                              <group>
383                                 <field name="origin" placeholder="SO0032"/>
384                                 <field name="date_due"/>
385                                 <newline/>
386                                 <field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id"/>
387                              </group>
388                            </group> 
389                             <field name="comment" placeholder="Terms and Conditions."/>
390                         </page>
391                         <page string="Payments" groups="base.group_user">
392                             <field name="payment_ids">
393                                 <tree string="Payments">
394                                     <field name="date"/>
395                                     <field name="move_id"/>
396                                     <field name="ref"/>
397                                     <field name="name"/>
398                                     <field name="journal_id" groups="base.group_user"/>
399                                     <field name="debit"/>
400                                     <field name="credit"/>
401                                     <field name="amount_currency"/>
402                                     <field name="currency_id"/>
403                                 </tree>
404                             </field>
405                         </page>
406                     </notebook>
407                 </sheet>
408                 <footer>
409                     <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
410                 </footer>
411                 </form>
412             </field>
413         </record>
414
415         <record id="view_account_invoice_filter" model="ir.ui.view">
416             <field name="name">account.invoice.select</field>
417             <field name="model">account.invoice</field>
418             <field name="type">search</field>
419             <field name="arch" type="xml">
420                 <search string="Search Invoice">
421                     <group>
422                         <field name="number"
423                             string="Invoice"
424                             filter_domain="['|', ('number','ilike',self),('origin','ilike',self)]"/>
425                         <separator orientation="vertical"/>
426                         <filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
427                         <filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/>
428                         <filter name="invoices" icon="terp-dolar" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
429                         <separator orientation="vertical"/>
430                         <filter name="unpaid" icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
431                         <separator orientation="vertical"/>
432                         <filter domain="[('user_id','=',uid)]" help="My Invoices" icon="terp-personal"/>
433                         <separator orientation="vertical"/>
434                         <field name="partner_id"/>
435                         <field name="user_id" widget="selection" string="Salesperson"/>
436                         <field name="journal_id" widget="selection"/>
437                         <field name="period_id" string="Period"/>
438                     </group>
439                     <newline/>
440                     <group expand="0" string="Group By...">
441                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
442                         <filter string="Responsible" icon="terp-personal" domain="[]"  context="{'group_by':'user_id'}"/>
443                         <separator orientation="vertical"/>
444                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
445                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
446                         <separator orientation="vertical"/>
447                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
448                         <filter string="Invoice Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_invoice'}"/>
449                         <filter string="Due Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_due'}"/>
450                     </group>
451                </search>
452             </field>
453         </record>
454
455         <record id="action_invoice_tree" model="ir.actions.act_window">
456             <field name="name">Invoices</field>
457             <field name="res_model">account.invoice</field>
458             <field name="view_type">form</field>
459             <field name="view_mode">tree,form,calendar,graph</field>
460             <field name="view_id" ref="invoice_tree"/>
461             <field name="context">{'type':'out_invoice'}</field>
462             <field name="search_view_id" ref="view_account_invoice_filter"/>
463         </record>
464
465         <record id="action_invoice_tree_pending_invoice" model="ir.actions.act_window">
466             <field name="name">Pending Invoice</field>
467             <field name="res_model">account.invoice</field>
468             <field name="view_type">form</field>
469             <field name="view_mode">tree,form,calendar,graph</field>
470             <field name="view_id" ref="invoice_tree"/>
471             <field name="context">{'type':'out_invoice'}</field>
472             <field name="domain">[('state','=','draft')]</field>
473            <!-- <field name="search_view_id" ref="view_account_invoice_filter"/>-->
474         </record>
475
476         <record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
477             <field eval="1" name="sequence"/>
478             <field name="view_mode">tree</field>
479             <field name="act_window_id" ref="action_invoice_tree"/>
480         </record>
481
482         <record id="action_invoice_tree_view2" model="ir.actions.act_window.view">
483             <field eval="2" name="sequence"/>
484             <field name="view_mode">form</field>
485             <field name="view_id" ref="invoice_form"/>
486             <field name="act_window_id" ref="action_invoice_tree"/>
487         </record>
488
489         <record id="action_invoice_tree1" model="ir.actions.act_window">
490             <field name="name">Customer Invoices</field>
491             <field name="res_model">account.invoice</field>
492             <field name="view_type">form</field>
493             <field name="view_mode">tree,form,calendar,graph</field>
494             <field eval="False" name="view_id"/>
495             <field name="domain">[('type','=','out_invoice')]</field>
496             <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
497             <field name="search_view_id" ref="view_account_invoice_filter"/>
498             <field name="help">
499                 Click here to create a new Invoice.
500                 &lt;p&gt;
501                 An invoice can be generated automatically from a sale order or a delivery order.
502                 The invoice can be send by email.
503             </field>
504         </record>
505
506
507         <record id="action_invoice_tree1_view1" model="ir.actions.act_window.view">
508             <field eval="1" name="sequence"/>
509             <field name="view_mode">tree</field>
510             <field name="act_window_id" ref="action_invoice_tree1"/>
511         </record>
512
513         <record id="action_invoice_tree1_view2" model="ir.actions.act_window.view">
514             <field eval="2" name="sequence"/>
515             <field name="view_mode">form</field>
516             <field name="view_id" ref="invoice_form"/>
517             <field name="act_window_id" ref="action_invoice_tree1"/>
518         </record>
519
520         <menuitem action="action_invoice_tree1" id="menu_action_invoice_tree1" parent="menu_finance_receivables"/>
521
522         <record id="action_invoice_tree2" model="ir.actions.act_window">
523             <field name="name">Supplier Invoices</field>
524             <field name="res_model">account.invoice</field>
525             <field name="view_type">form</field>
526             <field name="view_mode">tree,form,calendar,graph</field>
527             <field eval="False" name="view_id"/>
528             <field name="domain">[('type','=','in_invoice')]</field>
529             <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
530             <field name="search_view_id" ref="view_account_invoice_filter"/>
531             <field name="help">
532                 Click here to create Supplier invoice.
533                 &lt;p&gt;
534                 You can control the invoice from your supplier according to what you purchased or received.
535                 OpenERP can also generate draft invoices automatically from purchase orders or receipts.
536             </field>
537         </record>
538         <menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
539
540         <record id="action_invoice_tree3" model="ir.actions.act_window">
541             <field name="name">Customer Refunds</field>
542             <field name="res_model">account.invoice</field>
543             <field name="view_type">form</field>
544             <field name="view_mode">tree,form,calendar,graph</field>
545             <field eval="False" name="view_id"/>
546             <field name="domain">[('type','=','out_refund')]</field>
547             <field name="context">{'default_type':'out_refund', 'type':'out_refund', 'journal_type': 'sale_refund'}</field>
548             <field name="search_view_id" ref="view_account_invoice_filter"/>
549             <field name="help">
550                 Click here to create a new customer refund.
551                 &lt;p&gt;
552                 A refund is a document that credits an invoice completely or partially.
553                 You can also generate refunds and reconcile them directly from the invoice form.
554             </field>
555         </record>
556
557         <record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
558             <field eval="1" name="sequence"/>
559             <field name="view_mode">tree</field>
560             <field name="act_window_id" ref="action_invoice_tree3"/>
561         </record>
562
563         <record id="action_invoice_tree3_view2" model="ir.actions.act_window.view">
564             <field eval="2" name="sequence"/>
565             <field name="view_mode">form</field>
566             <field name="view_id" ref="invoice_form"/>
567             <field name="act_window_id" ref="action_invoice_tree3"/>
568         </record>
569         <menuitem action="action_invoice_tree3" id="menu_action_invoice_tree3" parent="menu_finance_receivables"/>
570
571         <record id="action_invoice_tree4" model="ir.actions.act_window">
572             <field name="name">Supplier Refunds</field>
573             <field name="res_model">account.invoice</field>
574             <field name="view_type">form</field>
575             <field name="view_mode">tree,form,calendar,graph</field>
576             <field eval="False" name="view_id"/>
577             <field name="domain">[('type','=','in_refund')]</field>
578             <field name="context">{'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'}</field>
579             <field name="search_view_id" ref="view_account_invoice_filter"/>
580             <field name="help">
581                 Click here to create a new supplier refund.
582                 &lt;p&gt;
583                 Track refunds you receive from your suppliers.
584                 You can also generate refunds and reconcile them directly from the invoice form.
585             </field>
586         </record>
587         <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
588
589         <act_window context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
590
591         <act_window
592            id="act_account_journal_2_account_invoice_opened"
593            name="Unpaid Invoices"
594            context="{'search_default_journal_id': [active_id], 'search_default_unpaid':1, 'default_journal_id': active_id}"
595            res_model="account.invoice"
596            src_model="account.journal"/>
597
598     </data>
599 </openerp>