odoo/addons/account_voucher/voucher_sales_purchase_view...

361 lines
22 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="view_voucher_filter_vendor" model="ir.ui.view">
<field name="name">account.voucher.purchase.select</field>
<field name="model">account.voucher</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Vouchers">
<group>
<field name="number" string="Voucher"/>
<separator orientation="vertical"/>
<field name="date"/>
<separator orientation="vertical"/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" help="To Review"/>
<separator orientation="vertical"/>
<field name="partner_id" string="Supplier"/>
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/>
<field name="period_id"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record id="view_voucher_filter_sale" model="ir.ui.view">
<field name="name">account.voucher.sale.select</field>
<field name="model">account.voucher</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Vouchers">
<group>
<field name="number" string="Voucher"/>
<separator orientation="vertical"/>
<field name="date"/>
<separator orientation="vertical"/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" help="To Review"/>
<separator orientation="vertical"/>
<field name="partner_id" string="Customer"/>
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/>
<field name="period_id"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record id="act_pay_voucher" model="ir.actions.act_window">
<field name="name">Customer Payment</field>
<field name="res_model">account.voucher</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">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
<field name="view_id" ref="view_vendor_receipt_form"/>
<field name="target">current</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 version="7.0">
<header>
<button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
<button name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_highlight"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" />
<button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
</header>
<sheet string="Sales Receipt" >
<div class="oe_title">
<label for="number" class="oe_edit_only"/>
<h1><field name="number" readonly="0" /></h1>
</div>
<group>
<group>
<field name="partner_id" domain="[('customer','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
<field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
<field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
<field name="name" colspan="2"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<group>
<field name="currency_id"/>
<field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
<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="[('type','=','liquidity')]"/>
<field name="reference"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
/>
<field name="paid" invisible="1"/>
</group>
<field name="type" invisible="True"/>
</group>
<notebook>
<page string="Sales Information">
<field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
<tree string="Sales Lines" editable="bottom">
<field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection" groups="account.group_account_user"/>
<field name="name"/>
<field name="amount" sum="Total"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</tree>
</field>
<group col="3">
<group colspan="1">
<field name="narration" placeholder="Internal Notes" nolabel="1" />
</group>
<group>
<group class="oe_subtotal_footer" string="Total">
<field name="tax_id"
on_change="onchange_price(line_cr_ids, tax_id, partner_id)"
widget="selection"
domain="[('type_tax_use','in',('sale','all')), ('parent_id', '=', False)]"/>
<field name="tax_amount" nolabel="1"/>
<field name="amount" class="oe_subtotal_footer_separator" />
<button type="object"
icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax"
attrs="{'invisible': [('state','!=','draft')]}"/>
</group>
</group>
</group>
</page>
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
<group col="4">
<field name="period_id"/>
<field name="audit"/>
</group>
<field name="move_ids" readonly="1">
<tree string="Journal Items">
<field name="move_id"/>
<field name="ref"/>
<field name="date"/>
<field name="statement_id"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="name"/>
<field name="debit"/>
<field name="credit"/>
<field name="state"/>
<field name="reconcile_id"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<footer>
<field name="message_ids" widget="ThreadView"/>
</footer>
</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</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
<field name="context">{'default_type': 'sale', 'type': 'sale'}</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_voucher_filter_sale"/>
<field name="target">current</field>
<field name="help">
Click here to create a sale receipt.
&lt;p&gt;
When the sales receipt is confirmed, you can record the customer payment related to this sales receipt.
</field>
</record>
<record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_sale_receipt"/>
</record>
<record id="action_sale_receipt_form" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_sale_receipt_form"/>
<field name="act_window_id" ref="action_sale_receipt"/>
</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 id="act_pay_bills" model="ir.actions.act_window">
<field name="name">Bill Payment</field>
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
<field name="context">{'default_type':'payment', 'type':'payment', 'default_partner_id': partner_id, 'partner_id': partner_id, 'default_reference':reference}</field>
<field name="view_id" ref="view_vendor_payment_form"/>
<field name="target">current</field>
</record>
<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 version="7.0">
<header>
<button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
<button name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_highlight"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" />
<button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
</header>
<sheet string="Supplier Voucher">
<div class="oe_title">
<label for="number" class="oe_edit_only"/>
<h1><field name="number" readonly="0" /></h1>
</div>
<field name="pay_now" invisible="1"/>
<group>
<group>
<field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
<field name="date" string="Bill Date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
<field name="date_due"/>
<field name="name" colspan="2"/>
</group>
<group>
<field name="paid" invisible="1"/>
<field name="currency_id"/>
<field name="journal_id"
domain="[('type','in',['purchase','purchase_refund'])]"
widget="selection"
on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
<field name="reference"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
</group>
<group col="6">
<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, tax_id, partner_id)" context="{'journal_id':journal_id,'partner_id':partner_id}">
<tree string="Expense Lines" editable="bottom">
<field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]" groups="account.group_account_user"/>
<field name="name"/>
<field name="amount"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</tree>
</field>
<group>
<group>
<field name="narration" placeholder="Internal Notes" nolabel="1" />
</group>
<group class="oe_subtotal_footer">
<!--
<div>
<label for="tax_id" />
<button type="object"
icon="terp-stock_format-scientific"
name="compute_tax"
attrs="{'invisible': [('state','!=','draft')]}"/>
</div>
-->
<field name="tax_id"
on_change="onchange_price(line_dr_ids, tax_id, partner_id)"
widget="selection"
domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"
/>
<field name="tax_amount" />
<field name="amount" string="Total" class="oe_subtotal_footer_separator"/>
</group>
</group>
</page>
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
<group col="4">
<field name="period_id"/>
<field name="audit"/>
</group>
<field name="move_ids" readonly="1">
<tree string="Journal Items">
<field name="move_id"/>
<field name="ref"/>
<field name="date"/>
<field name="statement_id"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="name"/>
<field name="debit"/>
<field name="credit"/>
<field name="state"/>
<field name="reconcile_id"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<footer>
<field name="message_ids" widget="ThreadView"/>
</footer>
</form>
</field>
</record>
<record id="action_purchase_receipt" model="ir.actions.act_window">
<field name="name">Purchase Receipt</field>
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
<field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" eval="view_voucher_filter_vendor"/>
<field name="target">current</field>
<field name="help">
Click here to create a purchase receipt.
&lt;p&gt;
When the purchase receipt is confirmed, you can record the supplier payment related to this purchase receipt.
</field>
</record>
<record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_purchase_receipt"/>
</record>
<record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_purchase_receipt_form"/>
<field name="act_window_id" ref="action_purchase_receipt"/>
</record>
<menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
</data>
</openerp>