<?xml version="1.0" ?>
<openerp>
    <data>
    	<record id="view_bank_statement_coda_form" model="ir.ui.view">
            <field name="name">account.bank.statement.coda.form</field>
            <field name="model">account.bank.statement</field>
            <field name="inherit_id" ref="account.view_bank_statement_form"/>
            <field name="arch" type="xml">
            	<page name="statement_line_ids" position="after">
            		<page string="CODA Notes" name="coda_note" groups="base.group_no_one">
                    	<field name="coda_note"/>
                	</page>
                </page>
            </field>
        </record>
    	<record id="view_bank_statement_line_coda_form" model="ir.ui.view">
			<field name="name">bank.statement.line.coda.form</field>
			<field name="model">account.bank.statement.line</field>
			<field name="priority">10</field>
			<field name="arch" type="xml">
			<form string="CODA Statement Line" version="7.0" create="false">
				<group col="4">
					<field name="statement_id"/>
					<field name="date"/>
					<field name="name"/>
					<field name="ref" readonly="0"/>
					<field name="partner_id"/>
					<field name="type" />
					<field domain="[('type', '&lt;&gt;', 'view')]" name="account_id"/>
					<field name="amount"/>
					<field name="sequence" readonly="0"/>
				</group>
				<separator string="Notes"/>
				<field name="note"/>
			</form>
			</field>
    	</record>
        <record id="view_account_bank_statement_line_coda_tree" model="ir.ui.view">
            <field name="name">account.bank.statement.line.coda.tree</field>
            <field name="model">account.bank.statement.line</field>
            <field name="priority">10</field>
            <field name="arch" type="xml">
                <tree editable="bottom" string="Statement lines" create="0">
                    <field name="sequence" readonly="1" invisible="1"/>
                    <field name="statement_id" readonly="1" />
                    <field name="date"/>
                    <field name="name"/>
                    <field name="ref"/>
                    <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
                    <field name="type" on_change="onchange_type(partner_id, type)"/>
                    <field name="account_id" options='{"no_open":True}' domain="[('type', '&lt;&gt;', 'view')]"/>
                    <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type', '&lt;&gt;', 'view')]"/>
                    <field name="amount"/>
                    <field name="note"/>
                </tree>
            </field>
        </record>
        
		<record id="view_bank_statement_line_coda_filter" model="ir.ui.view">
			<field name="name">bank.statement.line.coda.filter</field>
			<field name="model">account.bank.statement.line</field>
			<field name="arch" type="xml">
			<search string="Search Bank Transactions">
				<field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Bank Transaction"/>
				<filter name="debit" string="Debit" domain="[('amount','&gt;',0)]" icon="terp-folder-green" help="Debit Transactions."/>
				<filter name="credit" string="Credit" domain="[('amount','&lt;',0)]" icon="terp-folder-orange" help="Credit Transactions."/>
				<field name="statement_id"/>
				<group expand="0" string="Extended Filters...">
					<field name="account_id"/>
					<field name="partner_id"/>
					<field name="amount"/>
					<field name="type"/>
					<field name="note"/>
				</group>
				<newline/>
				<group string="Group By..." expand="0">
					<filter string="Partner" context="{'group_by':'partner_id'}" icon="terp-folder-green"/>
					<filter string="Statement" context="{'group_by':'statement_id'}" icon="terp-folder-orange"/>
					<filter string="Fin.Account" context="{'group_by':'account_id'}" icon="terp-folder-yellow"/>
				</group>
			</search>
			</field>
		</record>

		<record id="action_account_bank_statement_line_coda" model="ir.actions.act_window">
			<field name="name">Bank Statement Lines</field>
			<field name="res_model">account.bank.statement.line</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form</field>
			<field name="context">{'block_statement_line_delete' : 1}</field>
			<field name="search_view_id" ref="view_bank_statement_line_coda_filter"/>
			<field name="view_id" ref="view_account_bank_statement_line_coda_tree"/>
		</record>

        <menuitem name="Bank Statement Lines" parent="account.menu_finance_bank_and_cash" id="menu_account_bank_statement_line_coda" action="action_account_bank_statement_line_coda" sequence="8" groups="base.group_no_one"/>
    	<menuitem name="Import CODA File" parent="account.menu_finance_bank_and_cash" id="menu_account_coda_import" action="action_account_coda_import" sequence="10"/>
	</data> 
</openerp>