[IMP] account: invoice form view usability improvement (display 'Refund' in place...
[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                             <label for="quantity"/>
57                             <div>
58                                 <field name="quantity" class="oe_inline"/>
59                                 <field name="uos_id" class="oe_inline" groups="product.group_uom"
60                                   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)"/>
61                             </div>
62                             <field name="price_unit"/>
63                             <field name="discount" groups="sale.group_discount_per_so_line"/>
64                         </group>
65                         <group>
66                             <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="account.group_account_user"/>
67                             <field name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
68                             <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
69                             <field name="company_id" groups="base.group_multi_company" readonly="1"/>
70                         </group>
71                     </group>
72                     <label for="name"/>
73                     <field name="name"/>
74                 </form>
75             </field>
76         </record>
77
78         <record id="view_invoice_tax_tree" model="ir.ui.view">
79             <field name="name">account.invoice.tax.tree</field>
80             <field name="model">account.invoice.tax</field>
81             <field name="type">tree</field>
82             <field name="arch" type="xml">
83                 <tree string="Manual Invoice Taxes">
84                     <field name="sequence"/>
85                     <field name="manual"/>
86                     <field name="name"/>
87                     <field name="account_id" groups="base.group_account_user"/>
88                     <field name="base"/>
89                     <field name="amount"/>
90                 </tree>
91             </field>
92         </record>
93
94         <record id="view_invoice_tax_form" model="ir.ui.view">
95             <field name="name">account.invoice.tax.form</field>
96             <field name="model">account.invoice.tax</field>
97             <field name="type">form</field>
98             <field name="arch" type="xml">
99                 <form string="Manual Invoice Taxes" version="7.0">
100                     <group col="4">
101                         <field name="name"/>
102                         <field name="sequence"/>
103                         <field name="account_id" groups="account.group_account_user"/>
104                         <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" groups="analytic.group_analytic_accounting"/>
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="partner_id" groups="base.group_user"/>
127                     <field name="date_invoice"/>
128                     <field name="number"/>
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" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_invoice')]}"/>
167                             <label string="Draft Refund" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_refund')]}"/>
168                             <label string="Invoice" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_invoice')]}"/>
169                             <label string="Refund" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_refund')]}"/>
170                             <field name="number" class="oe_inline"  attrs="{'invisible': [('state', '=', 'draft')]}"/>
171                         </h1>
172                     </div>
173                     <field name="type" invisible="1"/>
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 name="fiscal_position" widget="selection"/>
181                             <field name="origin"/>
182                                         <label for="reference_type"/>
183                                         <div>
184                                 <field name="reference_type" class="oe_inline oe_edit_only"/>
185                                 <field name="reference" class="oe_inline"/>
186                                         </div>
187                         </group>
188                         <group>
189                             <field name="date_invoice"/>
190                             <field name="date_due"/>
191                             <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
192                                 name="account_id" groups="account.group_account_user"/>
193                             <field name="journal_id" groups="account.group_account_user"
194                                 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
195                             <field name="currency_id"/>
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" editable="bottom">
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 class="oe_subtotal_footer oe_right">
216                                 <field name="amount_untaxed"/>
217                                 <div>
218                                     <label for="amount_tax"/>
219                                     <button name="button_reset_taxes" states="draft,proforma2"
220                                         string="(update)" class="oe_link oe_edit_only"
221                                         type="object" help="Recompute taxes and total"/>
222                                 </div>
223                                 <field name="amount_tax" nolabel="1"/>
224                                 <field name="amount_total" class="oe_subtotal_footer_separator"/>
225
226                                 <field name="residual"/>
227                                 <field name="reconciled" invisible="1"/>
228                             </group>
229                             <div style="width: 50%%">
230                                 <field name="tax_line">
231                                     <tree editable="bottom" string="Taxes">
232                                         <field name="name"/>
233                                         <field name="account_id" groups="account.group_account_invoice"/>
234                                         <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" groups="analytic.group_analytic_accounting"/>
235                                         <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
236                                         <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
237
238                                         <field invisible="True" name="base_amount"/>
239                                         <field invisible="True" name="tax_amount"/>
240                                         <field name="factor_base" invisible="True"/>
241                                         <field name="factor_tax" invisible="True"/>
242                                     </tree>
243                                 </field>
244                             </div>
245                             <div class="oe_clear">
246                                 <label for="comment"/>
247                             </div>
248                             <field name="comment"/>
249                         </page>
250                         <page string="Other Info">
251                             <group>
252                                 <group>
253                                     <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
254                                     <field name="user_id"/>
255                                     <field name="name" invisible="1"/>
256                                     <field name="payment_term" widget="selection"/>
257                                 </group>
258                                 <group>
259                                     <field name="move_id" groups="account.group_account_user"/>
260                                     <field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
261                                     <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"/>
262                                 </group>
263                             </group>
264                         </page>
265                         <page string="Payments">
266                             <field name="payment_ids">
267                                 <tree string="Payments">
268                                     <field name="date" string="Payment Date"/>
269                                     <field name="move_id"/>
270                                     <field name="ref"/>
271                                     <field name="name"/>
272                                     <field name="journal_id"/>
273                                     <field name="debit"/>
274                                     <field name="credit"/>
275                                     <field name="amount_currency"/>
276                                     <field name="currency_id"/>
277                                 </tree>
278                             </field>
279                         </page>
280                     </notebook>
281                 </sheet>
282                 <div class="oe_chatter">
283                     <field name="message_ids" widget="mail_thread"/>
284                 </div>
285                 </form>
286             </field>
287         </record>
288
289         <record id="invoice_form" model="ir.ui.view">
290             <field name="name">account.invoice.form</field>
291             <field name="model">account.invoice</field>
292             <field name="type">form</field>
293             <field name="arch" type="xml">
294                 <form version="7.0">
295                 <header>
296                     <span groups="base.group_user">
297                         <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight"/>
298                         <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight"/>
299                         <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}"/>
300                         <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}"/>
301                         <button name="invoice_open" states="draft" string="Validate" class="oe_highlight"/>
302                         <button name="invoice_open" states="proforma2" string="Validate"/>
303                         <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
304                         <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='paid'/>
305                         <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
306                         <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object"/>
307                         <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."/>
308                         <!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
309                     </span>
310                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
311                 </header>
312                 <sheet string="Invoice">
313                     <h1>
314                         <label string="Draft Invoice " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_invoice')]}"/>
315                         <label string="Draft Refund " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_refund')]}"/>
316                         <label string="Pro Forma Invoice " attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
317                         <label string="Invoice " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_invoice')]}"/>
318                         <label string="Refund " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_refund')]}"/>
319                         <field name="number" readonly="1" class="oe_inline"/>
320                     </h1>
321                     <field name="type" invisible="1"/>
322                     <group>
323                         <group>
324                             <field string="Customer" name="partner_id"
325                                 on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
326                                 groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}"
327                                 options='{"always_reload": true}'/>
328                             <field name="fiscal_position" widget="selection" />
329                         </group>
330                         <group>
331                             <field name="date_invoice"/>
332                             <field name="journal_id" groups="account.group_account_user"
333                                 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
334                             <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"
335                                 name="account_id" groups="account.group_account_user"/>
336
337                             <label for="currency_id"/>
338                             <div>
339                                 <field name="currency_id" class="oe_inline"/>
340                                 <!-- note fp: I don't think we need this feature ?
341                                 <button name="%(action_account_change_currency)d" type="action"
342                                   icon="terp-stock_effects-object-colorize"
343                                   attrs="{'invisible':[('state','!=','draft')]}"
344                                   groups="account.group_account_user"/> -->
345                             </div>
346                         </group>
347                     </group>
348                     <field name="sent" invisible="1"/>
349                     <notebook colspan="4">
350                         <page string="Invoice Lines">
351                             <field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
352                                 <tree string="Invoice Lines" editable="bottom">
353                                     <field name="invoice_line_tax_id" invisible="1"/>
354                                     <field name="product_id" invisible="1"/>
355                                     <field name="name"/>
356                                     <field name="account_id" groups="account.group_account_user"
357                                         domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]"
358                                         on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
359                                     <field name="quantity"/>
360                                     <field name="uos_id" groups="product.group_uom"
361                                         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)"/>
362                                     <field name="price_unit"/>
363                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
364                                     <field name="price_subtotal"/>
365                                 </tree>
366                             </field>
367                             <group class="oe_subtotal_footer oe_right">
368                                 <field name="amount_untaxed"/>
369                                 <div>
370                                     <label for="amount_tax"/>
371                                     <button name="button_reset_taxes" states="draft,proforma2"
372                                         string="(update)" class="oe_link oe_edit_only"
373                                         type="object" help="Recompute taxes and total"/>
374                                 </div>
375                                 <field name="amount_tax" nolabel="1"/>
376                                 <field name="amount_total" class="oe_subtotal_footer_separator"/>
377                                 <field name="residual" groups="account.group_account_user"/>
378                                 <field name="reconciled" invisible="1"/>
379                             </group>
380                             <group>
381                                     <field name="payment_term" class="oe_inline"/>
382                             </group>
383                             <div class="oe_clear">
384                                 <label for="comment"/>
385                             </div>
386                             <field name="comment" class="oe_inline" placeholder="Additional notes..."/>
387                         </page>
388                         <page string="Other Info">
389                             <group col="4">
390                                 <group>
391                                     <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"/>
392                                     <field name="user_id" groups="base.group_user"/>
393                                     <field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id"/>
394                                     <field name="period_id" domain="[('state', '=', 'draft')]"
395                                         groups="account.group_account_manager"
396                                         string="Accounting Period"
397                                         placeholder="force period"/>
398                                     <field name="date_due"/>
399                                 </group>
400                                 <group>
401                                     <field name="origin" groups="base.group_user"/>
402                                     <field name="name" string="Customer Reference"/>
403                                     <field name="move_id" groups="account.group_account_user"/>
404                                 </group>
405                             </group>
406                             <field name="tax_line">
407                                 <tree editable="bottom" string="Taxes">
408                                     <field name="name"/>
409                                     <field name="account_id" groups="account.group_account_user"/>
410                                     <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
411                                     <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
412                                     <field invisible="True" name="base_amount"/>
413                                     <field invisible="True" name="tax_amount"/>
414                                     <field name="factor_base" invisible="True"/>
415                                     <field name="factor_tax" invisible="True"/>
416                                 </tree>
417                             </field>
418                         </page>
419                         <page string="Payments" groups="base.group_user">
420                             <field name="payment_ids">
421                                 <tree string="Payments">
422                                     <field name="date"/>
423                                     <field name="move_id"/>
424                                     <field name="ref"/>
425                                     <field name="name"/>
426                                     <field name="journal_id" groups="base.group_user"/>
427                                     <field name="debit"/>
428                                     <field name="credit"/>
429                                     <field name="amount_currency"/>
430                                     <field name="currency_id"/>
431                                 </tree>
432                             </field>
433                         </page>
434                     </notebook>
435                 </sheet>
436                 <div class="oe_chatter">
437                     <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
438                 </div>
439                 </form>
440             </field>
441         </record>
442
443         <record id="view_account_invoice_filter" model="ir.ui.view">
444             <field name="name">account.invoice.select</field>
445             <field name="model">account.invoice</field>
446             <field name="type">search</field>
447             <field name="arch" type="xml">
448                 <search string="Search Invoice">
449                     <field name="number" string="Invoice" filter_domain="['|', ('number','ilike',self),('origin','ilike',self)]"/>
450                     <filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
451                     <filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/>
452                     <filter name="invoices" icon="terp-dolar" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
453                     <filter name="unpaid" icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
454                     <separator/>
455                     <filter domain="[('user_id','=',uid)]" help="My Invoices" icon="terp-personal"/>
456                     <field name="partner_id"/>
457                     <field name="user_id" string="Salesperson"/>
458                     <field name="journal_id"/>
459                     <field name="period_id" string="Period"/>
460                     <group expand="0" string="Group By...">
461                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
462                         <filter string="Responsible" icon="terp-personal" domain="[]"  context="{'group_by':'user_id'}"/>
463                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
464                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
465                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
466                         <filter string="Invoice Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_invoice'}"/>
467                         <filter string="Due Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_due'}"/>
468                     </group>
469                </search>
470             </field>
471         </record>
472
473         <record id="action_invoice_tree" model="ir.actions.act_window">
474             <field name="name">Invoices</field>
475             <field name="res_model">account.invoice</field>
476             <field name="view_type">form</field>
477             <field name="view_mode">tree,form,calendar,graph</field>
478             <field name="view_id" ref="invoice_tree"/>
479             <field name="context">{'type':'out_invoice'}</field>
480             <field name="search_view_id" ref="view_account_invoice_filter"/>
481         </record>
482
483         <record id="action_invoice_tree_pending_invoice" model="ir.actions.act_window">
484             <field name="name">Pending Invoice</field>
485             <field name="res_model">account.invoice</field>
486             <field name="view_type">form</field>
487             <field name="view_mode">tree,form,calendar,graph</field>
488             <field name="view_id" ref="invoice_tree"/>
489             <field name="context">{'type':'out_invoice'}</field>
490             <field name="domain">[('state','=','draft')]</field>
491            <!-- <field name="search_view_id" ref="view_account_invoice_filter"/>-->
492         </record>
493
494         <record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
495             <field eval="1" name="sequence"/>
496             <field name="view_mode">tree</field>
497             <field name="act_window_id" ref="action_invoice_tree"/>
498         </record>
499
500         <record id="action_invoice_tree_view2" model="ir.actions.act_window.view">
501             <field eval="2" name="sequence"/>
502             <field name="view_mode">form</field>
503             <field name="view_id" ref="invoice_form"/>
504             <field name="act_window_id" ref="action_invoice_tree"/>
505         </record>
506
507         <record id="action_invoice_tree1" model="ir.actions.act_window">
508             <field name="name">Customer Invoices</field>
509             <field name="res_model">account.invoice</field>
510             <field name="view_type">form</field>
511             <field name="view_mode">tree,form,calendar,graph</field>
512             <field eval="False" name="view_id"/>
513             <field name="domain">[('type','=','out_invoice')]</field>
514             <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
515             <field name="search_view_id" ref="view_account_invoice_filter"/>
516             <field name="help" type="html">
517               <p class="oe_view_nocontent_create">
518                 Click to create a customer invoice.
519               </p><p>
520                 OpenERP's electronic invoicing allows to ease and fasten the
521                 collection of customer payments. Your customer receives the
522                 invoice by email and he can pay online and/or import it
523                 in his own system.
524               </p><p>
525                 The discussions with your customer are automatically displayed at
526                 the bottom of each invoice.
527               </p>
528             </field>
529         </record>
530
531
532         <record id="action_invoice_tree1_view1" model="ir.actions.act_window.view">
533             <field eval="1" name="sequence"/>
534             <field name="view_mode">tree</field>
535             <field name="act_window_id" ref="action_invoice_tree1"/>
536         </record>
537
538         <record id="action_invoice_tree1_view2" model="ir.actions.act_window.view">
539             <field eval="2" name="sequence"/>
540             <field name="view_mode">form</field>
541             <field name="view_id" ref="invoice_form"/>
542             <field name="act_window_id" ref="action_invoice_tree1"/>
543         </record>
544
545         <menuitem action="action_invoice_tree1" id="menu_action_invoice_tree1" parent="menu_finance_receivables"/>
546
547         <record id="action_invoice_tree2" model="ir.actions.act_window">
548             <field name="name">Supplier Invoices</field>
549             <field name="res_model">account.invoice</field>
550             <field name="view_type">form</field>
551             <field name="view_mode">tree,form,calendar,graph</field>
552             <field eval="False" name="view_id"/>
553             <field name="domain">[('type','=','in_invoice')]</field>
554             <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
555             <field name="search_view_id" ref="view_account_invoice_filter"/>
556             <field name="help" type="html">
557               <p class="oe_view_nocontent_create">
558                 Click to record a new supplier invoice.
559               </p><p>
560                 You can control the invoice from your supplier according to
561                 what you purchased or received. OpenERP can also generate
562                 draft invoices automatically from purchase orders or receipts.
563               </p>
564             </field>
565         </record>
566         <menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
567
568         <record id="action_invoice_tree3" model="ir.actions.act_window">
569             <field name="name">Customer Refunds</field>
570             <field name="res_model">account.invoice</field>
571             <field name="view_type">form</field>
572             <field name="view_mode">tree,form,calendar,graph</field>
573             <field eval="False" name="view_id"/>
574             <field name="domain">[('type','=','out_refund')]</field>
575             <field name="context">{'default_type':'out_refund', 'type':'out_refund', 'journal_type': 'sale_refund'}</field>
576             <field name="search_view_id" ref="view_account_invoice_filter"/>
577             <field name="help" type="html">
578               <p class="oe_view_nocontent_create">
579                 Click to create a customer refund. 
580               </p><p>
581                 A refund is a document that credits an invoice completely or
582                 partially.
583               </p><p>
584                 Instead of manually creating a customer refund, you
585                 can generate it directly from the related customer invoice.
586               </p>
587             </field>
588         </record>
589
590         <record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
591             <field eval="1" name="sequence"/>
592             <field name="view_mode">tree</field>
593             <field name="act_window_id" ref="action_invoice_tree3"/>
594         </record>
595
596         <record id="action_invoice_tree3_view2" model="ir.actions.act_window.view">
597             <field eval="2" name="sequence"/>
598             <field name="view_mode">form</field>
599             <field name="view_id" ref="invoice_form"/>
600             <field name="act_window_id" ref="action_invoice_tree3"/>
601         </record>
602         <menuitem action="action_invoice_tree3" id="menu_action_invoice_tree3" parent="menu_finance_receivables"/>
603
604         <record id="action_invoice_tree4" model="ir.actions.act_window">
605             <field name="name">Supplier Refunds</field>
606             <field name="res_model">account.invoice</field>
607             <field name="view_type">form</field>
608             <field name="view_mode">tree,form,calendar,graph</field>
609             <field eval="False" name="view_id"/>
610             <field name="domain">[('type','=','in_refund')]</field>
611             <field name="context">{'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'}</field>
612             <field name="search_view_id" ref="view_account_invoice_filter"/>
613             <field name="help" type="html">
614               <p class="oe_view_nocontent_create">
615                 Click to register a refund you received from a supplier.
616               </p><p>
617                 Instead of creating the supplier refund manually, you can generate
618                 refunds and reconcile them directly from the related supplier invoice.
619               </p>
620             </field>
621         </record>
622         <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
623
624         <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"/>
625
626         <act_window
627            id="act_account_journal_2_account_invoice_opened"
628            name="Unpaid Invoices"
629            context="{'search_default_journal_id': [active_id], 'search_default_unpaid':1, 'default_journal_id': active_id}"
630            res_model="account.invoice"
631            src_model="account.journal"/>
632
633     </data>
634 </openerp>