1 <?xml version="1.0" encoding="UTF-8"?>
4 <record model="ir.ui.view" id="view_sale_receipt_form">
5 <field name="name">account.voucher.sale.form</field>
6 <field name="model">account.voucher</field>
7 <field name="type">form</field>
8 <field name="arch" type="xml">
9 <form string="Sales Receipt">
10 <group col="6" colspan="4">
11 <field name="partner_id" on_change="onchange_partner_id(partner_id, type, journal_id)" string="Customer"/>
12 <field name="journal_id" domain="[('type','=','sale')]" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
13 <field name="number"/>
14 <field name="name" colspan="4"/>
15 <field name="date" select="1" on_change="onchange_date(date)"/>
16 <field name="type" on_change="onchange_journal(journal_id,type)" invisible="True"/> <!-- Type is given by menu, not by journal ? yes-->
18 <notebook colspan="4">
19 <page string="Sales Information">
20 <field name="payment_ids" on_change="onchange_price(payment_ids, tax_amount, tax_id)" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
21 <tree string="Sales Lines" editable="bottom">
22 <field name="account_id" domain="[('user_type_type','=','income')]" widget="selection"/>
24 <field name="amount" sum="Total"/>
25 <field name="account_analytic_id" groups="base.group_extended"/>
28 <group col="2" colspan="3">
29 <separator string="Narration" colspan="2"/>
30 <field name="narration" colspan="2" nolabel="1"/>
32 <group col="2" colspan="1">
33 <group col="2" colspan="1">
34 <separator string="Payment Options" colspan="2"/>
35 <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id, type)" required="1"/>
36 <field name="account_id"
37 attrs="{'invisible':[('type','!=','view'),('pay_now','!=','pay_now')]}"
38 domain="[('user_type_type','=','asset'), ('type','!=','view')]"/>
39 <!-- should select income accounts only. Or use the journal for this ? -->
40 <field name="reference"
41 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
44 <group col="3" colspan="1">
45 <separator string="Total" colspan="3"/>
46 <field name="tax_id" on_change="onchange_price(payment_ids, tax_amount, tax_id)" widget="selection" domain="[('type_tax_use','in',('sale','all'))]"/><field name="tax_amount" on_change="onchange_price(payment_ids, tax_amount, tax_id)" nolabel="1"/>
47 <label string="" colspan="1"/><field name="amount" string="Total"/>
51 <page string="Journal Items" groups="base.group_extended">
52 <group col="6" colspan="4">
53 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
54 <field name="period_id"/>
57 <separator string="Journal Items" colspan="4"/>
58 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
61 <group col="10" colspan="4">
63 <button name="proforma_voucher" string="Create" states="draft" icon="terp-document-new"/>
64 <button name="recheck_voucher" string="Approve" states="recheck" icon="terp-check"/>
65 <button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck" icon="gtk-cancel"/>
66 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
72 <!-- Sales Voucher -->
73 <record id="action_sale_receipt" model="ir.actions.act_window">
74 <field name="name">Sales Receipt</field>
75 <field name="res_model">account.voucher.open</field>
76 <field name="view_type">form</field>
77 <field name="domain">[('journal_id.type','=','sale')]</field>
78 <field name="context">{'journal_type':'sale', 'type':'sale'}</field>
79 <field name="view_id" ref="account_open_vouchers_view"/>
80 <field name="target">new</field>
82 <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
83 action="action_sale_receipt" parent="account.menu_finance_receivables" sequence="14"/>
85 <!-- Purchase Vouchers -->
86 <record model="ir.ui.view" id="view_purchase_receipt_form">
87 <field name="name">account.voucher.purchase.form</field>
88 <field name="model">account.voucher</field>
89 <field name="type">form</field>
90 <field name="arch" type="xml">
91 <form string="Vendor Bills">
92 <group col="6" colspan="4">
93 <field name="partner_id" on_change="onchange_partner_id(partner_id, type, journal_id)"/>
94 <field name="name" colspan="4"/>
95 <field name="journal_id" domain="[('type','=','purchase')]" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
96 <field name="account_id" domain="[('type','=','other')]" widget="selection" on_change="onchange_account(account_id)"/>
97 <field name="number"/>
99 <notebook colspan="4">
100 <page string="Bill Information">
101 <field name="payment_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
102 <tree string="Voucher Lines" editable="bottom">
103 <field name="stype" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
104 <field name="ref" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
105 <field name="amount"/>
106 <field name="account_id" domain="[('user_type_type','=','expense'), ('type','!=','view')]"/>
107 <field name="type" on_change="onchange_type(parent.partner_id,type,parent.type, parent.currency_id)"/>
108 <field name="account_analytic_id"/>
111 <group col="2" colspan="3">
112 <separator string="Narration" colspan="2"/>
113 <field name="narration" colspan="2" nolabel="1"/>
115 <group col="2" colspan="1">
116 <separator string="Other Information" colspan="2"/>
117 <field name="reference" select="1"/>
118 <field name="date" select="1" on_change="onchange_date(date)"/>
119 <field name="type" on_change="onchange_journal(journal_id,type)"/>
122 <page string="Journal Items">
123 <group col="6" colspan="4">
124 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
125 <field name="period_id"/>
126 <field name="audit"/>
128 <separator string="Journal Items" colspan="4"/>
129 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
132 <group col="10" colspan="4">
133 <field name="state"/>
134 <button name="proforma_voucher" string="Create" states="draft" icon="terp-document-new"/>
135 <button name="recheck_voucher" string="Approve" states="recheck" icon="terp-check"/>
136 <button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck" icon="gtk-cancel"/>
137 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
142 <record id="action_purchase_receipt" model="ir.actions.act_window">
143 <field name="name">Vendor Bills</field>
144 <field name="res_model">account.voucher.open</field>
145 <field name="view_type">form</field>
146 <field name="domain">[('journal_id.type','=','purchase')]</field>
147 <field name="context">{'journal_type':'purchase', 'type':'purchase'}</field>
148 <field name="view_id" ref="account_open_vouchers_view"/>
149 <field name="target">new</field>
151 <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
152 action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="14"/>