1 <?xml version="1.0" encoding="UTF-8"?>
6 <!-- id="act_pay_voucher"-->
7 <!-- name="Sales Payment"-->
8 <!-- context="{'partner_id': partner_id, 'type':'receipt', 'journal_type':'bank'}"-->
9 <!-- res_model="account.voucher"-->
10 <!-- src_model="account.voucher"/>-->
11 <!-- <record id="act_pay_voucher" model="ir.actions.act_window">-->
12 <!-- <field name="name">Sales Payment</field>-->
13 <!-- <field name="res_model">account.voucher.open</field>-->
14 <!-- <field name="view_type">form</field>-->
15 <!-- <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>-->
16 <!-- <field name="context">{'journal_type':'bank', 'type':'receipt', 'partner_id': partner_id}</field>-->
17 <!-- <field name="view_id" ref="account_open_vouchers_view"/>-->
18 <!-- <field name="target">new</field>-->
21 <record model="ir.ui.view" id="view_sale_receipt_form">
22 <field name="name">account.voucher.sale.form</field>
23 <field name="model">account.voucher</field>
24 <field name="type">form</field>
25 <field name="arch" type="xml">
26 <form string="Sales Receipt">
27 <group col="6" colspan="4">
28 <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id)" string="Customer"/>
29 <field name="journal_id" domain="[('type','=','sale')]" widget="selection" on_change="onchange_journal(journal_id)"/>
30 <field name="number"/>
31 <field name="name" colspan="4"/>
32 <field name="date" on_change="onchange_date(date)"/>
33 <field name="type" invisible="True"/>
35 <notebook colspan="4">
36 <page string="Sales Information">
37 <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">
38 <tree string="Sales Lines" editable="bottom">
39 <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
41 <field name="amount" sum="Total"/>
42 <field name="account_analytic_id" groups="base.group_extended"/>
45 <group col="2" colspan="3">
46 <separator string="Internal Notes" colspan="2"/>
47 <field name="narration" colspan="2" nolabel="1"/>
49 <group col="2" colspan="1">
50 <group col="2" colspan="1">
51 <separator string="Payment Options" colspan="2"/>
52 <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
53 <field name="account_id"
54 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
55 domain="[('user_type.report_type','=','asset'), ('type','=','other')]"/>
56 <!-- should select income accounts only. Or use the journal for this ? -->
57 <field name="reference"
58 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
61 <group col="4" colspan="1">
62 <separator string="Total" colspan="4"/>
63 <field name="tax_id" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('sale','all'))]"/><field name="tax_amount" on_change="onchange_price(line_ids, tax_id, partner_id)" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
64 <label colspan="1" string=""/><field name="amount" string="Total"/>
68 <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
69 <group col="6" colspan="4">
70 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
71 <field name="period_id"/>
74 <separator string="Journal Items" colspan="4"/>
75 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
78 <group col="10" colspan="4">
80 <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
81 <button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
82 <!-- <button name="%(action_vendor_receipt)d" type="action" string="Pay"/>-->
83 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
84 <button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
90 <!-- Sales Voucher -->
91 <record id="action_sale_receipt" model="ir.actions.act_window">
92 <field name="name">Sales Receipt</field>
93 <field name="res_model">account.voucher.open</field>
94 <field name="view_type">form</field>
95 <field name="domain">[('journal_id.type','=','sale'), ('type','=','sale')]</field>
96 <field name="context">{'journal_type':'sale', 'type':'sale'}</field>
97 <field name="view_id" ref="account_open_vouchers_view"/>
98 <field name="target">new</field>
100 <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
101 action="action_sale_receipt" parent="account.menu_finance_receivables" sequence="14"/>
103 <!-- Purchase Vouchers -->
104 <record model="ir.ui.view" id="view_purchase_receipt_form">
105 <field name="name">account.voucher.purchase.form</field>
106 <field name="model">account.voucher</field>
107 <field name="type">form</field>
108 <field name="arch" type="xml">
109 <form string="Vendor Bills">
110 <group col="6" colspan="4">
111 <field name="partner_id" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount)"/>
112 <field name="journal_id" domain="[('type','=','purchase')]" widget="selection" select="1" on_change="onchange_journal(journal_id)"/>
113 <field name="reference" select="1"/>
114 <field name="name" colspan="4"/>
115 <field name="number"/>
116 <field name="account_id" domain="[('type','=','other')]" invisible="True"/>
117 <field name="type" invisible="True"/>
119 <notebook colspan="4">
120 <page string="Bill Information">
121 <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, False, parent.partner_id)" default_get="{'journal_id':journal_id,'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
122 <tree string="Expense Lines" editable="bottom">
123 <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
125 <field name="amount"/>
126 <field name="account_analytic_id" groups="base.group_extended"/>
129 <group col="2" colspan="3">
130 <separator string="Internal Notes" colspan="2"/>
131 <field name="narration" colspan="2" nolabel="1"/>
133 <group col="4" colspan="1">
134 <group col="2" colspan="1">
135 <separator string="Other Information" colspan="2"/>
136 <field name="date" string="Bill Date" select="1" on_change="onchange_date(date)"/>
138 <group col="2" colspan="1">
139 <separator string="Payment Terms" colspan="2"/>
140 <field name="term_id" widget="selection" on_change="onchange_term_id(term_id, amount)"/>
141 <field name="date_due"/>
142 <field name="amount" required="0" string="Amount Due"/>
146 <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
147 <group col="6" colspan="4">
148 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
149 <field name="period_id"/>
150 <field name="audit"/>
152 <separator string="Journal Items" colspan="4"/>
153 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
156 <group col="10" colspan="4">
157 <field name="state"/>
158 <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
159 <button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
160 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
161 <button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
166 <record id="action_purchase_receipt" model="ir.actions.act_window">
167 <field name="name">Vendor Bills</field>
168 <field name="res_model">account.voucher.open</field>
169 <field name="view_type">form</field>
170 <field name="domain">[('journal_id.type','=','purchase'), ('type','=','purchase')]</field>
171 <field name="context">{'journal_type':'purchase', 'type':'purchase'}</field>
172 <field name="view_id" ref="account_open_vouchers_view"/>
173 <field name="target">new</field>
175 <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
176 action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="14"/>