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