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