[MERGE] forward port of branch 8.0 up to ed92589
[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">
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, parent.company_id, context)"/>
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, parent.company_id, context)"/>
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.get('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)], ('state','not in',('close','cancelled'))]" 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">
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), ('state','not in',('close','cancelled')]" 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="commercial_partner_id" invisible="1"/>
121                     <field name="date_invoice"/>
122                     <field name="number"/>
123                     <field name="reference" invisible="1"/>
124                     <field name="name" invisible="1"/>
125                     <field name="journal_id" invisible="1"/>
126                     <field name="period_id" invisible="1" groups="account.group_account_user"/>
127                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
128                     <field name="user_id" string="Responsible"/>
129                     <field name="date_due"/>
130                     <field name="origin"/>
131                     <field name="currency_id" groups="base.group_multi_currency"/>
132                     <field name="residual" sum="Residual Amount"/>
133                     <field name="amount_untaxed" sum="Untaxed Amount"/>
134                     <field name="amount_total" sum="Total Amount"/>
135                     <field name="state"/>
136                 </tree>
137             </field>
138         </record>
139
140         <record id="invoice_supplier_form" model="ir.ui.view">
141             <field name="name">account.invoice.supplier.form</field>
142             <field name="model">account.invoice</field>
143             <field name="priority">2</field>
144             <field name="arch" type="xml">
145                 <form string="Supplier Invoice">
146                 <header>
147                         <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
148                         <button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' groups="account.group_account_invoice"/>
149                         <button name="invoice_cancel" states="draft,proforma2" string="Cancel Invoice" groups="account.group_account_invoice"/>
150                         <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" groups="account.group_account_invoice"/>
151                         <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."/>
152                     <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
153                 </header>
154                 <sheet string="Supplier Invoice">
155                     <div class="oe_title">
156                         <h1>
157                             <label string="Draft Invoice" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_invoice')]}"/>
158                             <label string="Draft Refund" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_refund')]}"/>
159                             <label string="Invoice" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_invoice')]}"/>
160                             <label string="Refund" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_refund')]}"/>
161                             <field name="number" class="oe_inline"  attrs="{'invisible': [('state', '=', 'draft')]}"/>
162                         </h1>
163                     </div>
164                     <field name="type" invisible="1"/>
165                     <group>
166                         <group>
167                             <field string="Supplier" name="partner_id"
168                               on_change="onchange_partner_id(type, partner_id, date_invoice, payment_term, partner_bank_id, company_id, context)"
169                               context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
170                               domain="[('supplier', '=', True)]"/>
171                             <field name="fiscal_position" options="{'no_create': True}"/>
172                             <field name="origin"/>
173                             <field name="supplier_invoice_number"/>
174                             <label for="reference_type"/>
175                             <div>
176                                 <field name="reference_type" class="oe_inline oe_edit_only"/>
177                                 <field name="reference" class="oe_inline"/>
178                             </div>
179                         </group>
180                         <group>
181                             <field name="date_invoice"/>
182                             <field name="date_due"/>
183                             <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
184                                 name="account_id" groups="account.group_account_user"/>
185                             <field name="journal_id" groups="account.group_account_user"
186                                 on_change="onchange_journal_id(journal_id)" options="{'no_create': True}"/>
187                             <field name="currency_id" groups="base.group_multi_currency"/>
188                             <field name="check_total" groups="account.group_supplier_inv_check_total"/>
189                         </group>
190                     </group>
191                     <notebook>
192                         <page string="Invoice">
193                             <field context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type}" name="invoice_line">
194                                 <tree string="Invoice lines" editable="bottom">
195                                     <field name="sequence" widget="handle" />
196                                     <field name="product_id"
197                                         on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)"/>
198                                     <field name="name"/>
199                                     <field name="company_id" invisible="1"/>
200                                     <field name="account_id" groups="account.group_account_user"
201                                         domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]"
202                                         on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
203                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
204                                         domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
205                                     <field name="quantity"/>
206                                     <field name="uos_id" groups="product.group_uom"
207                                         on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)"/>
208                                     <field name="price_unit"/>
209                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
210                                     <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
211                                         domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
212                                     <field name="price_subtotal"/>
213                                 </tree>
214                             </field>
215                             <group class="oe_subtotal_footer oe_right">
216                                 <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
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" widget="monetary" options="{'currency_field': 'currency_id'}"/>
224                                 <field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
225
226                                 <field name="residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
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)]" 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" string="Responsible" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/>
255                                     <field name="name" invisible="1"/>
256                                     <field name="payment_term" options="{'no_create': True}"/>
257                                 </group>
258                                 <group>
259                                     <field name="move_id" groups="account.group_account_user"/>
260                                     <field name="period_id" domain="[('state', '=', 'draft'), ('company_id', '=', company_id)]" groups="account.group_account_user"/>
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" groups="base.group_multi_currency"/>
277                                 </tree>
278                             </field>
279                         </page>
280                     </notebook>
281                 </sheet>
282                 <div class="oe_chatter">
283                     <field name="message_follower_ids" widget="mail_followers"/>
284                     <field name="message_ids" widget="mail_thread"/>
285                 </div>
286                 </form>
287             </field>
288         </record>
289
290         <record id="invoice_form" model="ir.ui.view">
291             <field name="name">account.invoice.form</field>
292             <field name="model">account.invoice</field>
293             <field name="arch" type="xml">
294                 <form string="Invoice">
295                 <header>
296                     <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
297                     <button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
298                     <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
299                     <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
300                     <button name="invoice_open" states="draft" string="Validate" class="oe_highlight" groups="base.group_user"/>
301                     <button name="invoice_open" states="proforma2" string="Validate" groups="base.group_user"/>
302                     <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
303                     <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid' groups="base.group_user"/>
304                     <button name="invoice_cancel" states="draft,proforma2,open" string="Cancel Invoice" groups="base.group_no_one"/>
305                     <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" groups="base.group_user"/>
306                     <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."/>
307                     <!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
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',)), ('type','&lt;&gt;','out_invoice')]}"/>
313                         <label string="Draft Refund" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_refund')]}"/>
314                         <label string="Pro Forma Invoice" attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
315                         <label string="Invoice" attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_invoice')]}"/>
316                         <label string="Refund" attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_refund')]}"/>
317                         <field name="number" readonly="1" class="oe_inline"/>
318                     </h1>
319                     <field name="type" invisible="1"/>
320                     <group>
321                         <group>
322                             <field string="Customer" name="partner_id"
323                                 on_change="onchange_partner_id(type, partner_id, date_invoice, payment_term, partner_bank_id, company_id, context)"
324                                 context="{'search_default_customer':1, 'show_address': 1}"
325                                 options='{"always_reload": True}'
326                                 domain="[('customer', '=', True)]"/>
327                             <field name="fiscal_position" options="{'no_create': True}" />
328                         </group>
329                         <group>
330                             <field name="date_invoice"/>
331                             <field name="journal_id" groups="account.group_account_user"
332                                 on_change="onchange_journal_id(journal_id)" options="{'no_create': True}"/>
333                             <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"
334                                 name="account_id" groups="account.group_account_user"/>
335
336                             <label for="currency_id" groups="base.group_multi_currency"/>
337                             <div groups="base.group_multi_currency">
338                                 <field name="currency_id" class="oe_inline"/>
339                                 <button name="%(action_account_change_currency)d" type="action"
340                                   class="oe_inline oe_link oe_edit_only"
341                                   string="(change)"
342                                   attrs="{'invisible':[('state','!=','draft')]}"
343                                   groups="account.group_account_user"/>
344                             </div>
345                         </group>
346                     </group>
347                     <field name="sent" invisible="1"/>
348                     <notebook colspan="4">
349                         <page string="Invoice Lines">
350                             <field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
351                                 <tree string="Invoice Lines" editable="bottom">
352                                     <field name="sequence" widget="handle"/>
353                                     <field name="product_id"
354                                         on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)"/>
355                                     <field name="name"/>
356                                     <field name="company_id" invisible="1"/>
357                                     <field name="account_id" groups="account.group_account_user"
358                                         domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]"
359                                         on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
360                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
361                                         domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
362                                     <field name="quantity"/>
363                                     <field name="uos_id" groups="product.group_uom"
364                                         on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)"/>
365                                     <field name="price_unit"/>
366                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
367                                     <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
368                                         domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
369                                     <field name="price_subtotal"/>
370                                 </tree>
371                             </field>
372                             <group class="oe_subtotal_footer oe_right">
373                                 <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
374                                 <div>
375                                     <label for="amount_tax"/>
376                                     <button name="button_reset_taxes" states="draft,proforma2"
377                                         string="(update)" class="oe_link oe_edit_only"
378                                         type="object" help="Recompute taxes and total"/>
379                                 </div>
380                                 <field name="amount_tax" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
381                                 <field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
382                                 <field name="residual" groups="account.group_account_user" widget="monetary" options="{'currency_field': 'currency_id'}"/>
383                                 <field name="reconciled" invisible="1"/>
384                             </group>
385                             <group>
386                                     <field name="payment_term" class="oe_inline"/>
387                             </group>
388                             <div class="oe_clear">
389                                 <label for="comment"/>
390                             </div>
391                             <field name="comment" class="oe_inline" placeholder="Additional notes..."/>
392                         </page>
393                         <page string="Other Info">
394                             <group col="4">
395                                 <group>
396                                     <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"/>
397                                     <field name="user_id" groups="base.group_user" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/>
398                                     <field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id"/>
399                                     <field name="period_id" domain="[('state', '=', 'draft'), ('company_id', '=', company_id)]"
400                                         groups="account.group_account_manager"
401                                         string="Accounting Period"
402                                         placeholder="force period"/>
403                                     <field name="date_due"/>
404                                 </group>
405                                 <group>
406                                     <field name="origin" groups="base.group_user"/>
407                                     <field name="name"/>
408                                     <field name="move_id" groups="account.group_account_user"/>
409                                 </group>
410                             </group>
411                             <field name="tax_line">
412                                 <tree editable="bottom" string="Taxes">
413                                     <field name="name"/>
414                                     <field name="account_id" groups="account.group_account_user"/>
415                                     <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
416                                     <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
417                                     <field invisible="True" name="base_amount"/>
418                                     <field invisible="True" name="tax_amount"/>
419                                     <field name="factor_base" invisible="True"/>
420                                     <field name="factor_tax" invisible="True"/>
421                                 </tree>
422                             </field>
423                         </page>
424                         <page string="Payments" groups="base.group_user">
425                             <field name="payment_ids">
426                                 <tree string="Payments">
427                                     <field name="date"/>
428                                     <field name="move_id"/>
429                                     <field name="ref"/>
430                                     <field name="name"/>
431                                     <field name="journal_id" groups="base.group_user"/>
432                                     <field name="debit"/>
433                                     <field name="credit"/>
434                                     <field name="amount_currency" groups="base.group_multi_currency"/>
435                                     <field name="currency_id" groups="base.group_multi_currency"/>
436                                 </tree>
437                             </field>
438                         </page>
439                     </notebook>
440                 </sheet>
441                 <div class="oe_chatter">
442                     <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
443                     <field name="message_ids" widget="mail_thread"/>
444                 </div>
445                 </form>
446             </field>
447         </record>
448
449         <!-- Custom reports (aka filters) -->
450         <record id="filter_invoice_salespersons" model="ir.filters">
451             <field name="name">By Salespersons</field>
452             <field name="model_id">account.invoice</field>
453             <field name="user_id" eval="False"/>
454             <field name="context">{'group_by': ['date_invoice:month', 'user_id']}</field>
455         </record>
456
457         <record id="view_account_invoice_filter" model="ir.ui.view">
458             <field name="name">account.invoice.select</field>
459             <field name="model">account.invoice</field>
460             <field name="arch" type="xml">
461                 <search string="Search Invoice">
462                     <field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self), ('partner_id', 'child_of', self)]"/>
463                     <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
464                     <filter name="proforma" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/>
465                     <filter name="invoices" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
466                     <filter name="unpaid" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
467                     <separator/>
468                     <field name="partner_id" operator="child_of"/>
469                     <field name="user_id" string="Salesperson"/>
470                     <field name="period_id" string="Period"/>
471                     <separator/>
472                     <filter domain="[('user_id','=',uid)]" help="My Invoices"/>
473                     <group expand="0" string="Group By">
474                         <filter name="group_by_partner_id" string="Partner" context="{'group_by':'partner_id'}"/>
475                         <filter string="Salesperson" context="{'group_by':'user_id'}"/>
476                         <filter string="Status" context="{'group_by':'state'}"/>
477                         <separator/>
478                         <filter string="Period" context="{'group_by':'period_id'}"/>
479                         <filter string="Due Month" context="{'group_by':'date_due'}"/>
480                     </group>
481                </search>
482             </field>
483         </record>
484
485         <record id="action_invoice_tree" model="ir.actions.act_window">
486             <field name="name">Invoices</field>
487             <field name="res_model">account.invoice</field>
488             <field name="view_type">form</field>
489             <field name="view_mode">tree,form,calendar,graph</field>
490             <field name="view_id" ref="invoice_tree"/>
491             <field name="context">{'type':'out_invoice'}</field>
492             <field name="search_view_id" ref="view_account_invoice_filter"/>
493         </record>
494
495         <record id="action_invoice_tree_pending_invoice" model="ir.actions.act_window">
496             <field name="name">Pending Invoice</field>
497             <field name="res_model">account.invoice</field>
498             <field name="view_type">form</field>
499             <field name="view_mode">tree,form,calendar,graph</field>
500             <field name="view_id" ref="invoice_tree"/>
501             <field name="context">{'type':'out_invoice'}</field>
502             <field name="domain">[('state','=','draft')]</field>
503            <!-- <field name="search_view_id" ref="view_account_invoice_filter"/>-->
504         </record>
505
506         <record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
507             <field eval="1" name="sequence"/>
508             <field name="view_mode">tree</field>
509             <field name="act_window_id" ref="action_invoice_tree"/>
510         </record>
511
512         <record id="action_invoice_tree_view2" model="ir.actions.act_window.view">
513             <field eval="2" name="sequence"/>
514             <field name="view_mode">form</field>
515             <field name="view_id" ref="invoice_form"/>
516             <field name="act_window_id" ref="action_invoice_tree"/>
517         </record>
518
519         <record id="action_invoice_tree1" model="ir.actions.act_window">
520             <field name="name">Customer Invoices</field>
521             <field name="res_model">account.invoice</field>
522             <field name="view_type">form</field>
523             <field name="view_mode">tree,form,calendar,graph</field>
524             <field eval="False" name="view_id"/>
525             <field name="domain">[('type','=','out_invoice')]</field>
526             <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
527             <field name="search_view_id" ref="view_account_invoice_filter"/>
528             <field name="help" type="html">
529               <p class="oe_view_nocontent_create">
530                 Click to create a customer invoice.
531               </p><p>
532                 Odoo's electronic invoicing allows to ease and fasten the
533                 collection of customer payments. Your customer receives the
534                 invoice by email and he can pay online and/or import it
535                 in his own system.
536               </p><p>
537                 The discussions with your customer are automatically displayed at
538                 the bottom of each invoice.
539               </p>
540             </field>
541         </record>
542
543
544         <record id="action_invoice_tree1_view1" model="ir.actions.act_window.view">
545             <field eval="1" name="sequence"/>
546             <field name="view_mode">tree</field>
547             <field name="act_window_id" ref="action_invoice_tree1"/>
548         </record>
549
550         <record id="action_invoice_tree1_view2" model="ir.actions.act_window.view">
551             <field eval="2" name="sequence"/>
552             <field name="view_mode">form</field>
553             <field name="view_id" ref="invoice_form"/>
554             <field name="act_window_id" ref="action_invoice_tree1"/>
555         </record>
556
557         <menuitem action="action_invoice_tree1" id="menu_action_invoice_tree1" parent="menu_finance_receivables"/>
558
559         <record id="action_invoice_tree2" model="ir.actions.act_window">
560             <field name="name">Supplier Invoices</field>
561             <field name="res_model">account.invoice</field>
562             <field name="view_type">form</field>
563             <field name="view_mode">tree,form,calendar,graph</field>
564             <field eval="False" name="view_id"/>
565             <field name="domain">[('type','=','in_invoice')]</field>
566             <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
567             <field name="search_view_id" ref="view_account_invoice_filter"/>
568             <field name="help" type="html">
569               <p class="oe_view_nocontent_create">
570                 Click to record a new supplier invoice.
571               </p><p>
572                 You can control the invoice from your supplier according to
573                 what you purchased or received. Odoo can also generate
574                 draft invoices automatically from purchase orders or receipts.
575               </p>
576             </field>
577         </record>
578         <menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables" sequence="1"/>
579
580         <record id="action_invoice_tree3" model="ir.actions.act_window">
581             <field name="name">Customer Refunds</field>
582             <field name="res_model">account.invoice</field>
583             <field name="view_type">form</field>
584             <field name="view_mode">tree,form,calendar,graph</field>
585             <field eval="False" name="view_id"/>
586             <field name="domain">[('type','=','out_refund')]</field>
587             <field name="context">{'default_type':'out_refund', 'type':'out_refund', 'journal_type': 'sale_refund'}</field>
588             <field name="search_view_id" ref="view_account_invoice_filter"/>
589             <field name="help" type="html">
590               <p class="oe_view_nocontent_create">
591                 Click to create a customer refund.
592               </p><p>
593                 A refund is a document that credits an invoice completely or
594                 partially.
595               </p><p>
596                 Instead of manually creating a customer refund, you
597                 can generate it directly from the related customer invoice.
598               </p>
599             </field>
600         </record>
601
602         <record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
603             <field eval="1" name="sequence"/>
604             <field name="view_mode">tree</field>
605             <field name="act_window_id" ref="action_invoice_tree3"/>
606         </record>
607
608         <record id="action_invoice_tree3_view2" model="ir.actions.act_window.view">
609             <field eval="2" name="sequence"/>
610             <field name="view_mode">form</field>
611             <field name="view_id" ref="invoice_form"/>
612             <field name="act_window_id" ref="action_invoice_tree3"/>
613         </record>
614         <menuitem action="action_invoice_tree3" id="menu_action_invoice_tree3" parent="menu_finance_receivables"/>
615
616         <record id="action_invoice_tree4" model="ir.actions.act_window">
617             <field name="name">Supplier Refunds</field>
618             <field name="res_model">account.invoice</field>
619             <field name="view_type">form</field>
620             <field name="view_mode">tree,form,calendar,graph</field>
621             <field eval="False" name="view_id"/>
622             <field name="domain">[('type','=','in_refund')]</field>
623             <field name="context">{'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'}</field>
624             <field name="search_view_id" ref="view_account_invoice_filter"/>
625             <field name="help" type="html">
626               <p class="oe_view_nocontent_create">
627                 Click to register a refund you received from a supplier.
628               </p><p>
629                 Instead of creating the supplier refund manually, you can generate
630                 refunds and reconcile them directly from the related supplier invoice.
631               </p>
632             </field>
633         </record>
634         <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables" sequence="2"/>
635
636         <act_window
637            id="act_account_journal_2_account_invoice_opened"
638            name="Unpaid Invoices"
639            context="{'search_default_journal_id': [active_id], 'search_default_unpaid':1, 'default_journal_id': active_id}"
640            domain="[('journal_id','=', active_id)]"
641            res_model="account.invoice"
642            src_model="account.journal"/>
643
644     </data>
645 </openerp>