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