[MERGE] account: improved res.partner.form view in order to display shortcut buttons...
[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="arch" type="xml">
10                 <calendar string="Invoices" color="journal_id" date_start="date_invoice">
11                     <field name="partner_id"/>
12                     <field name="amount_total"/>
13                 </calendar>
14             </field>
15         </record>
16
17         <record model="ir.ui.view" id="view_invoice_graph">
18             <field name="name">account.invoice.graph</field>
19             <field name="model">account.invoice</field>
20             <field name="arch" type="xml">
21                 <graph string="Invoices" type="bar">
22                     <field name="partner_id"/>
23                     <field name="amount_total" operator="+"/>
24                 </graph>
25             </field>
26         </record>
27
28         <record id="view_invoice_line_tree" model="ir.ui.view">
29             <field name="name">account.invoice.line.tree</field>
30             <field name="model">account.invoice.line</field>
31             <field name="arch" type="xml">
32                 <tree string="Invoice Line">
33                     <field name="name"/>
34                     <field name="account_id" groups="account.group_account_user"/>
35                     <field name="quantity"/>
36                     <field name="uos_id" groups="product.group_uom"/>
37                     <field name="price_unit"/>
38                     <field name="discount" groups="sale.group_discount_per_so_line"/>
39                     <field name="price_subtotal"/>
40                 </tree>
41             </field>
42         </record>
43
44         <record id="view_invoice_line_form" model="ir.ui.view">
45             <field name="name">account.invoice.line.form</field>
46             <field name="model">account.invoice.line</field>
47             <field name="arch" type="xml">
48                 <form string="Invoice Line" version="7.0">
49                     <group>
50                         <group>
51                             <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)"/>
52                             <label for="quantity"/>
53                             <div>
54                                 <field name="quantity" class="oe_inline"/>
55                                 <field name="uos_id" class="oe_inline" groups="product.group_uom"
56                                   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)"/>
57                             </div>
58                             <field name="price_unit"/>
59                             <field name="discount" groups="sale.group_discount_per_so_line"/>
60                         </group>
61                         <group>
62                             <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"/>
63                             <field name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
64                             <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
65                             <field name="company_id" groups="base.group_multi_company" readonly="1"/>
66                         </group>
67                     </group>
68                     <label for="name"/>
69                     <field name="name"/>
70                 </form>
71             </field>
72         </record>
73
74         <record id="view_invoice_tax_tree" model="ir.ui.view">
75             <field name="name">account.invoice.tax.tree</field>
76             <field name="model">account.invoice.tax</field>
77             <field name="arch" type="xml">
78                 <tree string="Manual Invoice Taxes">
79                     <field name="sequence"/>
80                     <field name="manual"/>
81                     <field name="name"/>
82                     <field name="account_id" groups="base.group_account_user"/>
83                     <field name="base"/>
84                     <field name="amount"/>
85                 </tree>
86             </field>
87         </record>
88
89         <record id="view_invoice_tax_form" model="ir.ui.view">
90             <field name="name">account.invoice.tax.form</field>
91             <field name="model">account.invoice.tax</field>
92             <field name="arch" type="xml">
93                 <form string="Manual Invoice Taxes" version="7.0">
94                     <group col="4">
95                         <field name="name"/>
96                         <field name="sequence"/>
97                         <field name="account_id" groups="account.group_account_user"/>
98                         <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
99                         <field name="manual"/>
100                         <field name="amount"/>
101                         <field name="base" readonly="0"/>
102                         <separator colspan="4" string="Tax Codes"/>
103                         <field name="base_code_id"/>
104                         <field name="base_amount"/>
105                         <field name="tax_code_id"/>
106                         <field name="tax_amount"/>
107                         <field name="factor_base" invisible="True"/>
108                         <field name="factor_tax" invisible="True"/>
109                     </group>
110                 </form>
111             </field>
112         </record>
113
114         <record id="invoice_tree" model="ir.ui.view">
115             <field name="name">account.invoice.tree</field>
116             <field name="model">account.invoice</field>
117             <field name="arch" type="xml">
118                 <tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
119                     <field name="partner_id" groups="base.group_user"/>
120                     <field name="date_invoice"/>
121                     <field name="number"/>
122                     <field name="reference" invisible="1"/>
123                     <field name="name" invisible="1"/>
124                     <field name="journal_id" invisible="1"/>
125                     <field name="period_id" invisible="1" groups="account.group_account_user"/>
126                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
127                     <field name="user_id"/>
128                     <field name="date_due"/>
129                     <field name="origin"/>
130                     <field name="currency_id" groups="base.group_multi_currency"/>
131                     <field name="residual" sum="Residual Amount"/>
132                     <field name="amount_untaxed" sum="Untaxed Amount"/>
133                     <field name="amount_total" sum="Total Amount"/>
134                     <field name="state"/>
135                 </tree>
136             </field>
137         </record>
138
139         <record id="invoice_supplier_form" model="ir.ui.view">
140             <field name="name">account.invoice.supplier.form</field>
141             <field name="model">account.invoice</field>
142             <field name="priority">2</field>
143             <field name="arch" type="xml">
144                 <form string="Supplier Invoice" version="7.0">
145                 <header>
146                         <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
147                         <button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' groups="account.group_account_invoice"/>
148                         <button name="invoice_cancel" states="draft,proforma2" string="Cancel Invoice" groups="account.group_account_invoice"/>
149                         <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" groups="account.group_account_invoice"/>
150                         <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."/>
151                     <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
152                 </header>
153                 <sheet string="Supplier Invoice">
154                     <div class="oe_title">
155                         <h1>
156                             <label string="Draft Invoice" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_invoice')]}"/>
157                             <label string="Draft Refund" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_refund')]}"/>
158                             <label string="Invoice" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_invoice')]}"/>
159                             <label string="Refund" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_refund')]}"/>
160                             <field name="number" class="oe_inline"  attrs="{'invisible': [('state', '=', 'draft')]}"/>
161                         </h1>
162                     </div>
163                     <field name="type" invisible="1"/>
164                     <group>
165                         <group>
166                             <field string="Supplier" name="partner_id"
167                               on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
168                               context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
169                               domain="[('supplier', '=', True)]"/>
170                             <field name="fiscal_position" widget="selection"/>
171                             <field name="origin"/>
172                             <field name="supplier_invoice_number"/>
173                             <label for="reference_type"/>
174                             <div>
175                                 <field name="reference_type" class="oe_inline oe_edit_only"/>
176                                 <field name="reference" class="oe_inline"/>
177                             </div>
178                         </group>
179                         <group>
180                             <field name="date_invoice"/>
181                             <field name="date_due"/>
182                             <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
183                                 name="account_id" groups="account.group_account_user"/>
184                             <field name="journal_id" groups="account.group_account_user"
185                                 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
186                             <field name="currency_id" groups="base.group_multi_currency"/>
187                             <field name="check_total" groups="account.group_supplier_inv_check_total"/>
188                         </group>
189                     </group>
190                     <notebook>
191                         <page string="Invoice">
192                             <field context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type}" name="invoice_line">
193                                 <tree string="Invoice lines" editable="bottom">
194                                     <field name="product_id"
195                                         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)"/>
196                                     <field name="name"/>
197                                     <field name="company_id" invisible="1"/>
198                                     <field name="account_id" groups="account.group_account_user"
199                                         domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
200                                         on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
201                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
202                                         domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
203                                     <field name="quantity"/>
204                                     <field name="uos_id" groups="product.group_uom"
205                                         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)"/>
206                                     <field name="price_unit"/>
207                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
208                                     <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
209                                         domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
210                                     <field name="price_subtotal"/>
211                                 </tree>
212                             </field>
213                             <group class="oe_subtotal_footer oe_right">
214                                 <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
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" widget="monetary" options="{'currency_field': 'currency_id'}"/>
222                                 <field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
223
224                                 <field name="residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
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)]" 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'), ('company_id', '=', company_id)]" groups="account.group_account_user"/>
259                                     <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id,context)" 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" groups="base.group_multi_currency"/>
275                                 </tree>
276                             </field>
277                         </page>
278                     </notebook>
279                 </sheet>
280                 <div class="oe_chatter">
281                     <field name="message_follower_ids" widget="mail_followers"/>
282                     <field name="message_ids" widget="mail_thread"/>
283                 </div>
284                 </form>
285             </field>
286         </record>
287
288         <record id="invoice_form" model="ir.ui.view">
289             <field name="name">account.invoice.form</field>
290             <field name="model">account.invoice</field>
291             <field name="arch" type="xml">
292                 <form string="Invoice" version="7.0">
293                 <header>
294                     <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
295                     <button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
296                     <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
297                     <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
298                     <button name="invoice_open" states="draft" string="Validate" class="oe_highlight" groups="base.group_user"/>
299                     <button name="invoice_open" states="proforma2" string="Validate" groups="base.group_user"/>
300                     <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
301                     <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid' groups="base.group_user"/>
302                     <button name="invoice_cancel" states="draft,proforma2,open" string="Cancel Invoice" groups="base.group_no_one"/>
303                     <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" groups="base.group_user"/>
304                     <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."/>
305                     <!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
306                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
307                 </header>
308                 <sheet string="Invoice">
309                     <h1>
310                         <label string="Draft Invoice " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_invoice')]}"/>
311                         <label string="Draft Refund " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_refund')]}"/>
312                         <label string="Pro Forma Invoice " attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
313                         <label string="Invoice " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_invoice')]}"/>
314                         <label string="Refund " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_refund')]}"/>
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                             <field name="date_invoice"/>
328                             <field name="journal_id" groups="account.group_account_user"
329                                 on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
330                             <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"
331                                 name="account_id" groups="account.group_account_user"/>
332
333                             <label for="currency_id" groups="base.group_multi_currency"/>
334                             <div groups="base.group_multi_currency">
335                                 <field name="currency_id" class="oe_inline"/>
336                                 <button name="%(action_account_change_currency)d" type="action"
337                                   class="oe_inline oe_link oe_edit_only"
338                                   string="(change)"
339                                   attrs="{'invisible':[('state','!=','draft')]}"
340                                   groups="account.group_account_user"/>
341                             </div>
342                         </group>
343                     </group>
344                     <field name="sent" invisible="1"/>
345                     <notebook colspan="4">
346                         <page string="Invoice Lines">
347                             <field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
348                                 <tree string="Invoice Lines" editable="bottom">
349                                     <field name="product_id"
350                                         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)"/>
351                                     <field name="name"/>
352                                     <field name="company_id" invisible="1"/>
353                                     <field name="account_id" groups="account.group_account_user"
354                                         domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
355                                         on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
356                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
357                                         domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
358                                     <field name="quantity"/>
359                                     <field name="uos_id" groups="product.group_uom"
360                                         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)"/>
361                                     <field name="price_unit"/>
362                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
363                                     <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
364                                         domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
365                                     <field name="price_subtotal"/>
366                                 </tree>
367                             </field>
368                             <group class="oe_subtotal_footer oe_right">
369                                 <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
370                                 <div>
371                                     <label for="amount_tax"/>
372                                     <button name="button_reset_taxes" states="draft,proforma2"
373                                         string="(update)" class="oe_link oe_edit_only"
374                                         type="object" help="Recompute taxes and total"/>
375                                 </div>
376                                 <field name="amount_tax" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
377                                 <field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
378                                 <field name="residual" groups="account.group_account_user" widget="monetary" options="{'currency_field': 'currency_id'}"/>
379                                 <field name="reconciled" invisible="1"/>
380                             </group>
381                             <group>
382                                     <field name="payment_term" class="oe_inline"/>
383                             </group>
384                             <div class="oe_clear">
385                                 <label for="comment"/>
386                             </div>
387                             <field name="comment" class="oe_inline" placeholder="Additional notes..."/>
388                         </page>
389                         <page string="Other Info">
390                             <group col="4">
391                                 <group>
392                                     <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id,context)" widget="selection" groups="base.group_multi_company"/>
393                                     <field name="user_id" groups="base.group_user"/>
394                                     <field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id"/>
395                                     <field name="period_id" domain="[('state', '=', 'draft'), ('company_id', '=', company_id)]"
396                                         groups="account.group_account_manager"
397                                         string="Accounting Period"
398                                         placeholder="force period"/>
399                                     <field name="date_due"/>
400                                 </group>
401                                 <group>
402                                     <field name="origin" groups="base.group_user"/>
403                                     <field name="name" string="Customer Reference"/>
404                                     <field name="move_id" groups="account.group_account_user"/>
405                                 </group>
406                             </group>
407                             <field name="tax_line">
408                                 <tree editable="bottom" string="Taxes">
409                                     <field name="name"/>
410                                     <field name="account_id" groups="account.group_account_user"/>
411                                     <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
412                                     <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
413                                     <field invisible="True" name="base_amount"/>
414                                     <field invisible="True" name="tax_amount"/>
415                                     <field name="factor_base" invisible="True"/>
416                                     <field name="factor_tax" invisible="True"/>
417                                 </tree>
418                             </field>
419                         </page>
420                         <page string="Payments" groups="base.group_user">
421                             <field name="payment_ids">
422                                 <tree string="Payments">
423                                     <field name="date"/>
424                                     <field name="move_id"/>
425                                     <field name="ref"/>
426                                     <field name="name"/>
427                                     <field name="journal_id" groups="base.group_user"/>
428                                     <field name="debit"/>
429                                     <field name="credit"/>
430                                     <field name="amount_currency" groups="base.group_multi_currency"/>
431                                     <field name="currency_id" groups="base.group_multi_currency"/>
432                                 </tree>
433                             </field>
434                         </page>
435                     </notebook>
436                 </sheet>
437                 <div class="oe_chatter">
438                     <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
439                     <field name="message_ids" widget="mail_thread"/>
440                 </div>
441                 </form>
442             </field>
443         </record>
444
445         <record id="view_account_invoice_filter" model="ir.ui.view">
446             <field name="name">account.invoice.select</field>
447             <field name="model">account.invoice</field>
448             <field name="arch" type="xml">
449                 <search string="Search Invoice">
450                     <field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self), ('partner_id', 'ilike', self)]"/>
451                     <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
452                     <filter name="proforma" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/>
453                     <filter name="invoices" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
454                     <filter name="unpaid" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
455                     <separator/>
456                     <field name="partner_id"/>
457                     <field name="user_id" string="Salesperson"/>
458                     <field name="period_id" string="Period"/>
459                     <separator/>
460                     <filter domain="[('user_id','=',uid)]" help="My Invoices"/>
461                     <group expand="0" string="Group By...">
462                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
463                         <filter string="Responsible" icon="terp-personal" domain="[]"  context="{'group_by':'user_id'}"/>
464                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
465                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
466                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
467                         <filter string="Invoice Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_invoice'}"/>
468                         <filter string="Due Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_due'}"/>
469                     </group>
470                </search>
471             </field>
472         </record>
473
474         <record id="action_invoice_tree" model="ir.actions.act_window">
475             <field name="name">Invoices</field>
476             <field name="res_model">account.invoice</field>
477             <field name="view_type">form</field>
478             <field name="view_mode">tree,form,calendar,graph</field>
479             <field name="view_id" ref="invoice_tree"/>
480             <field name="context">{'type':'out_invoice'}</field>
481             <field name="search_view_id" ref="view_account_invoice_filter"/>
482         </record>
483
484         <record id="action_invoice_tree_pending_invoice" model="ir.actions.act_window">
485             <field name="name">Pending Invoice</field>
486             <field name="res_model">account.invoice</field>
487             <field name="view_type">form</field>
488             <field name="view_mode">tree,form,calendar,graph</field>
489             <field name="view_id" ref="invoice_tree"/>
490             <field name="context">{'type':'out_invoice'}</field>
491             <field name="domain">[('state','=','draft')]</field>
492            <!-- <field name="search_view_id" ref="view_account_invoice_filter"/>-->
493         </record>
494
495         <record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
496             <field eval="1" name="sequence"/>
497             <field name="view_mode">tree</field>
498             <field name="act_window_id" ref="action_invoice_tree"/>
499         </record>
500
501         <record id="action_invoice_tree_view2" model="ir.actions.act_window.view">
502             <field eval="2" name="sequence"/>
503             <field name="view_mode">form</field>
504             <field name="view_id" ref="invoice_form"/>
505             <field name="act_window_id" ref="action_invoice_tree"/>
506         </record>
507
508         <record id="action_invoice_tree1" model="ir.actions.act_window">
509             <field name="name">Customer Invoices</field>
510             <field name="res_model">account.invoice</field>
511             <field name="view_type">form</field>
512             <field name="view_mode">tree,form,calendar,graph</field>
513             <field eval="False" name="view_id"/>
514             <field name="domain">[('type','=','out_invoice')]</field>
515             <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
516             <field name="search_view_id" ref="view_account_invoice_filter"/>
517             <field name="help" type="html">
518               <p class="oe_view_nocontent_create">
519                 Click to create a customer invoice.
520               </p><p>
521                 OpenERP's electronic invoicing allows to ease and fasten the
522                 collection of customer payments. Your customer receives the
523                 invoice by email and he can pay online and/or import it
524                 in his own system.
525               </p><p>
526                 The discussions with your customer are automatically displayed at
527                 the bottom of each invoice.
528               </p>
529             </field>
530         </record>
531
532
533         <record id="action_invoice_tree1_view1" model="ir.actions.act_window.view">
534             <field eval="1" name="sequence"/>
535             <field name="view_mode">tree</field>
536             <field name="act_window_id" ref="action_invoice_tree1"/>
537         </record>
538
539         <record id="action_invoice_tree1_view2" model="ir.actions.act_window.view">
540             <field eval="2" name="sequence"/>
541             <field name="view_mode">form</field>
542             <field name="view_id" ref="invoice_form"/>
543             <field name="act_window_id" ref="action_invoice_tree1"/>
544         </record>
545
546         <menuitem action="action_invoice_tree1" id="menu_action_invoice_tree1" parent="menu_finance_receivables"/>
547
548         <record id="action_invoice_tree2" model="ir.actions.act_window">
549             <field name="name">Supplier Invoices</field>
550             <field name="res_model">account.invoice</field>
551             <field name="view_type">form</field>
552             <field name="view_mode">tree,form,calendar,graph</field>
553             <field eval="False" name="view_id"/>
554             <field name="domain">[('type','=','in_invoice')]</field>
555             <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
556             <field name="search_view_id" ref="view_account_invoice_filter"/>
557             <field name="help" type="html">
558               <p class="oe_view_nocontent_create">
559                 Click to record a new supplier invoice.
560               </p><p>
561                 You can control the invoice from your supplier according to
562                 what you purchased or received. OpenERP can also generate
563                 draft invoices automatically from purchase orders or receipts.
564               </p>
565             </field>
566         </record>
567         <menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
568
569         <record id="action_invoice_tree3" model="ir.actions.act_window">
570             <field name="name">Customer Refunds</field>
571             <field name="res_model">account.invoice</field>
572             <field name="view_type">form</field>
573             <field name="view_mode">tree,form,calendar,graph</field>
574             <field eval="False" name="view_id"/>
575             <field name="domain">[('type','=','out_refund')]</field>
576             <field name="context">{'default_type':'out_refund', 'type':'out_refund', 'journal_type': 'sale_refund'}</field>
577             <field name="search_view_id" ref="view_account_invoice_filter"/>
578             <field name="help" type="html">
579               <p class="oe_view_nocontent_create">
580                 Click to create a customer refund. 
581               </p><p>
582                 A refund is a document that credits an invoice completely or
583                 partially.
584               </p><p>
585                 Instead of manually creating a customer refund, you
586                 can generate it directly from the related customer invoice.
587               </p>
588             </field>
589         </record>
590
591         <record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
592             <field eval="1" name="sequence"/>
593             <field name="view_mode">tree</field>
594             <field name="act_window_id" ref="action_invoice_tree3"/>
595         </record>
596
597         <record id="action_invoice_tree3_view2" model="ir.actions.act_window.view">
598             <field eval="2" name="sequence"/>
599             <field name="view_mode">form</field>
600             <field name="view_id" ref="invoice_form"/>
601             <field name="act_window_id" ref="action_invoice_tree3"/>
602         </record>
603         <menuitem action="action_invoice_tree3" id="menu_action_invoice_tree3" parent="menu_finance_receivables"/>
604
605         <record id="action_invoice_tree4" model="ir.actions.act_window">
606             <field name="name">Supplier Refunds</field>
607             <field name="res_model">account.invoice</field>
608             <field name="view_type">form</field>
609             <field name="view_mode">tree,form,calendar,graph</field>
610             <field eval="False" name="view_id"/>
611             <field name="domain">[('type','=','in_refund')]</field>
612             <field name="context">{'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'}</field>
613             <field name="search_view_id" ref="view_account_invoice_filter"/>
614             <field name="help" type="html">
615               <p class="oe_view_nocontent_create">
616                 Click to register a refund you received from a supplier.
617               </p><p>
618                 Instead of creating the supplier refund manually, you can generate
619                 refunds and reconcile them directly from the related supplier invoice.
620               </p>
621             </field>
622         </record>
623         <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
624
625         <act_window
626            id="act_account_journal_2_account_invoice_opened"
627            name="Unpaid Invoices"
628            context="{'search_default_journal_id': [active_id], 'search_default_unpaid':1, 'default_journal_id': active_id}"
629            domain="[('journal_id','=', active_id)]"
630            res_model="account.invoice"
631            src_model="account.journal"/>
632
633     </data>
634 </openerp>