<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) EduSense BV <http://www.edusense.nl>
  All rights reserved.
  The licence is in the file __terp__.py
-->
<openerp>
    <data>

        <!-- Make new view on ClieOp3 Exports -->
        <record id="view_banking_export_clieop_form" model="ir.ui.view">
            <field name="name">account.banking.export.clieop.form</field>
            <field name="model">banking.export.clieop</field>
            <field name="arch" type="xml">
                <form string="Client Opdrachten Export">
                    <notebook>
                        <page string="General Information">
                            <field name="filetype" />
                            <field name="identification" />
                            <separator string="ClieOp Information" colspan="4" />
                            <field name="total_amount" />
                            <field name="check_no_accounts" />
                            <field name="no_transactions" />
                            <separator string="Processing Information" colspan="4" />
                            <field name="prefered_date" />
                            <field name="date_generated" />
                            <field name="testcode" />
                            <newline />
                            <field name="filename" invisible="True"/>
                            <field name="file" colspan="4" filename="filename"/>
                        </page>
                        <page string="Payment Orders">
                            <field name="payment_order_ids" colspan="4" nolabel="1">
                                <tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Payment order">
                                    <field name="reference"/>
                                    <field name="date_created"/>
                                    <field name="date_done"/>
                                    <field name="total"/>
                                    <field name="state"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="view_banking_export_clieop_tree" model="ir.ui.view">
            <field name="name">account.banking.export.clieop.tree</field>
            <field name="model">banking.export.clieop</field>
            <field name="arch" type="xml">
                <tree string="Client Opdrachten Export">
                    <field name="filetype" />
                    <field name="identification" search="2"/>
                    <field name="prefered_date" search="2"/>
                    <field name="date_generated" />
                </tree>
            </field>
        </record>
        <record model="ir.actions.act_window" id="action_account_banking_clieops">
            <field name="name">Generated ClieOp3 Files</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">banking.export.clieop</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>

        <!-- Add a menu item for it -->
        <menuitem name="Generated ClieOp3 Files"
            id="menu_action_account_banking_exported_clieop_files"
            parent="account_banking.menu_finance_banking_actions"
            action="action_account_banking_clieops"
            sequence="12"
         />

        <!-- Create right menu entry to see generated files -->
        <act_window name="Generated ClieOp3 Files"
            domain="[('payment_order_ids', '=', active_id)]"
            res_model="banking.export.clieop"
            src_model="payment.order"
            view_type="form"
            view_mode="tree,form"
            id="act_banking_export_clieop_payment_order"/>

    </data>
</openerp>
