odoo/addons/account_voucher/voucher_sales_purchase_view...

183 lines
13 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<act_window
id="act_pay_voucher"
name="Sales Payment"
context="{'default_journal_type':'bank', 'default_type':'receipt', 'default_partner_id': partner_id}"
view_id="account_open_vouchers_view"
res_model="account.voucher"
src_model="account.voucher"/>
<!-- <record id="act_pay_voucher" model="ir.actions.act_window">-->
<!-- <field name="name">Sales Payment</field>-->
<!-- <field name="res_model">account.voucher.open</field>-->
<!-- <field name="view_type">form</field>-->
<!-- <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>-->
<!-- <field name="context">{'default_journal_type':'bank', 'default_type':'receipt', 'default_partner_id': partner_id}</field>-->
<!-- <field name="view_id" ref="account_open_vouchers_view"/>-->
<!-- <field name="target">new</field>-->
<!-- </record>-->
<record model="ir.ui.view" id="view_sale_receipt_form">
<field name="name">account.voucher.sale.form</field>
<field name="model">account.voucher</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Receipt">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id)" string="Customer"/>
<field name="journal_id" domain="[('type','=','sale')]" widget="selection" on_change="onchange_journal(journal_id)"/>
<field name="number"/>
<field name="name" colspan="4"/>
<field name="date" on_change="onchange_date(date)"/>
<field name="type" invisible="True"/>
</group>
<notebook colspan="4">
<page string="Sales Information">
<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">
<tree string="Sales Lines" editable="bottom">
<field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
<field name="name"/>
<field name="amount" sum="Total"/>
<field name="account_analytic_id" groups="base.group_extended"/>
</tree>
</field>
<group col="2" colspan="3">
<separator string="Internal Notes" colspan="2"/>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<group col="2" colspan="1">
<separator string="Payment Options" colspan="2"/>
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
<field name="account_id"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
domain="[('user_type.report_type','=','asset'), ('type','=','other')]"/>
<!-- should select income accounts only. Or use the journal for this ? -->
<field name="reference"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
/>
</group>
<group col="4" colspan="1">
<separator string="Total" colspan="4"/>
<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')]}"/>
<label colspan="1" string=""/><field name="amount" string="Total"/>
</group>
</group>
</page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
<field name="audit"/>
</group>
<separator string="Journal Items" colspan="4"/>
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
</page>
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
<!-- <button name="%(act_pay_voucher)d" type="action" string="Pay"/>-->
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
</record>
<!-- Sales Voucher -->
<record id="action_sale_receipt" model="ir.actions.act_window">
<field name="name">Sales Receipt</field>
<field name="res_model">account.voucher.open</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','=','sale'), ('type','=','sale')]</field>
<field name="context">{'journal_type':'sale', 'type':'sale'}</field>
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="target">new</field>
</record>
<menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_sale_receipt" parent="account.menu_finance_receivables" sequence="10"/>
<!-- Purchase Vouchers -->
<record model="ir.ui.view" id="view_purchase_receipt_form">
<field name="name">account.voucher.purchase.form</field>
<field name="model">account.voucher</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Vendor Bills">
<group col="6" colspan="4">
<field name="partner_id" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount)"/>
<field name="journal_id" domain="[('type','=','purchase')]" widget="selection" select="1" on_change="onchange_journal(journal_id)"/>
<field name="reference" select="1"/>
<field name="name" colspan="4"/>
<field name="number"/>
<field name="account_id" domain="[('type','=','other')]" invisible="True"/>
<field name="type" invisible="True"/>
</group>
<notebook colspan="4">
<page string="Bill Information">
<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">
<tree string="Expense Lines" editable="bottom">
<field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
<field name="name"/>
<field name="amount"/>
<field name="account_analytic_id" groups="base.group_extended"/>
</tree>
</field>
<group col="2" colspan="3">
<separator string="Internal Notes" colspan="2"/>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<group col="2" colspan="1">
<separator string="Payment Terms" colspan="2"/>
<field name="term_id" widget="selection" on_change="onchange_term_id(term_id, amount)"/>
<field name="date" string="Bill Date" select="1" on_change="onchange_date(date)"/>
<field name="date_due"/>
<field name="amount" required="0" string="Amount Due"/>
</group>
<group col="4" colspan="1">
<separator string="Total" colspan="4"/>
<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')]}"/>
<label colspan="1" string=""/><field name="amount" string="Total"/>
</group>
</group>
</page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
<field name="audit"/>
</group>
<separator string="Journal Items" colspan="4"/>
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
</page>
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
</record>
<record id="action_purchase_receipt" model="ir.actions.act_window">
<field name="name">Vendor Bills</field>
<field name="res_model">account.voucher.open</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','=','purchase'), ('type','=','purchase')]</field>
<field name="context">{'journal_type':'purchase', 'type':'purchase'}</field>
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="target">new</field>
</record>
<menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
</data>
</openerp>