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="arch" type="xml">
8 <search string="Search Vouchers">
9 <field name="number" string="Voucher"/>
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 <field name="partner_id" string="Supplier" filter_domain="[('partner_id','child_of',self)]"/>
14 <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
15 <field name="period_id"/>
16 <group expand="0" string="Group By...">
17 <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
18 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
19 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
20 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
26 <record id="view_voucher_filter_sale" model="ir.ui.view">
27 <field name="name">account.voucher.sale.select</field>
28 <field name="model">account.voucher</field>
29 <field name="arch" type="xml">
30 <search string="Search Vouchers">
31 <field name="number" string="Voucher"/>
33 <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
34 <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
35 <field name="partner_id" string="Customer" filter_domain="[('partner_id','child_of',self)]"/>
36 <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
37 <field name="period_id"/>
38 <group expand="0" string="Group By...">
39 <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
40 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
41 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
42 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
48 <record id="act_pay_voucher" model="ir.actions.act_window">
49 <field name="name">Customer Payments</field>
50 <field name="res_model">account.voucher</field>
51 <field name="view_type">form</field>
52 <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
53 <field name="context">{'default_type':'receipt', 'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
54 <field name="view_id" ref="view_vendor_receipt_form"/>
55 <field name="target">current</field>
58 <record model="ir.ui.view" id="view_sale_receipt_form">
59 <field name="name">account.voucher.sale.form</field>
60 <field name="model">account.voucher</field>
61 <field name="arch" type="xml">
62 <form string="Sales Receipt" version="7.0">
64 <button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
65 <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="Validate Payment" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_highlight"/>
66 <button name="cancel_voucher" string="Cancel Receipt" states="draft,proforma" />
67 <button name="cancel_voucher" string="Cancel Receipt" type="object" states="posted" confirm="Are you sure you want to cancel this receipt?"/>
68 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
69 <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
71 <sheet string="Sales Receipt" >
72 <h1><label for="number" string="Sales Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
75 <field name="type" invisible="True"/>
76 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
77 <field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
78 <field name="account_id"
79 domain="[('type','in', ['liquidity', 'receivable'])]"/>
80 <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
81 <field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
82 <field name="reference"
83 attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
86 <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)" groups="account.group_account_user"/>
87 <field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
89 <field name="paid" invisible="1"/>
90 <field name="paid_amount_in_company_currency" invisible="1"/>
91 <field name="currency_id" invisible="1"/>
95 <page string="Sales Information">
96 <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}">
97 <tree string="Sales Lines" editable="bottom">
98 <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
100 <field name="amount" sum="Total"/>
101 <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
105 <field name="narration" placeholder="Internal Notes" nolabel="1"/>
106 <group class="oe_subtotal_footer oe_right">
108 on_change="onchange_price(line_cr_ids, tax_id, partner_id)"
109 widget="selection" nolabel="1"
111 domain="[('type_tax_use','in',('sale','all')), ('parent_id', '=', False)]"/>
112 <field name="tax_amount" nolabel="1"/>
113 <div class="oe_subtotal_footer_separator">
114 <label for="amount"/>
115 <button type="object" class="oe_link oe_edit_only"
116 name="compute_tax" string="(update)"
117 attrs="{'invisible': [('state','!=','draft')]}"/>
119 <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
123 <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
125 <field name="period_id"/>
126 <field name="audit"/>
128 <field name="move_ids" readonly="1">
129 <tree string="Journal Items">
130 <field name="move_id"/>
133 <field name="statement_id"/>
134 <field name="partner_id"/>
135 <field name="account_id"/>
137 <field name="debit"/>
138 <field name="credit"/>
139 <field name="state"/>
140 <field name="reconcile_id"/>
145 <group col="4" invisible="1">
146 <field name="is_multi_currency" invisible="1"/>
147 <field name="currency_help_label" invisible="1"/>
148 <field name="payment_rate" invisible="1"/>
149 <field name="payment_rate_currency_id" invisible="1"/>
150 <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
153 <div class="oe_chatter">
154 <field name="message_follower_ids" widget="mail_followers"/>
155 <field name="message_ids" widget="mail_thread"/>
161 <!-- Sales Voucher -->
162 <record id="action_sale_receipt" model="ir.actions.act_window">
163 <field name="name">Sales Receipts</field>
164 <field name="res_model">account.voucher</field>
165 <field name="view_type">form</field>
166 <field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
167 <field name="context">{'default_type': 'sale', 'type': 'sale'}</field>
168 <field name="view_id" eval="False"/>
169 <field name="search_view_id" ref="view_voucher_filter_sale"/>
170 <field name="target">current</field>
171 <field name="help" type="html">
172 <p class="oe_view_nocontent_create">
173 Click to create a sale receipt.
175 When the sale receipt is confirmed, you can record the customer
176 payment related to this sales receipt.
180 <record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
181 <field eval="1" name="sequence"/>
182 <field name="view_mode">tree</field>
183 <field name="act_window_id" ref="action_sale_receipt"/>
185 <record id="action_sale_receipt_form" model="ir.actions.act_window.view">
186 <field eval="2" name="sequence"/>
187 <field name="view_mode">form</field>
188 <field name="view_id" ref="view_sale_receipt_form"/>
189 <field name="act_window_id" ref="action_sale_receipt"/>
192 <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
193 action="action_sale_receipt"
194 parent="account.menu_finance_receivables"
197 <!-- Purchase Vouchers -->
198 <record id="act_pay_bills" model="ir.actions.act_window">
199 <field name="name">Bill Payment</field>
200 <field name="res_model">account.voucher</field>
201 <field name="view_type">form</field>
202 <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
203 <field name="context">{'default_type':'payment', 'type':'payment', 'default_partner_id': partner_id, 'partner_id': partner_id, 'default_reference':reference}</field>
204 <field name="view_id" ref="view_vendor_payment_form"/>
205 <field name="target">current</field>
207 <record model="ir.ui.view" id="view_purchase_receipt_form">
208 <field name="name">account.voucher.purchase.form</field>
209 <field name="model">account.voucher</field>
210 <field name="arch" type="xml">
211 <form string="Purchase Voucher" version="7.0">
213 <button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
214 <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)]}" class="oe_highlight"/>
215 <button name="cancel_voucher" string="Cancel Voucher" states="draft,proforma" />
216 <button name="cancel_voucher" string="Cancel Voucher" type="object" states="posted" confirm="Are you sure you want to cancel this receipt?"/>
217 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
218 <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
220 <sheet string="Supplier Voucher">
221 <h1><label for="number" string="Purchase Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
223 <field name="pay_now" invisible="1"/>
224 <field name="type" invisible="True"/>
227 <field name="partner_id" domain="[('supplier','=',True)]" 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}" />
228 <field name="account_id" domain="[('type', 'in', ['liquidity', 'payable'])]"/>
229 <field name="name" colspan="2"/>
230 <field name="reference"/>
231 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
234 <field name="date" string="Bill Date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
235 <field name="date_due"/>
236 <field name="paid" invisible="1"/>
237 <field name="currency_id" invisible="1"/>
238 <field name="journal_id"
239 domain="[('type','in',['purchase','purchase_refund'])]"
241 on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"
242 groups="account.group_account_user"/>
243 <field name="paid_amount_in_company_currency" invisible="1"/>
244 <field name="currency_help_label" invisible="1"/>
248 <page string="Bill Information">
249 <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}">
250 <tree string="Expense Lines" editable="bottom">
251 <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
253 <field name="amount"/>
254 <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
258 <field name="narration" placeholder="Internal Notes" nolabel="1"/>
259 <group class="oe_subtotal_footer oe_right">
262 <label for="tax_id" />
263 <button type="object"
264 icon="terp-stock_format-scientific"
266 attrs="{'invisible': [('state','!=','draft')]}"/>
270 on_change="onchange_price(line_dr_ids, tax_id, partner_id)"
271 widget="selection" nolabel="1"
274 domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"
276 <field name="tax_amount" nolabel="1"/>
277 <div class="oe_subtotal_footer_separator">
278 <label for="amount"/>
279 <button type="object" class="oe_link oe_edit_only"
280 name="compute_tax" string="(update)"
281 attrs="{'invisible': [('state','!=','draft')]}"/>
283 <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
287 <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
289 <field name="period_id"/>
290 <field name="audit"/>
292 <field name="move_ids" readonly="1">
293 <tree string="Journal Items">
294 <field name="move_id"/>
297 <field name="statement_id"/>
298 <field name="partner_id"/>
299 <field name="account_id"/>
301 <field name="debit"/>
302 <field name="credit"/>
303 <field name="state"/>
304 <field name="reconcile_id"/>
310 <div class="oe_chatter">
311 <field name="message_follower_ids" widget="mail_followers"/>
312 <field name="message_ids" widget="mail_thread"/>
317 <record id="action_purchase_receipt" model="ir.actions.act_window">
318 <field name="name">Purchase Receipts</field>
319 <field name="res_model">account.voucher</field>
320 <field name="view_type">form</field>
321 <field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
322 <field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
323 <field name="view_id" eval="False"/>
324 <field name="search_view_id" eval="view_voucher_filter_vendor"/>
325 <field name="target">current</field>
326 <field name="help" type="html">
327 <p class="oe_view_nocontent_create">
328 Click to register a purchase receipt.
330 When the purchase receipt is confirmed, you can record the
331 supplier payment related to this purchase receipt.
335 <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
336 <field eval="1" name="sequence"/>
337 <field name="view_mode">tree</field>
338 <field name="act_window_id" ref="action_purchase_receipt"/>
340 <record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
341 <field eval="2" name="sequence"/>
342 <field name="view_mode">form</field>
343 <field name="view_id" ref="view_purchase_receipt_form"/>
344 <field name="act_window_id" ref="action_purchase_receipt"/>
347 <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
348 action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>