Files
bank-payment/account_direct_debit/view/account_payment.xml
2013-01-21 12:19:04 +01:00

93 lines
4.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- distinguish between payment orders and debit orders in the menu -->
<record id="account_payment.action_payment_order_tree" model="ir.actions.act_window">
<field name="domain">[('payment_order_type', '=', 'payment')]</field>
<field name="context">{'search_payment_order_type': 'payment'}</field>
</record>
<record id="action_debit_order_tree" model="ir.actions.act_window">
<field name="name">Direct Debit Orders</field>
<field name="res_model">payment.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_payment_order_type': 'debit',
'default_payment_order_type': 'debit'}</field>
<field name="search_view_id" ref="account_payment.view_payment_order_search"/>
<field name="domain">[('payment_order_type', '=', 'debit')]</field>
<field name="help">A debit order is a debit request from your company to collect customer invoices. Here you can register all debit orders that should be done, keep track of all debit orders and mention the invoice reference and the partner the withdrawal should be done for.</field>
</record>
<menuitem action="action_debit_order_tree" id="menu_action_debit_order_form" parent="account_payment.menu_main_payment" sequence="4"/>
<record id="view_payment_order_form" model="ir.ui.view">
<field name="name">payment.order.form</field>
<field name="model">payment.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
<field name="priority" eval="60"/>
<field name="arch" type="xml">
<data>
<field name="reference" position="after">
<field name="payment_order_type"/>
</field>
<xpath expr="/form/group/button[@string='Select Invoices to Pay']"
position="attributes">
<attribute name="attrs">
{'invisible':['|',('state','!=','draft'),('payment_order_type', '!=', 'payment')]}
</attribute>
</xpath>
<xpath expr="/form/group/button[@string='Select Invoices to Pay']"
position="after">
<button colspan="2" name="%(account_payment.action_create_payment_order)s"
string="Select Invoices to Collect" type="action"
attrs="{'invisible':['|',('state','!=','draft'),('payment_order_type', '!=', 'debit')]}"
icon="gtk-find"
/>
</xpath>
<!-- the attrs do not work like this, apparently
<xpath expr="//tree[@string='Payment Line']" position="inside">
<field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
</xpath>
-->
</data>
</field>
</record>
<!-- Add transfer account for debit type modes -->
<record model="ir.ui.view" id="view_payment_mode_form">
<field name="name">payment.mode.form add transfer account</field>
<field name="model">payment.mode</field>
<field name="inherit_id" ref="account_banking.view_payment_mode_form_inherit"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="transfer_account_id"
domain="[('type', '=', 'other'),
('reconcile', '=', True),
('company_id', '=', company_id)]"
/>
<field name="transfer_journal_id"
domain="[('company_id', '=', company_id)]"
/>
<field name="payment_term_ids"/>
</field>
</field>
</record>
<record id="view_payment_line_tree" model="ir.ui.view">
<field name="name">Payment Lines</field>
<field name="model">payment.line</field>
<field name="type">tree</field>
<field name="inherit_id" ref="account_payment.view_payment_line_tree"/>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="storno"/>
</field>
</field>
</record>
</data>
</openerp>