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