[FIX] account : Pooled account.tax object in voucher_move_line_create function of...
[odoo/odoo.git] / addons / account_voucher / voucher_payment_receipt_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4
5         <record id="view_voucher_filter_customer_pay" model="ir.ui.view">
6             <field name="name">account.voucher.customer.pay.select</field>
7             <field name="model">account.voucher</field>
8             <field name="type">search</field>
9             <field name="arch" type="xml">
10                 <search string="Search Vouchers">
11                     <group>
12                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
13                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
14                         <separator orientation="vertical"/>
15                         <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" groups="base.group_extended" help="To Review"/>
16                         <separator orientation="vertical"/>
17                         <field name="date"/>
18                         <field name="number"/>
19                         <field name="partner_id" string="Customer"/>
20                     </group>
21                     <newline/>
22                     <group>
23                         <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
24                         <field name="period_id" groups="base.group_extended"/>
25                     </group>
26                    <newline/>
27                     <group expand="0" string="Group By...">
28                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
29                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
30                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
31                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
32                     </group>
33                 </search>
34             </field>
35         </record>
36
37
38         <record id="view_voucher_filter_vendor_pay" model="ir.ui.view">
39             <field name="name">account.voucher.purchase.pay.select</field>
40             <field name="model">account.voucher</field>
41             <field name="type">search</field>
42             <field name="arch" type="xml">
43                 <search string="Search Vouchers">
44                     <group>
45                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
46                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
47                         <separator orientation="vertical"/>
48                         <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" groups="base.group_extended" help="To Review"/>
49                         <separator orientation="vertical"/>
50                         <field name="date"/>
51                         <field name="number"/>
52                         <field name="partner_id" string="Supplier"/>
53                     </group>
54                     <newline/>
55                     <group>
56                         <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
57                         <field name="period_id" groups="base.group_extended"/>
58                     </group>
59                    <newline/>
60                     <group expand="0" string="Group By...">
61                         <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
62                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
63                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
64                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
65                     </group>
66                 </search>
67             </field>
68         </record>
69         <record model="ir.ui.view" id="view_low_priority_payment_form">
70             <field name="name">account.voucher.payment.low.priority.form</field>
71             <field name="model">account.voucher</field>
72             <field name="type">form</field>
73             <field name="priority">1</field>
74             <field name="arch" type="xml">
75                 <form string="Bill Payment">
76                     <group col="6" colspan="4">
77                         <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id}" string="Supplier"/>
78                         <field name="amount" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, context)"/>
79                         <field name="journal_id"
80                             domain="[('type','in',['bank', 'cash'])]"
81                             widget="selection" select="1"
82                             on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, context)"
83                             string="Payment Method"/>
84                         <field name="date" select="1" on_change="onchange_date(date, currency_id, amount, context)"/>
85                         <field name="reference" select="1" string="Payment Ref"/>
86                         <field name="name" colspan="2"/>
87                         <field name="account_id"
88                             widget="selection"
89                             invisible="True"/>
90                         <field name="pre_line" invisible="1"/>
91                         <field name="type" invisible="True"/>
92                     </group>
93                     <notebook colspan="4">
94                         <page string="Payment Information">
95                             <field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
96                                 <tree string="Open Supplier Journal Entries" editable="bottom" colors="gray:amount==0">
97                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
98                                         on_change="onchange_move_line_id(move_line_id)"
99                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
100                                         />
101                                     <field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/>
102                                     <field name="date_original" readonly="1"/>
103                                     <field name="date_due" readonly="1"/>
104                                     <field name="amount_original" readonly="1"/>
105                                     <field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
106                                     <field name="amount" sum="Payment"/>
107                                 </tree>
108                             </field>
109                             <field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
110                                 <tree string="Open Customer Journal Entries" editable="bottom" colors="gray:amount==0">
111                                     <field name="move_line_id"/>
112                                     <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
113                                     <field name="date_original"/>
114                                     <field name="amount_original"/>
115                                     <field name="amount" sum="Payment"/>
116                                 </tree>
117                             </field>
118                             <group col="2" colspan="3">
119                                 <separator string="Internal Notes" colspan="2"/>
120                                 <field name="narration" colspan="2" nolabel="1"/>
121                             </group>
122                             <group col="2" colspan="1">
123                                 <separator string="Other Information" colspan="2"/>
124                                 <field name="currency_id"/>
125                                 <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, context)" groups='base.group_extended'/>
126                                 <field name="paid_amount_in_company_currency" groups='base.group_extended'/>
127                                 <field name="number"/>
128                             </group>
129                         </page>
130                     </notebook>
131                 </form>
132             </field>
133         </record>
134
135         <record model="ir.ui.view" id="view_vendor_payment_form">
136             <field name="name">account.voucher.payment.form</field>
137             <field name="model">account.voucher</field>
138             <field name="type">form</field>
139             <field name="arch" type="xml">
140                 <form string="Bill Payment">
141                     <group col="6" colspan="4">
142                         <field name="partner_id" domain="[('supplier','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id}" string="Supplier"/>
143                         <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, context)"/>
144                         <field name="journal_id"
145                             domain="[('type','in',['bank', 'cash'])]"
146                             invisible="context.get('line_type', False)"
147                             widget="selection" select="1"
148                             on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, context)"
149                             string="Payment Method"/>
150                         <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, amount, context)"/>
151                         <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
152                         <field name="name" colspan="2" invisible="context.get('line_type', False)"/>
153                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
154                         <field name="account_id"
155                             widget="selection"
156                             invisible="True"/>
157                         <field name="pre_line" invisible="1"/>
158                         <field name="type" invisible="True"/>
159                     </group>
160                     <notebook colspan="4">
161                         <page string="Payment Information">
162                             <field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
163                                 <tree string="Supplier Invoices and Outstanding transactions" editable="bottom" colors="gray:amount==0">
164                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
165                                         on_change="onchange_move_line_id(move_line_id)"
166                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
167                                         required="1"
168                                         />
169                                     <field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/>
170                                     <field name="date_original" readonly="1"/>
171                                     <field name="date_due" readonly="1"/>
172                                     <field name="amount_original" readonly="1"/>
173                                     <field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
174                                     <field name="amount" sum="Payment"/>
175                                 </tree>
176                             </field>
177                             <field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
178                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
179                                     <field name="move_line_id"/>
180                                     <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
181                                     <field name="date_original"/>
182                                     <field name="amount_original"/>
183                                     <field name="amount" sum="Payment"/>
184                                 </tree>
185                             </field>
186                             <group col="2" colspan="3">
187                                 <separator string="Internal Notes" colspan="2"/>
188                                 <field name="narration" colspan="2" nolabel="1"/>
189                             </group>
190                             <group col="2" colspan="1">
191                                 <group col="2" colspan="1" attrs="{'invisible':[('currency_id','=',False)]}">
192                                     <separator string="Currency Options" colspan="2"/>
193                                     <field name="exchange_acc_id"
194                                            domain="[('type','=','other')]"/>
195                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, context)" groups='base.group_extended'/>
196                                     <field name="paid_amount_in_company_currency" groups='base.group_extended'/>
197                                 </group>
198                                 <group col="2" colspan="1">
199                                     <separator string="Payment Options" colspan="2"/>
200                                     <field name="payment_option" required="1"/>
201                                     <field name="writeoff_amount"
202                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
203                                     <field name="writeoff_acc_id"
204                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
205                                            domain="[('type','=','other')]"/>
206                                     <field name="comment"
207                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
208                                     <field name="analytic_id"
209                                            groups="analytic.group_analytic_accounting"/>
210                                 </group>
211                                 <group col="4" colspan="2">
212                                     <separator string="Other Information" colspan="4"/>
213                                     <field name="number" colspan="4"/>
214                                     <field name="currency_id" invisible="1" colspan="4"/>
215                                 </group>
216                             </group>
217                         </page>
218                         <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
219                             <group col="6" colspan="4">
220                                 <field name="period_id"/>
221                                 <field name="audit"/>
222                             </group>
223                             <field name="move_ids" colspan="4" nolabel="1" readonly="1">
224                                <tree string="Journal Items">
225                                    <field name="move_id"/>
226                                    <field name="ref"/>
227                                    <field name="date"/>
228                                    <field name="statement_id"/>
229                                    <field name="partner_id"/>
230                                    <field name="account_id"/>
231                                    <field name="name"/>
232                                    <field name="debit"/>
233                                    <field name="credit"/>
234                                    <field name="state"/>
235                                    <field name="reconcile_id"/>
236                                    <field name="amount_currency"/>
237                                    <field name="currency_id"/>
238                                </tree>
239                             </field>
240                         </page>
241                     </notebook>
242                     <group col="10" colspan="4">
243                         <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
244                         <button name="cancel_voucher" string="Cancel" states="draft,proforma"  icon="gtk-cancel" invisible="context.get('line_type', False)"/>
245                         <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" icon="terp-stock_effects-object-colorize" invisible="context.get('line_type', False)" confirm="Are you sure to unreconcile this record ?"/>
246                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize" invisible="context.get('line_type', False)"/>
247                         <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward" invisible="context.get('line_type', False)"/>
248                     </group>
249                 </form>
250             </field>
251         </record>
252
253         <record id="action_vendor_payment" model="ir.actions.act_window">
254             <field name="name">Supplier Payment</field>
255             <field name="res_model">account.voucher</field>
256             <field name="view_type">form</field>
257             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment')]</field>
258             <field name="context">{'type':'payment'}</field>
259             <field name="view_id" eval="False"/>
260             <field name="search_view_id" ref="view_voucher_filter_vendor_pay"/>
261             <field name="target">current</field>
262             <field name="help">The supplier payment form allows you to track the payment you do to your suppliers. When you select a supplier, the payment method and an amount for the payment, OpenERP will propose to reconcile your payment with the open supplier invoices or bills.</field>
263         </record>
264         <record id="action_vendor_payment_tree" model="ir.actions.act_window.view">
265             <field eval="1" name="sequence"/>
266             <field name="view_mode">tree</field>
267             <field name="act_window_id" ref="action_vendor_payment"/>
268         </record>
269         <record id="action_vendor_payment_form" model="ir.actions.act_window.view">
270             <field eval="2" name="sequence"/>
271             <field name="view_mode">form</field>
272             <field name="view_id" ref="view_vendor_payment_form"/>
273             <field name="act_window_id" ref="action_vendor_payment"/>
274         </record>
275
276
277         <menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
278             id="menu_action_vendor_payment"  parent="account.menu_finance_payables"/>
279
280         <record model="ir.ui.view" id="view_vendor_receipt_form">
281             <field name="name">account.voucher.receipt.form</field>
282             <field name="model">account.voucher</field>
283             <field name="type">form</field>
284             <field name="arch" type="xml">
285                 <form string="Customer Payment">
286                     <group col="6" colspan="4">
287                         <field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer"/>
288                         <field name="currency_id" invisible="1"/>
289                         <field name="amount"
290                             invisible="context.get('line_type', False)"
291                             string="Paid Amount"
292                             on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, context)"/>
293                         <field name="journal_id"
294                             domain="[('type','in',['bank', 'cash'])]"
295                             invisible="context.get('line_type', False)"
296                             widget="selection" select="1"
297                             on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, context)"
298                             string="Payment Method"/>
299                         <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, amount, context)"/>
300                         <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
301                         <field name="name" colspan="2" invisible="context.get('line_type', False)"/>
302                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
303                         <field name="account_id"
304                             widget="selection"
305                             invisible="True"/>
306                         <field name="pre_line" invisible="1"/>
307                         <field name="type" invisible="True"/>
308                     </group>
309                     <notebook colspan="4">
310                         <page string="Payment Information">
311                             <field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
312                                 <tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
313                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
314                                         on_change="onchange_move_line_id(move_line_id)"
315                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
316                                         required="1"
317                                         />
318                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
319                                     <field name="date_original" readonly="1"/>
320                                     <field name="date_due" readonly="1"/>
321                                     <field name="amount_original" readonly="1"/>
322                                     <field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
323                                     <field name="amount" sum="Payment"/>
324                                 </tree>
325                             </field>
326                             <field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
327                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
328                                     <field name="move_line_id"/>
329                                     <field name="account_id"  groups="base.group_extended" domain="[('type','=','receivable')]"/>
330                                     <field name="date_original"/>
331                                     <field name="amount_original"/>
332                                     <field name="amount" sum="Payment"/>
333                                 </tree>
334                             </field>
335                             <group col="2" colspan="3">
336                                 <separator string="Internal Notes" colspan="2"/>
337                                 <field name="narration" colspan="2" nolabel="1"/>
338                             </group>
339                             <group col="2" colspan="1">
340                                 <group col="2" colspan="1" attrs="{'invisible':[('currency_id','=',False)]}">
341                                     <separator string="Currency Options" colspan="2"/>
342                                     <field name="exchange_acc_id"
343                                            domain="[('type','=','other')]"/>
344                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, context)" groups='base.group_extended'/>
345                                     <field name="paid_amount_in_company_currency" groups='base.group_extended'/>
346                                 </group>
347                                 <group col="2" colspan="1">
348                                     <separator string="Payment Options" colspan="2"/>
349                                     <field name="payment_option" required="1"/>
350                                     <field name="writeoff_amount"
351                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
352                                     <field name="writeoff_acc_id"
353                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
354                                            domain="[('type','=','other')]"/>
355                                     <field name="comment"
356                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
357                                     <field name="analytic_id"
358                                            groups="analytic.group_analytic_accounting"/>
359                                 </group>
360                                 <group col="4" colspan="2">
361                                     <separator string="Other Information" colspan="4"/>
362                                     <field name="number" colspan="4"/>
363                                 </group>
364                             </group>
365                         </page>
366                         <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
367                             <group col="6" colspan="4">
368                                 <field name="period_id"/>
369                                 <field name="audit"/>
370                             </group>
371                             <field name="move_ids" colspan="4" nolabel="1" readonly="1">
372                                <tree string="Journal Items">
373                                    <field name="move_id"/>
374                                    <field name="ref"/>
375                                    <field name="date"/>
376                                    <field name="statement_id"/>
377                                    <field name="partner_id"/>
378                                    <field name="account_id"/>
379                                    <field name="name"/>
380                                    <field name="debit"/>
381                                    <field name="credit"/>
382                                    <field name="state"/>
383                                    <field name="reconcile_id"/>
384                                    <field name="amount_currency"/>
385                                    <field name="currency_id"/>
386                                </tree>
387                             </field>
388                         </page>
389                     </notebook>
390                     <group col="10" colspan="4">
391                         <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
392                         <button name="cancel_voucher" string="Cancel" states="draft,proforma"  icon="gtk-cancel" invisible="context.get('line_type', False)"/>
393                         <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" invisible="context.get('line_type', False)" icon="terp-stock_effects-object-colorize" confirm="Are you sure to unreconcile this record ?"/>
394                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize" invisible="context.get('line_type', False)"/>
395                         <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward" invisible="context.get('line_type', False)"/>
396                     </group>
397                 </form>
398             </field>
399         </record>
400
401         <record id="action_vendor_receipt" model="ir.actions.act_window">
402             <field name="name">Customer Payment</field>
403             <field name="res_model">account.voucher</field>
404             <field name="view_type">form</field>
405             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]</field>
406             <field name="context">{'type':'receipt'}</field>
407             <field name="search_view_id" ref="view_voucher_filter_customer_pay"/>
408             <field name="view_id" eval="False"/>
409             <field name="target">current</field>
410             <field name="help">Sales payment allows you to register the payments you receive from your customers. In order to record a payment, you must enter the customer, the payment method (=the journal) and the payment amount. OpenERP will propose to you automatically the reconciliation of this payment with the open invoices or sales receipts.</field>
411         </record>
412         <record id="action_vendor_receipt_tree" model="ir.actions.act_window.view">
413             <field eval="1" name="sequence"/>
414             <field name="view_mode">tree</field>
415             <field name="act_window_id" ref="action_vendor_receipt"/>
416         </record>
417         <record id="action_vendor_receipt_form" model="ir.actions.act_window.view">
418             <field eval="2" name="sequence"/>
419             <field name="view_mode">form</field>
420             <field name="view_id" ref="view_vendor_receipt_form"/>
421             <field name="act_window_id" ref="action_vendor_receipt"/>
422         </record>
423
424         <menuitem action="action_vendor_receipt" icon="STOCK_JUSTIFY_FILL" sequence="12"
425             id="menu_action_vendor_receipt"  parent="account.menu_finance_receivables"/>
426     </data>
427 </openerp>