[FIX] added period_id field to account_voucher dialog
[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                             <field name="period_id" invisible="1"/>
309                         </group>
310                         <group>
311                             <field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
312                             <field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
313                             <field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
314                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
315
316                             <field name="account_id"
317                                 widget="selection"
318                                 invisible="True"/>
319                             <field name="pre_line" invisible="1"/>
320                             <field name="type" invisible="True"/>
321                         </group>
322                     </group>
323                     <notebook invisible="1">
324                         <page string="Payment Information" groups="base.group_user">
325                             <label for="line_cr_ids"/>
326                             <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)">
327                                 <tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
328                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
329                                         on_change="onchange_move_line_id(move_line_id)"
330                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
331                                         required="1"
332                                         groups="account.group_account_user"/>
333                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
334                                     <field name="date_original" readonly="1"/>
335                                     <field name="date_due" readonly="1"/>
336                                     <field name="amount_original" readonly="1"/>
337                                     <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
338                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
339                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
340                                 </tree>
341                             </field>
342                             <label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
343                             <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)">
344                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
345                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
346                                         on_change="onchange_move_line_id(move_line_id)"
347                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
348                                         required="1"/>
349                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
350                                     <field name="date_original" readonly="1"/>
351                                     <field name="date_due" readonly="1"/>
352                                     <field name="amount_original" readonly="1"/>
353                                     <field name="amount_unreconciled" readonly="1"/>
354                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
355                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
356                                 </tree>
357                             </field>
358                             <group col="3">
359                                 <group>
360                                     <field name="narration" colspan="2" nolabel="1"/>
361                                 </group>
362                                 <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
363                                     <field name="is_multi_currency" invisible="1"/>
364                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
365                                     <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"/>
366                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
367                                 </group>
368                                 <group>
369                                     <field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
370                                     <field name="payment_option" required="1"/>
371                                     <field name="writeoff_acc_id"
372                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
373                                            domain="[('type','=','other')]"/>
374                                     <field name="comment"
375                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
376                                     <field name="analytic_id"
377                                            groups="analytic.group_analytic_accounting"/>
378                                 </group>
379                             </group>
380                         </page>
381                     </notebook>
382                     <footer>
383                         <button name="button_proforma_voucher" string="Pay" class="oe_highlight" type="object"/> or
384                         <button string="Cancel" class="oe_link" special="cancel"/>
385                     </footer>
386                 </form>
387             </field>
388         </record>
389
390
391         <record model="ir.ui.view" id="view_vendor_receipt_form">
392             <field name="name">account.voucher.receipt.form</field>
393             <field name="model">account.voucher</field>
394             <field name="arch" type="xml">
395                 <form string="Receipt" version="7.0">
396                 <header invisible="context.get('line_type', False)">
397                     <button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
398                     <button name="cancel_voucher" string="Cancel" states="draft,proforma"/>
399                     <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" confirm="Are you sure to unreconcile and cancel this record ?"/>
400                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
401                     <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
402                 </header>
403                 <sheet>
404                     <h1 attrs="{'invisible': [('number','=',False)]}"><field name="number"/></h1>
405                     <group invisible="context.get('line_type', False)">
406                         <group>
407                             <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}"/>
408                             <field name="currency_id" invisible="1"/>
409                             <field name="amount" class="oe_inline"
410                                 string="Paid Amount"
411                                 widget="monetary" options="{'currency_field': 'currency_id'}"
412                                 on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
413                             <field name="journal_id"
414                                 domain="[('type','in',['bank', 'cash'])]"
415                                 widget="selection"
416                                 on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
417                                 string="Payment Method"/>
418                         </group>
419                         <group>
420                             <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
421                             <field name="reference" string="Payment Ref" placeholder="e.g. 003/10"/>
422                             <field name="name" colspan="2" placeholder="e.g. Invoice SAJ/0042"/>
423                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
424
425                             <field name="account_id"
426                                 widget="selection"
427                                 invisible="True"/>
428                             <field name="pre_line" invisible="1"/>
429                             <field name="type" invisible="True"/>
430                         </group>
431                     </group>
432                     <notebook>
433                         <page string="Payment Information" groups="base.group_user">
434                             <label for="line_cr_ids" invisible="context.get('line_type', False)"/>
435                             <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)">
436                                 <tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
437                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
438                                         on_change="onchange_move_line_id(move_line_id)"
439                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
440                                         required="1"
441                                         groups="account.group_account_user"/>
442                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
443                                     <field name="date_original" readonly="1"/>
444                                     <field name="date_due" readonly="1"/>
445                                     <field name="amount_original" readonly="1"/>
446                                     <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
447                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
448                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
449                                 </tree>
450                             </field>
451                             <label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
452                             <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)">
453                                 <tree string="Credits" editable="bottom" colors="gray:amount==0">
454                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
455                                         on_change="onchange_move_line_id(move_line_id)"
456                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
457                                         required="1"/>
458                                     <field name="account_id"  groups="base.group_no_one" domain="[('type','=','receivable')]"/>
459                                     <field name="date_original" readonly="1"/>
460                                     <field name="date_due" readonly="1"/>
461                                     <field name="amount_original" readonly="1"/>
462                                     <field name="amount_unreconciled" readonly="1"/>
463                                     <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
464                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
465                                 </tree>
466                             </field>
467                             <group col="3">
468                                 <group>
469                                     <field name="narration" colspan="2" nolabel="1"/>
470                                 </group>
471                                 <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
472                                     <field name="is_multi_currency" invisible="1"/>
473                                     <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
474                                     <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"/>
475                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
476                                 </group>
477                                 <group>
478                                     <field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
479                                     <field name="payment_option" required="1"/>
480                                     <field name="writeoff_acc_id"
481                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
482                                            domain="[('type','=','other')]"/>
483                                     <field name="comment"
484                                            attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
485                                     <field name="analytic_id"
486                                            groups="analytic.group_analytic_accounting"/>
487                                 </group>
488                             </group>
489                         </page>
490                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
491                             <group col="4">
492                                 <field name="period_id"/>
493                                 <field name="audit"/>
494                             </group>
495                             <field name="move_ids" readonly="1">
496                                 <tree string="Journal Items">
497                                     <field name="move_id"/>
498                                     <field name="ref"/>
499                                     <field name="date"/>
500                                     <field name="statement_id"/>
501                                     <field name="partner_id"/>
502                                     <field name="account_id"/>
503                                     <field name="name"/>
504                                     <field name="debit"/>
505                                     <field name="credit"/>
506                                     <field name="state"/>
507                                     <field name="reconcile_id"/>
508                                     <field name="amount_currency"/>
509                                     <field name="currency_id" groups="base.group_multi_currency"/>
510                                 </tree>
511                             </field>
512                         </page>
513                     </notebook>
514                     </sheet>
515                     <div class="oe_chatter" invisible="context.get('line_type', False)">
516                         <field name="message_follower_ids" widget="mail_followers"/>
517                         <field name="message_ids" widget="mail_thread"/>
518                     </div>
519                 </form>
520             </field>
521         </record>
522
523         <record id="action_vendor_receipt" model="ir.actions.act_window">
524             <field name="name">Customer Payment</field>
525             <field name="res_model">account.voucher</field>
526             <field name="view_type">form</field>
527             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]</field>
528             <field name="context">{'type':'receipt'}</field>
529             <field name="search_view_id" ref="view_voucher_filter_customer_pay"/>
530             <field name="view_id" eval="False"/>
531             <field name="target">current</field>
532             <field name="help" type="html">
533               <p class="oe_view_nocontent_create">
534                 Click to register a new payment. 
535               </p><p>
536                 Enter the customer and the payment method and then, either
537                 create manually a payment record or OpenERP will propose to you
538                 automatically the reconciliation of this payment with the open
539                 invoices or sales receipts.
540               </p>
541             </field>
542         </record>
543         <record id="action_vendor_receipt_tree" model="ir.actions.act_window.view">
544             <field eval="1" name="sequence"/>
545             <field name="view_mode">tree</field>
546             <field name="act_window_id" ref="action_vendor_receipt"/>
547         </record>
548         <record id="action_vendor_receipt_form" model="ir.actions.act_window.view">
549             <field eval="2" name="sequence"/>
550             <field name="view_mode">form</field>
551             <field name="view_id" ref="view_vendor_receipt_form"/>
552             <field name="act_window_id" ref="action_vendor_receipt"/>
553         </record>
554
555         <menuitem action="action_vendor_receipt" icon="STOCK_JUSTIFY_FILL" sequence="12"
556             id="menu_action_vendor_receipt"  parent="account.menu_finance_receivables"/>
557
558     </data>
559 </openerp>