b6f367601ff93e151dc8c8f2f3f77522018bb51f
[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="arch" type="xml">
9                 <search string="Search Vouchers">
10                     <field name="number" string="Voucher"/>
11                     <field name="date"/>
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                     <field name="partner_id" string="Customer"/>
15                     <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
16                     <field name="period_id"/>
17                     <group expand="0" string="Group By...">
18                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
19                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
20                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
21                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
22                     </group>
23                 </search>
24             </field>
25         </record>
26
27
28         <record id="view_voucher_filter_vendor_pay" model="ir.ui.view">
29             <field name="name">account.voucher.purchase.pay.select</field>
30             <field name="model">account.voucher</field>
31             <field name="arch" type="xml">
32                 <search string="Search Vouchers">
33                     <field name="number" string="Voucher"/>
34                     <field name="date"/>
35                     <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
36                     <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
37                     <field name="partner_id" string="Supplier"/>
38                     <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
39                     <field name="period_id"/>
40                     <group expand="0" string="Group By...">
41                         <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
42                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
43                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
44                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
45                     </group>
46                 </search>
47             </field>
48         </record>
49         <record model="ir.ui.view" id="view_low_priority_payment_form">
50             <field name="name">account.voucher.payment.low.priority.form</field>
51             <field name="model">account.voucher</field>
52             <field name="priority">1</field>
53             <field name="arch" type="xml">
54                 <form string="Bill Payment" version="7.0">
55                     <group col="6">
56                         <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Supplier" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1, 'invoice_currency': currency_id}"/>
57                         <field name="state" invisible="1"/>
58                         <field name="company_id" invisible="1"/>
59                         <field name="amount" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
60                         <field name="journal_id"
61                             domain="[('type','in',['bank', 'cash'])]"
62                             widget="selection"
63                             on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, company_id, context)"
64                             string="Payment Method"/>
65                         <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
66                         <field name="reference" string="Payment Ref"/>
67                         <field name="name" colspan="2"/>
68                         <field name="account_id"
69                             widget="selection"
70                             invisible="True"/>
71                         <field name="pre_line" invisible="1"/>
72                         <field name="type" invisible="True"/>
73                     </group>
74                     <notebook>
75                         <page string="Payment Information">
76                                 <label for="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}"/>
77                             <field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" context="{'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, currency_id, type, context)">
78                                 <tree string="Open Supplier Journal Entries" editable="bottom" colors="gray:amount==0">
79                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
80                                         on_change="onchange_move_line_id(move_line_id)"
81                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"/>
82                                     <field name="account_id" domain="[('type','=','payable')]"/>
83                                     <field name="date_original" readonly="1"/>
84                                     <field name="date_due" readonly="1"/>
85                                     <field name="amount_original" readonly="1"/>
86                                     <field name="amount_unreconciled" readonly="1"/>
87                                     <field name="amount" sum="Total Allocation"/>
88                                 </tree>
89                             </field>
90                             <label for="line_cr_ids" attrs="{'invisible': [('type', '=', 'payment')]}"/>
91                             <field name="line_cr_ids" attrs="{'invisible': [('type', '=', 'payment')]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
92                                 <tree string="Open Customer Journal Entries" editable="bottom" colors="gray:amount==0">
93                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
94                                         on_change="onchange_move_line_id(move_line_id)"
95                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"/>
96                                     <field name="account_id" domain="[('type','=','payable')]"/>
97                                     <field name="date_original" readonly="1"/>
98                                     <field name="date_due" readonly="1"/>
99                                     <field name="amount_original" readonly="1"/>
100                                     <field name="amount_unreconciled" readonly="1"/>
101                                     <field name="amount" sum="Total Allocation"/>
102                                 </tree>
103                             </field>
104                             <group>
105                                 <group string="Internal Notes">
106                                     <field name="narration" nolabel="1" colspan="2"/>
107                                 </group>
108                                 <group string="Other Information" col="4">
109                                     <field name="currency_id" colspan="4" groups="base.group_multi_currency"/>
110                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
111                                     <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
112                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
113                                     <field name="number" colspan="4"/>
114                                 </group>
115                             </group>
116                         </page>
117                     </notebook>
118                 </form>
119             </field>
120         </record>
121
122         <record model="ir.ui.view" id="view_vendor_payment_form">
123             <field name="name">account.voucher.payment.form</field>
124             <field name="model">account.voucher</field>
125             <field name="arch" type="xml">
126                 <form string="Voucher Payment" version="7.0">
127                 <header>
128                     <button name="proforma_voucher" string="Validate" states="draft" invisible="context.get('line_type', False)" class="oe_highlight"/>
129                     <button name="cancel_voucher" string="Cancel" states="draft,proforma"  invisible="context.get('line_type', False)"/>
130                     <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" invisible="context.get('line_type', False)" confirm="Are you sure to unreconcile and cancel this record ?"/>
131                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" invisible="context.get('line_type', False)"/>
132                     <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
133                 </header>
134                 <sheet>
135                     <field name="account_id" invisible="True"/>
136                     <field name="pre_line" invisible="1"/>
137                     <field name="type" invisible="True"/>
138                     <group>
139                         <group>
140                             <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)" context="{'invoice_currency':currency_id, 'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"  string="Supplier"/>
141                             <field name="currency_id" invisible="1"/>
142                             <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)" class="oe_inline" widget='monetary' options='{"currency_field": "currency_id"}'/>
143                             <field name="journal_id"
144                                 domain="[('type','in',['bank', 'cash'])]"
145                                 invisible="context.get('line_type', False)"
146                                 widget="selection"
147                                 on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, company_id, context)"
148                                 string="Payment Method"/>
149                         </group>
150                         <group>
151                             <field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
152                             <field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
153                             <field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
154                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
155                         </group>
156                     </group>
157                     <notebook>
158                         <page string="Payment Information">
159                                 <label for="line_dr_ids"/>
160                             <field name="line_dr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
161                                 <tree string="Supplier Invoices and Outstanding transactions" editable="bottom" colors="gray:amount==0">
162                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
163                                         on_change="onchange_move_line_id(move_line_id)"
164                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
165                                         required="1"/>
166                                     <field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/>
167                                     <field name="date_original" readonly="1"/>
168                                     <field name="date_due" readonly="1"/>
169                                     <field name="amount_original" readonly="1"/>
170                                     <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
171                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
172                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
173                                 </tree>
174                             </field>
175                             <label for="line_cr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
176                             <field name="line_cr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}">
177                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
178                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
179                                         on_change="onchange_move_line_id(move_line_id)"
180                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
181                                         required="1"/>
182                                     <field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/>
183                                     <field name="date_original" readonly="1"/>
184                                     <field name="date_due" readonly="1"/>
185                                     <field name="amount_original" readonly="1"/>
186                                     <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
187                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
188                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
189                                 </tree>
190                             </field>
191                             <group>
192                                 <group string="Internal Notes">
193                                     <field name="narration" colspan="2" nolabel="1"/>
194                                 </group>
195                                 <group>
196                                     <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
197                                         <separator string="Currency Options" colspan="4"/>
198                                         <field name="is_multi_currency" invisible="1"/>
199                                         <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
200                                         <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
201                                         <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
202                                     </group>
203                                     <group col="2">
204                                         <separator string="Payment Options" colspan="2"/>
205                                         <field name="writeoff_amount" widget='monetary' options='{"currency_field": "currency_id"}'/>
206                                         <field name="payment_option" required="1"/>
207                                         <field name="writeoff_acc_id"
208                                                attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
209                                                domain="[('type','=','other')]"/>
210                                         <field name="comment"
211                                                attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
212                                         <field name="analytic_id"
213                                                groups="analytic.group_analytic_accounting"/>
214                                     </group>
215                                 </group>
216                             </group>
217                         </page>
218                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
219                             <group col="4">
220                                 <field name="period_id"/>
221                                 <field name="audit"/>
222                                 <field name="number"/>
223                             </group>
224                             <field name="move_ids" readonly="1">
225                                <tree string="Journal Items">
226                                    <field name="move_id"/>
227                                    <field name="ref"/>
228                                    <field name="date"/>
229                                    <field name="statement_id"/>
230                                    <field name="partner_id"/>
231                                    <field name="account_id"/>
232                                    <field name="name"/>
233                                    <field name="debit"/>
234                                    <field name="credit"/>
235                                    <field name="state"/>
236                                    <field name="reconcile_id"/>
237                                    <field name="amount_currency" groups="base.group_multi_currency"/>
238                                    <field name="currency_id" groups="base.group_multi_currency"/>
239                                </tree>
240                             </field>
241                         </page>
242                     </notebook>
243                     </sheet>
244                     <div class="oe_chatter">
245                         <field name="message_follower_ids" widget="mail_followers"/>
246                         <field name="message_ids" widget="mail_thread"/>
247                     </div>
248                 </form>
249             </field>
250         </record>
251
252         <record id="action_vendor_payment" model="ir.actions.act_window">
253             <field name="name">Supplier Payment</field>
254             <field name="res_model">account.voucher</field>
255             <field name="view_type">form</field>
256             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment')]</field>
257             <field name="context">{'type':'payment'}</field>
258             <field name="view_id" eval="False"/>
259             <field name="search_view_id" ref="view_voucher_filter_vendor_pay"/>
260             <field name="target">current</field>
261             <field name="help" type="html">
262               <p class="oe_view_nocontent_create">
263                 Click to create a new supplier payment.
264               </p><p>
265                 OpenERP helps you easily track payments you do and remining
266                 balance to pay to your supplier.
267               </p>
268             </field>
269         </record>
270         <record id="action_vendor_payment_tree" model="ir.actions.act_window.view">
271             <field eval="1" name="sequence"/>
272             <field name="view_mode">tree</field>
273             <field name="act_window_id" ref="action_vendor_payment"/>
274         </record>
275         <record id="action_vendor_payment_form" model="ir.actions.act_window.view">
276             <field eval="2" name="sequence"/>
277             <field name="view_mode">form</field>
278             <field name="view_id" ref="view_vendor_payment_form"/>
279             <field name="act_window_id" ref="action_vendor_payment"/>
280         </record>
281
282
283         <menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
284             id="menu_action_vendor_payment"  parent="account.menu_finance_payables"/>
285
286         <record model="ir.ui.view" id="view_vendor_receipt_dialog_form">
287             <field name="name">account.voucher.receipt.dialog.form</field>
288             <field name="model">account.voucher</field>
289             <field name="priority">30</field>
290             <field name="arch" type="xml">
291                 <form string="Payment" version="7.0">
292                     <group>
293                         <group>
294                             <field name="state" invisible="1"/>
295                             <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Supplier" context="{'search_default_supplier': 1}"/>
296                             <field name="currency_id" invisible="1"/>
297                             <field name="amount" class="oe_inline"
298                                 string="Paid Amount"
299                                 widget='monetary' options='{"currency_field": "currency_id"}'
300                                 invisible="context.get('line_type', False)"
301                                 on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
302                             <field name="journal_id"
303                                 domain="[('type','in',['bank', 'cash'])]"
304                                 invisible="context.get('line_type', False)"
305                                 widget="selection"
306                                 on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
307                                 string="Payment Method"/>
308                         </group>
309                         <group>
310                             <field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
311                             <field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
312                             <field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
313                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
314
315                             <field name="account_id"
316                                 widget="selection"
317                                 invisible="True"/>
318                             <field name="pre_line" invisible="1"/>
319                             <field name="type" invisible="True"/>
320                         </group>
321                     </group>
322                     <notebook invisible="1">
323                         <page string="Payment Information" groups="base.group_user">
324                             <label for="line_cr_ids"/>
325                             <field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
326                                 <tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
327                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
328                                         on_change="onchange_move_line_id(move_line_id)"
329                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
330                                         required="1"
331                                         groups="account.group_account_user"/>
332                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
333                                     <field name="date_original" readonly="1"/>
334                                     <field name="date_due" readonly="1"/>
335                                     <field name="amount_original" readonly="1"/>
336                                     <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
337                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
338                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
339                                 </tree>
340                             </field>
341                             <label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
342                             <field name="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
343                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
344                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
345                                         on_change="onchange_move_line_id(move_line_id)"
346                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
347                                         required="1"/>
348                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
349                                     <field name="date_original" readonly="1"/>
350                                     <field name="date_due" readonly="1"/>
351                                     <field name="amount_original" readonly="1"/>
352                                     <field name="amount_unreconciled" readonly="1"/>
353                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
354                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
355                                 </tree>
356                             </field>
357                             <group col="3">
358                                 <group>
359                                     <field name="narration" colspan="2" nolabel="1"/>
360                                 </group>
361                                 <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
362                                     <field name="is_multi_currency" invisible="1"/>
363                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
364                                     <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
365                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
366                                 </group>
367                                 <group>
368                                     <field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
369                                     <field name="payment_option" required="1"/>
370                                     <field name="writeoff_acc_id"
371                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
372                                            domain="[('type','=','other')]"/>
373                                     <field name="comment"
374                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
375                                     <field name="analytic_id"
376                                            groups="analytic.group_analytic_accounting"/>
377                                 </group>
378                             </group>
379                         </page>
380                     </notebook>
381                     <footer>
382                         <button name="button_proforma_voucher" string="Pay" class="oe_highlight" type="object"/> or
383                         <button string="Cancel" class="oe_link" special="cancel"/>
384                     </footer>
385                 </form>
386             </field>
387         </record>
388
389
390         <record model="ir.ui.view" id="view_vendor_receipt_form">
391             <field name="name">account.voucher.receipt.form</field>
392             <field name="model">account.voucher</field>
393             <field name="arch" type="xml">
394                 <form string="Receipt" version="7.0">
395                 <header invisible="context.get('line_type', False)">
396                     <button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
397                     <button name="cancel_voucher" string="Cancel" states="draft,proforma"/>
398                     <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" confirm="Are you sure to unreconcile and cancel this record ?"/>
399                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
400                     <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
401                 </header>
402                 <sheet>
403                     <h1 attrs="{'invisible': [('number','=',False)]}"><field name="number"/></h1>
404                     <group invisible="context.get('line_type', False)">
405                         <group>
406                             <field name="partner_id" domain="[('customer','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
407                             <field name="currency_id" invisible="1"/>
408                             <field name="amount" class="oe_inline"
409                                 string="Paid Amount"
410                                 widget="monetary" options="{'currency_field': 'currency_id'}"
411                                 on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
412                             <field name="journal_id"
413                                 domain="[('type','in',['bank', 'cash'])]"
414                                 widget="selection"
415                                 on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
416                                 string="Payment Method"/>
417                         </group>
418                         <group>
419                             <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
420                             <field name="reference" string="Payment Ref" placeholder="e.g. 003/10"/>
421                             <field name="name" colspan="2" placeholder="e.g. Invoice SAJ/0042"/>
422                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
423
424                             <field name="account_id"
425                                 widget="selection"
426                                 invisible="True"/>
427                             <field name="pre_line" invisible="1"/>
428                             <field name="type" invisible="True"/>
429                         </group>
430                     </group>
431                     <notebook>
432                         <page string="Payment Information" groups="base.group_user">
433                             <label for="line_cr_ids" invisible="context.get('line_type', False)"/>
434                             <field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
435                                 <tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
436                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
437                                         on_change="onchange_move_line_id(move_line_id)"
438                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
439                                         required="1"
440                                         groups="account.group_account_user"/>
441                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
442                                     <field name="date_original" readonly="1"/>
443                                     <field name="date_due" readonly="1"/>
444                                     <field name="amount_original" readonly="1"/>
445                                     <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
446                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
447                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
448                                 </tree>
449                             </field>
450                             <label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
451                             <field name="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
452                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
453                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
454                                         on_change="onchange_move_line_id(move_line_id)"
455                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
456                                         required="1"/>
457                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
458                                     <field name="date_original" readonly="1"/>
459                                     <field name="date_due" readonly="1"/>
460                                     <field name="amount_original" readonly="1"/>
461                                     <field name="amount_unreconciled" readonly="1"/>
462                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
463                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
464                                 </tree>
465                             </field>
466                             <group col="3">
467                                 <group>
468                                     <field name="narration" colspan="2" nolabel="1"/>
469                                 </group>
470                                 <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
471                                     <field name="is_multi_currency" invisible="1"/>
472                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
473                                     <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
474                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
475                                 </group>
476                                 <group>
477                                     <field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
478                                     <field name="payment_option" required="1"/>
479                                     <field name="writeoff_acc_id"
480                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
481                                            domain="[('type','=','other')]"/>
482                                     <field name="comment"
483                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
484                                     <field name="analytic_id"
485                                            groups="analytic.group_analytic_accounting"/>
486                                 </group>
487                             </group>
488                         </page>
489                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
490                             <group col="4">
491                                 <field name="period_id"/>
492                                 <field name="audit"/>
493                             </group>
494                             <field name="move_ids" readonly="1">
495                                 <tree string="Journal Items">
496                                     <field name="move_id"/>
497                                     <field name="ref"/>
498                                     <field name="date"/>
499                                     <field name="statement_id"/>
500                                     <field name="partner_id"/>
501                                     <field name="account_id"/>
502                                     <field name="name"/>
503                                     <field name="debit"/>
504                                     <field name="credit"/>
505                                     <field name="state"/>
506                                     <field name="reconcile_id"/>
507                                     <field name="amount_currency"/>
508                                     <field name="currency_id" groups="base.group_multi_currency"/>
509                                 </tree>
510                             </field>
511                         </page>
512                     </notebook>
513                     </sheet>
514                     <div class="oe_chatter" invisible="context.get('line_type', False)">
515                         <field name="message_follower_ids" widget="mail_followers"/>
516                         <field name="message_ids" widget="mail_thread"/>
517                     </div>
518                 </form>
519             </field>
520         </record>
521
522         <record id="action_vendor_receipt" model="ir.actions.act_window">
523             <field name="name">Customer Payment</field>
524             <field name="res_model">account.voucher</field>
525             <field name="view_type">form</field>
526             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]</field>
527             <field name="context">{'type':'receipt'}</field>
528             <field name="search_view_id" ref="view_voucher_filter_customer_pay"/>
529             <field name="view_id" eval="False"/>
530             <field name="target">current</field>
531             <field name="help" type="html">
532               <p class="oe_view_nocontent_create">
533                 Click to register a new payment. 
534               </p><p>
535                 Enter the customer and the payment method and then, either
536                 create manually a payment record or OpenERP will propose to you
537                 automatically the reconciliation of this payment with the open
538                 invoices or sales receipts.
539               </p>
540             </field>
541         </record>
542         <record id="action_vendor_receipt_tree" model="ir.actions.act_window.view">
543             <field eval="1" name="sequence"/>
544             <field name="view_mode">tree</field>
545             <field name="act_window_id" ref="action_vendor_receipt"/>
546         </record>
547         <record id="action_vendor_receipt_form" model="ir.actions.act_window.view">
548             <field eval="2" name="sequence"/>
549             <field name="view_mode">form</field>
550             <field name="view_id" ref="view_vendor_receipt_form"/>
551             <field name="act_window_id" ref="action_vendor_receipt"/>
552         </record>
553
554         <menuitem action="action_vendor_receipt" icon="STOCK_JUSTIFY_FILL" sequence="12"
555             id="menu_action_vendor_receipt"  parent="account.menu_finance_receivables"/>
556
557     </data>
558 </openerp>