1 <?xml version="1.0" encoding="UTF-8"?>
4 <record id="view_voucher_filter_vendor" model="ir.ui.view">
5 <field name="name">account.voucher.purchase.select</field>
6 <field name="model">account.voucher</field>
7 <field name="type">search</field>
8 <field name="arch" type="xml">
9 <search string="Search Vouchers">
10 <group col='8' colspan='4'>
11 <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
12 <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
13 <separator orientation="vertical"/>
14 <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" groups="base.group_extended" help="To Review"/>
15 <separator orientation="vertical"/>
17 <field name="number"/>
18 <field name="partner_id" string="Supplier"/>
21 <group col='8' colspan='4'>
22 <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/>
23 <field name="period_id" groups="base.group_extended"/>
26 <group expand="0" string="Extended Filters..." col='8' colspan='4'>
27 <field name="reference"/>
29 <field name="narration"/>
30 <field name="amount"/>
33 <group expand="0" string="Group By..." colspan="4" col="10">
34 <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
35 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
36 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
37 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
43 <record id="view_voucher_filter_sale" model="ir.ui.view">
44 <field name="name">account.voucher.sale.select</field>
45 <field name="model">account.voucher</field>
46 <field name="type">search</field>
47 <field name="arch" type="xml">
48 <search string="Search Vouchers">
49 <group col='8' colspan='4'>
50 <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
51 <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
52 <separator orientation="vertical"/>
53 <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" groups="base.group_extended" help="To Review"/>
54 <separator orientation="vertical"/>
56 <field name="number"/>
57 <field name="partner_id" string="Customer"/>
60 <group col='8' colspan='4'>
61 <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/>
62 <field name="period_id" groups="base.group_extended"/>
65 <group expand="0" string="Extended Filters..." col='8' colspan='4'>
66 <field name="reference"/>
68 <field name="narration"/>
69 <field name="amount"/>
72 <group expand="0" string="Group By..." colspan="4" col="10">
73 <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
74 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
75 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
76 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
82 <record id="act_pay_voucher" model="ir.actions.act_window">
83 <field name="name">Customer Payment</field>
84 <field name="res_model">account.voucher</field>
85 <field name="view_type">form</field>
86 <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
87 <field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
88 <field name="view_id" ref="view_vendor_receipt_form"/>
89 <field name="target">current</field>
92 <record model="ir.ui.view" id="view_sale_receipt_form">
93 <field name="name">account.voucher.sale.form</field>
94 <field name="model">account.voucher</field>
95 <field name="type">form</field>
96 <field name="arch" type="xml">
97 <form string="Sales Receipt">
98 <group col="6" colspan="4">
99 <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" string="Customer"/>
100 <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id)"/>
101 <field name="number"/>
102 <field name="name" colspan="4"/>
103 <field name="date" on_change="onchange_date(date)"/>
104 <field name="type" invisible="True"/>
105 <field name="currency_id" invisible="True" nolabel="1"/>
107 <notebook colspan="4">
108 <page string="Sales Information">
109 <field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
110 <tree string="Sales Lines" editable="bottom">
111 <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
113 <field name="amount" sum="Total"/>
114 <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
117 <group col="2" colspan="3">
118 <separator string="Internal Notes" colspan="2"/>
119 <field name="narration" colspan="2" nolabel="1"/>
121 <group col="2" colspan="1">
122 <group col="2" colspan="1">
123 <separator string="Payment Options" colspan="2"/>
124 <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
125 <field name="account_id"
126 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
127 domain="[('type','=','liquidity')]"/>
128 <!-- should select income accounts only. Or use the journal for this ? -->
129 <field name="reference"
130 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
132 <field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
134 <group col="4" colspan="1">
135 <separator string="Total" colspan="4"/>
136 <field name="tax_id" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('sale','all')), ('parent_id', '=', False)]"/><field name="tax_amount" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" groups="base.group_extended" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
137 <label string="" colspan="1"/><field name="amount" string="Total"/>
141 <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
142 <group col="6" colspan="4">
143 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
144 <field name="period_id"/>
145 <field name="audit"/>
147 <separator string="Journal Items" colspan="4"/>
148 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
151 <group col="8" colspan="4">
152 <field name="state"/>
153 <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
154 <button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
155 <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
156 <group attrs="{'invisible':[('state','!=','posted')]}">
157 <button icon="terp-dolar_ok!" name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
159 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
165 <!-- Sales Voucher -->
166 <record id="action_sale_receipt" model="ir.actions.act_window">
167 <field name="name">Sales Receipt</field>
168 <field name="res_model">account.voucher</field>
169 <field name="view_type">form</field>
170 <field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
171 <field name="context">{'type':'sale'}</field>
172 <field name="view_id" eval="False"/>
173 <field name="search_view_id" ref="view_voucher_filter_sale"/>
174 <field name="target">current</field>
175 <field name="help">When you sell products to a customer, you can give him a sales receipt or an invoice. When the sales receipt is confirmed, it creates journal items automatically and you can record the customer payment related to this sales receipt.</field>
177 <record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
178 <field eval="1" name="sequence"/>
179 <field name="view_mode">tree</field>
180 <field name="act_window_id" ref="action_sale_receipt"/>
182 <record id="action_sale_receipt_form" model="ir.actions.act_window.view">
183 <field eval="2" name="sequence"/>
184 <field name="view_mode">form</field>
185 <field name="view_id" ref="view_sale_receipt_form"/>
186 <field name="act_window_id" ref="action_sale_receipt"/>
189 <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
190 action="action_sale_receipt"
191 parent="account.menu_finance_receivables"
192 groups="base.group_extended"
195 <!-- Purchase Vouchers -->
196 <record id="act_pay_bills" model="ir.actions.act_window">
197 <field name="name">Bill Payment</field>
198 <field name="res_model">account.voucher</field>
199 <field name="view_type">form</field>
200 <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
201 <field name="context">{'type':'payment', 'partner_id': partner_id, 'default_reference':reference}</field>
202 <field name="view_id" ref="view_vendor_payment_form"/>
203 <field name="target">current</field>
205 <record model="ir.ui.view" id="view_purchase_receipt_form">
206 <field name="name">account.voucher.purchase.form</field>
207 <field name="model">account.voucher</field>
208 <field name="type">form</field>
209 <field name="arch" type="xml">
210 <form string="Supplier Voucher">
211 <group col="6" colspan="4">
212 <field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
213 <field name="journal_id" domain="[('type','in',['purchase','purchase_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id)"/>
214 <field name="number"/>
215 <field name="name" colspan="4"/>
216 <field name="reference" select="1"/>
217 <field name="account_id" domain="[('type','=','other')]" invisible="True"/>
218 <field name="type" invisible="True"/>
219 <field name="currency_id" invisible="True" nolabel="1"/>
221 <notebook colspan="4">
222 <page string="Bill Information">
223 <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" default_get="{'journal_id':journal_id,'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
224 <tree string="Expense Lines" editable="bottom">
225 <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
227 <field name="amount"/>
228 <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
231 <group col="2" colspan="3">
232 <separator string="Internal Notes" colspan="2"/>
233 <field name="narration" colspan="2" nolabel="1"/>
235 <group col="2" colspan="1">
236 <group col="2" colspan="1">
237 <separator string="Payment Terms" colspan="2"/>
238 <field name="date" string="Bill Date" select="1" on_change="onchange_date(date)"/>
239 <field name="date_due"/>
241 <group col="4" colspan="1">
242 <separator string="Total" colspan="4"/>
243 <field name="tax_id" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"/><field name="tax_amount" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" groups="base.group_extended" attrs="{'invisible': [('state','!=','draft')]}"/>
244 <label string="" colspan="1"/><field name="amount" string="Total"/>
248 <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
249 <group col="6" colspan="4">
250 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
251 <field name="period_id"/>
252 <field name="audit"/>
254 <separator string="Journal Items" colspan="4"/>
255 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
258 <group col="10" colspan="4">
259 <field name="state"/>
260 <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
261 <button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
262 <group attrs="{'invisible':[('state','!=','posted')]}">
263 <button icon="terp-dolar_ok!" name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
265 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
266 <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
271 <record id="action_purchase_receipt" model="ir.actions.act_window">
272 <field name="name">Supplier Vouchers</field>
273 <field name="res_model">account.voucher</field>
274 <field name="view_type">form</field>
275 <field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
276 <field name="context">{'type':'purchase'}</field>
277 <field name="view_id" eval="False"/>
278 <field name="search_view_id" eval="view_voucher_filter_vendor"/>
279 <field name="target">current</field>
281 <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
282 <field eval="1" name="sequence"/>
283 <field name="view_mode">tree</field>
284 <field name="act_window_id" ref="action_purchase_receipt"/>
286 <record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
287 <field eval="2" name="sequence"/>
288 <field name="view_mode">form</field>
289 <field name="view_id" ref="view_purchase_receipt_form"/>
290 <field name="act_window_id" ref="action_purchase_receipt"/>
293 <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
294 action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"
295 groups="base.group_extended"/>