<?xml version="1.0" encoding="utf-8"?>

<!--
  Copyright (C) 2014 Akretion (http://www.akretion.com)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  The licence is in the file __openerp__.py
-->

<openerp>
<data>

<record id="banking_export_lcr_form" model="ir.ui.view">
    <field name="name">banking.export.lcr.form</field>
    <field name="model">banking.export.lcr</field>
    <field name="arch" type="xml">
        <form string="LCR File" version="7.0">
            <header>
                <field name="state" widget="statusbar"/>
            </header>
            <notebook>
                <page string="General Information">
                    <group name="main">
                        <field name="total_amount" />
                        <field name="nb_transactions" />
                        <field name="create_date" />
                        <field name="file" filename="filename"/>
                        <field name="filename" invisible="True"/>
                    </group>
                </page>
                <page string="Payment Orders">
                    <field name="payment_order_ids" nolabel="1"/>
                </page>
            </notebook>
        </form>
    </field>
</record>

<record id="banking_export_lcr_tree" model="ir.ui.view">
    <field name="name">banking.export.lcr.tree</field>
    <field name="model">banking.export.lcr</field>
    <field name="arch" type="xml">
        <tree string="LCR Files">
            <field name="filename"/>
            <field name="create_date"/>
            <field name="nb_transactions"/>
            <field name="state"/>
        </tree>
    </field>
</record>

<record id="banking_export_lcr_action" model="ir.actions.act_window">
    <field name="name">LCR Files</field>
    <field name="res_model">banking.export.lcr</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
</record>

<menuitem id="banking_export_lcr_menu"
          parent="account_payment.menu_main_payment"
          action="banking_export_lcr_action"
          sequence="50"
          />

<act_window id="act_banking_export_lcr_payment_order"
    name="Generated LCR Files"
    domain="[('payment_order_ids', '=', active_id)]"
    res_model="banking.export.lcr"
    src_model="payment.order"
    view_type="form"
    view_mode="tree,form"
    />

</data>
</openerp>
