[FIX]: small fix for voucher
[odoo/odoo.git] / addons / account_voucher / voucher_payment_receipt_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4         <record model="ir.ui.view" id="view_vendor_payment_form">
5             <field name="name">account.voucher.payment.form</field>
6             <field name="model">account.voucher</field>
7             <field name="type">form</field>
8             <field name="arch" type="xml">
9                 <form string="Bill Payment">
10                     <group col="6" colspan="4">
11                         <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" context="{'invoice_currency':currency_id}" string="Vendor"/>
12                         <field name="journal_id"
13                             domain="[('type','in',['bank', 'cash'])]"
14                             widget="selection" select="1"
15                             on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"
16                             string="Payment Method"/>
17                         <field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
18                         <field name="reference" select="1" string="Payment Ref"/>
19                         <field name="name" colspan="4"/>
20                         <field name="account_id"
21                             widget="selection"
22                             invisible="True"/>
23                         <field name="pre_line" invisible="1"/>
24                         <field name="type" invisible="True"/>
25                     </group>
26                     <notebook colspan="4">
27                         <page string="Payment Information">
28                             <field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
29                                 <tree string="Payment Lines" editable="bottom">
30                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
31                                         on_change="onchange_move_line_id(move_line_id)"
32                                         domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
33                                         />
34                                     <field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/>
35                                     <field name="date_original" readonly="1"/>
36                                     <field name="date_due" readonly="1"/>
37                                     <field name="amount_original" readonly="1"/>
38                                     <field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
39                                     <field name="amount" sum="Payment"/>
40                                 </tree>
41                                 <form string="Payment Information">
42                                     <label string="Form view not available for Payment Lines"/>
43                                 </form>
44                             </field>
45                             <field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
46                                 <tree string="Credits" editable="bottom">
47                                     <field name="move_line_id"/>
48                                     <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
49                                     <field name="date_original"/>
50                                     <field name="amount_original"/>
51                                     <field name="amount" sum="Payment"/>
52                                 </tree>
53                             </field>
54                             <group col="2" colspan="3">
55                                 <separator string="Internal Notes" colspan="2"/>
56                                 <field name="narration" colspan="2" nolabel="1"/>
57                             </group>
58                             <group col="2" colspan="1">
59                                 <separator string="Other Information" colspan="2"/>
60                                 <field name="date" select="1" on_change="onchange_date(date)"/>
61                                 <field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
62                                 <field name="number"/>
63                             </group>
64                         </page>
65                         <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
66                             <group col="6" colspan="4">
67                                 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
68                                 <field name="period_id"/>
69                                 <field name="audit"/>
70                             </group>
71                             <separator string="Journal Items" colspan="4"/>
72                             <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
73                         </page>
74                     </notebook>
75                     <group col="10" colspan="4">
76                         <field name="state"/>
77                         <button name="cancel_voucher" string="Cancel" states="draft,proforma"  icon="gtk-cancel"/>
78                         <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to unreconcile this record ?"/>
79                         <button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
80                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
81                     </group>
82                 </form>
83             </field>
84         </record>
85         
86         <record id="action_vendor_payment" model="ir.actions.act_window">
87             <field name="name">Vendor Payment</field>
88             <field name="res_model">account.voucher.open</field>
89             <field name="view_type">form</field>
90             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment')]</field>
91             <field name="context">{'journal_type':'bank', 'type':'payment'}</field>
92             <field name="view_id" ref="account_open_vouchers_view"/>
93             <field name="target">new</field>
94         </record>
95         <menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
96             id="menu_action_vendor_payment"  parent="account.menu_finance_payables"/>
97
98         <record model="ir.ui.view" id="view_vendor_receipt_form">
99             <field name="name">account.voucher.receipt.form</field>
100             <field name="model">account.voucher</field>
101             <field name="type">form</field>
102             <field name="arch" type="xml">
103                 <form string="Sales Payment">
104                     <group col="6" colspan="4">
105                         <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" string="Customer"/>
106                         <field name="journal_id"
107                             domain="[('type','in',['bank', 'cash'])]"
108                             widget="selection" select="1"
109                             on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"
110                             string="Payment Method"/>
111                         <field name="amount"
112                             on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
113                         <field name="reference" select="1" string="Payment Ref"/>
114                         <field name="name" colspan="4"/>
115                         <field name="account_id"
116                             widget="selection"
117                             invisible="True"/>
118                         <field name="pre_line" invisible="1"/>
119                         <field name="type" invisible="True"/>
120                     </group>
121                     <notebook colspan="4">
122                         <page string="Payment Information">
123                             <field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
124                                 <tree string="Invoices and outstanding transactions" editable="bottom">
125                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
126                                         on_change="onchange_move_line_id(move_line_id)"
127                                         domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
128                                         />
129                                     <field name="account_id"  groups="base.group_extended" domain="[('type','=','receivable')]"/>
130                                     <field name="date_original" readonly="1"/>
131                                     <field name="date_due" readonly="1"/>
132                                     <field name="amount_original" readonly="1"/>
133                                     <field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
134                                     <field name="amount" sum="Payment"/>
135                                 </tree>
136                             </field>
137                             <field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
138                                 <tree string="Credits" editable="bottom">
139                                     <field name="move_line_id"/>
140                                     <field name="account_id"  groups="base.group_extended" domain="[('type','=','receivable')]"/>
141                                     <field name="date_original"/>
142                                     <field name="amount_original"/>
143                                     <field name="amount" sum="Payment"/>
144                                 </tree>
145                             </field>
146                             <group col="2" colspan="3">
147                                 <separator string="Internal Notes" colspan="2"/>
148                                 <field name="narration" colspan="2" nolabel="1"/>
149                             </group>
150                             <group col="2" colspan="1">
151                                 <separator string="Other Information" colspan="2"/>
152                                 <field name="date" select="1" on_change="onchange_date(date)"/>
153                                 <field name="currency_id" select="1"/>
154                                 <field name="number"/>
155                             </group>
156                         </page>
157                         <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
158                             <group col="6" colspan="4">
159                                 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
160                                 <field name="period_id"/>
161                                 <field name="audit"/>
162                             </group>
163                             <separator string="Journal Items" colspan="4"/>
164                             <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
165                         </page>
166                     </notebook>
167                     <group col="10" colspan="4">
168                         <field name="state"/>
169                         <button name="cancel_voucher" string="Cancel" states="draft,proforma"  icon="gtk-cancel"/>
170                         <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to unreconcile this record ?"/>
171                         <button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
172                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
173                     </group>
174                 </form>
175             </field>
176         </record>
177         
178         <record id="action_vendor_receipt" model="ir.actions.act_window">
179             <field name="name">Sales Payment</field>
180             <field name="res_model">account.voucher.open</field>
181             <field name="view_type">form</field>
182             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]</field>
183             <field name="context">{'journal_type':'bank', 'type':'receipt'}</field>
184             <field name="view_id" ref="account_open_vouchers_view"/>
185             <field name="target">new</field>
186         </record>
187         <menuitem action="action_vendor_receipt" icon="STOCK_JUSTIFY_FILL" sequence="12"
188             id="menu_action_vendor_receipt"  parent="account.menu_finance_receivables"/>
189     </data>
190 </openerp>