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