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" required="1" on_change="onchange_partner_id(partner_id, journal_id)" string="Customer"/>
12 <field name="journal_id" domain="[('type','=','sale')]" widget="selection" on_change="onchange_journal(journal_id)"/>
13 <field name="number"/>
14 <field name="name" colspan="4"/>
15 <field name="date" on_change="onchange_date(date)"/>
16 <field name="type" invisible="True"/>
18 <notebook colspan="4">
19 <page string="Sales Information">
20 <field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, parent.partner_id)" default_get="{'journal_id':journal_id, '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.report_type','=','income'),('type','!=','view')]" 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="Internal Notes" 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)" required="1"/>
36 <field name="account_id"
37 attrs="{'invisible':[('pay_now','!=','pay_now')]}"
38 domain="[('user_type.report_type','=','asset')]"/>
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(line_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"/>
47 <label colspan="1" string=""/><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="Post" states="draft" icon="terp-document-new"/>
64 <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
65 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
66 <button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" 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'), ('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" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount)"/>
94 <field name="journal_id" domain="[('type','=','purchase')]" widget="selection" select="1" on_change="onchange_journal(journal_id)"/>
95 <field name="number"/>
96 <field name="name" colspan="4"/>
97 <field name="reference" select="1"/>
98 <field name="account_id" domain="[('type','=','other')]" invisible="True"/>
99 <field name="type" invisible="True"/>
101 <notebook colspan="4">
102 <page string="Bill Information">
103 <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">
104 <tree string="Expense Lines" editable="bottom">
105 <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
107 <field name="amount"/>
108 <field name="account_analytic_id" groups="base.group_extended"/>
111 <group col="2" colspan="3">
112 <separator string="Internal Notes" colspan="2"/>
113 <field name="narration" colspan="2" nolabel="1"/>
115 <group col="4" colspan="1">
116 <group col="2" colspan="1">
117 <separator string="Other Information" colspan="2"/>
118 <field name="date" string="Bill Date" select="1" on_change="onchange_date(date)"/>
120 <group col="2" colspan="1">
121 <separator string="Payment Terms" colspan="2"/>
122 <field name="term_id" widget="selection" on_change="onchange_term_id(term_id, amount)"/>
123 <field name="date_due"/>
124 <field name="amount" required="0" string="Amount Due"/>
128 <page string="Journal Items">
129 <group col="6" colspan="4">
130 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
131 <field name="period_id"/>
132 <field name="audit"/>
134 <separator string="Journal Items" colspan="4"/>
135 <field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
138 <group col="10" colspan="4">
139 <field name="state"/>
140 <button name="proforma_voucher" string="Post" states="draft" icon="terp-document-new"/>
141 <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
142 <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
143 <button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
148 <record id="action_purchase_receipt" model="ir.actions.act_window">
149 <field name="name">Vendor Bills</field>
150 <field name="res_model">account.voucher.open</field>
151 <field name="view_type">form</field>
152 <field name="domain">[('journal_id.type','=','purchase'), ('type','=','purchase')]</field>
153 <field name="context">{'journal_type':'purchase', 'type':'purchase'}</field>
154 <field name="view_id" ref="account_open_vouchers_view"/>
155 <field name="target">new</field>
157 <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
158 action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="14"/>