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">
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')]" help="To Review"/>
15 <separator orientation="vertical"/>
17 <field name="number"/>
18 <field name="partner_id" string="Supplier"/>
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"/>
26 <group expand="0" string="Group By...">
27 <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
28 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
29 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
30 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
36 <record id="view_voucher_filter_sale" model="ir.ui.view">
37 <field name="name">account.voucher.sale.select</field>
38 <field name="model">account.voucher</field>
39 <field name="type">search</field>
40 <field name="arch" type="xml">
41 <search string="Search Vouchers">
43 <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
44 <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
45 <separator orientation="vertical"/>
46 <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" help="To Review"/>
47 <separator orientation="vertical"/>
49 <field name="number"/>
50 <field name="partner_id" string="Customer"/>
54 <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/>
55 <field name="period_id"/>
58 <group expand="0" string="Group By...">
59 <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
60 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
61 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
62 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
68 <record id="act_pay_voucher" model="ir.actions.act_window">
69 <field name="name">Customer Payment</field>
70 <field name="res_model">account.voucher</field>
71 <field name="view_type">form</field>
72 <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
73 <field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
74 <field name="view_id" ref="view_vendor_receipt_form"/>
75 <field name="target">current</field>
78 <record model="ir.ui.view" id="view_sale_receipt_form">
79 <field name="name">account.voucher.sale.form</field>
80 <field name="model">account.voucher</field>
81 <field name="type">form</field>
82 <field name="arch" type="xml">
85 <button name="proforma_voucher" string="Validate" states="draft"/>
86 <button 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'),'|',('state','=','draft'), ('paid','=',True)]}"/>
87 <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
88 <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
89 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
90 <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
92 <sheet string="Sales Receipt" layout="auto">
93 <div class="oe_title">
94 <label for="number" class="oe_edit_only"/>
95 <h1><field name="number" readonly="0" /></h1>
100 <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}"/>
101 <field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
102 <field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
103 <field name="name" colspan="2"/>
104 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
107 <field name="currency_id"/>
108 <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, date, amount, type, company_id, context)"/>
109 <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
110 <field name="account_id"
111 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
112 domain="[('type','=','liquidity')]"/>
113 <field name="reference"
114 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
116 <field name="paid" invisible="1"/>
118 <field name="type" invisible="True"/>
121 <page string="Sales Information">
122 <field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
123 <tree string="Sales Lines" editable="bottom">
124 <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
126 <field name="amount" sum="Total"/>
127 <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
132 <field name="narration" placeholder="Internal Notes" nolabel="1" />
135 <group class="oe_subtotal_footer" string="Total">
137 on_change="onchange_price(line_cr_ids, tax_id, partner_id)"
139 domain="[('type_tax_use','in',('sale','all')), ('parent_id', '=', False)]"/>
140 <field name="tax_amount" nolabel="1"/>
141 <field name="amount" class="oe_subtotal_footer_separator" />
142 <button type="object"
143 icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax"
144 attrs="{'invisible': [('state','!=','draft')]}"/>
149 <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
151 <field name="period_id"/>
152 <field name="audit"/>
154 <field name="move_ids" readonly="1">
155 <tree string="Journal Items">
156 <field name="move_id"/>
159 <field name="statement_id"/>
160 <field name="partner_id"/>
161 <field name="account_id"/>
163 <field name="debit"/>
164 <field name="credit"/>
165 <field name="state"/>
166 <field name="reconcile_id"/>
176 <!-- Sales Voucher -->
177 <record id="action_sale_receipt" model="ir.actions.act_window">
178 <field name="name">Sales Receipt</field>
179 <field name="res_model">account.voucher</field>
180 <field name="view_type">form</field>
181 <field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
182 <field name="context">{'default_type': 'sale', 'type': 'sale'}</field>
183 <field name="view_id" eval="False"/>
184 <field name="search_view_id" ref="view_voucher_filter_sale"/>
185 <field name="target">current</field>
186 <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>
188 <record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
189 <field eval="1" name="sequence"/>
190 <field name="view_mode">tree</field>
191 <field name="act_window_id" ref="action_sale_receipt"/>
193 <record id="action_sale_receipt_form" model="ir.actions.act_window.view">
194 <field eval="2" name="sequence"/>
195 <field name="view_mode">form</field>
196 <field name="view_id" ref="view_sale_receipt_form"/>
197 <field name="act_window_id" ref="action_sale_receipt"/>
200 <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
201 action="action_sale_receipt"
202 parent="account.menu_finance_receivables"
205 <!-- Purchase Vouchers -->
206 <record id="act_pay_bills" model="ir.actions.act_window">
207 <field name="name">Bill Payment</field>
208 <field name="res_model">account.voucher</field>
209 <field name="view_type">form</field>
210 <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
211 <field name="context">{'default_type':'payment', 'type':'payment', 'default_partner_id': partner_id, 'partner_id': partner_id, 'default_reference':reference}</field>
212 <field name="view_id" ref="view_vendor_payment_form"/>
213 <field name="target">current</field>
215 <record model="ir.ui.view" id="view_purchase_receipt_form">
216 <field name="name">account.voucher.purchase.form</field>
217 <field name="model">account.voucher</field>
218 <field name="type">form</field>
219 <field name="arch" type="xml">
222 <button name="proforma_voucher" string="Validate" states="draft"/>
223 <button 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'),'|',('state','=','draft'), ('paid','=',True)]}"/>
224 <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
225 <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
226 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
227 <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
229 <sheet string="Supplier Voucher">
230 <div class="oe_title">
231 <label for="number" class="oe_edit_only"/>
232 <h1><field name="number" readonly="0" /></h1>
235 <field name="pay_now" invisible="1"/>
238 <field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
239 <field name="date" string="Bill Date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
240 <field name="date_due"/>
241 <field name="name" colspan="2"/>
245 <field name="paid" invisible="1"/>
246 <field name="currency_id"/>
247 <field name="journal_id"
248 domain="[('type','in',['purchase','purchase_refund'])]"
250 on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
251 <field name="reference"/>
252 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
257 <field name="account_id" domain="[('type','=','other')]" invisible="True"/>
258 <field name="type" invisible="True"/>
260 <notebook colspan="4">
261 <page string="Bill Information">
262 <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" context="{'journal_id':journal_id,'partner_id':partner_id}">
263 <tree string="Expense Lines" editable="bottom">
264 <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
266 <field name="amount"/>
267 <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
272 <field name="narration" placeholder="Internal Notes" nolabel="1" />
274 <group class="oe_subtotal_footer">
277 <label for="tax_id" />
278 <button type="object"
279 icon="terp-stock_format-scientific"
281 attrs="{'invisible': [('state','!=','draft')]}"/>
285 on_change="onchange_price(line_dr_ids, tax_id, partner_id)"
287 domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"
289 <field name="tax_amount" />
290 <field name="amount" string="Total" class="oe_subtotal_footer_separator"/>
295 <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
297 <field name="period_id"/>
298 <field name="audit"/>
300 <field name="move_ids" readonly="1">
301 <tree string="Journal Items">
302 <field name="move_id"/>
305 <field name="statement_id"/>
306 <field name="partner_id"/>
307 <field name="account_id"/>
309 <field name="debit"/>
310 <field name="credit"/>
311 <field name="state"/>
312 <field name="reconcile_id"/>
321 <record id="action_purchase_receipt" model="ir.actions.act_window">
322 <field name="name">Purchase Receipt</field>
323 <field name="res_model">account.voucher</field>
324 <field name="view_type">form</field>
325 <field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
326 <field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
327 <field name="view_id" eval="False"/>
328 <field name="search_view_id" eval="view_voucher_filter_vendor"/>
329 <field name="target">current</field>
331 <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
332 <field eval="1" name="sequence"/>
333 <field name="view_mode">tree</field>
334 <field name="act_window_id" ref="action_purchase_receipt"/>
336 <record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
337 <field eval="2" name="sequence"/>
338 <field name="view_mode">form</field>
339 <field name="view_id" ref="view_purchase_receipt_form"/>
340 <field name="act_window_id" ref="action_purchase_receipt"/>
343 <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
344 action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>