<?xml version="1.0"?>
<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
    <data>

        <record model="ir.ui.view" id="move_line_view_list">
            <field name="model">account.move.line</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="name">move_line_list</field>
        </record>

        <record model="ir.ui.view" id="move_line_view_form">
            <field name="model">account.move.line</field>
            <field name="inherit" ref="account.move_line_view_form"/>
            <field name="name">move_line_form</field>
        </record>

        <record model="ir.ui.view" id="move_line_view_form_move">
            <field name="model">account.move.line</field>
            <field name="inherit" ref="account.move_line_view_form_move"/>
            <field name="name">move_line_form</field>
        </record>

        <record model="ir.action.act_window" id="act_move_line_form">
            <field name="name">Lines to Pay</field>
            <field name="res_model">account.move.line</field>
            <field name="domain"
                eval="[['OR', ('account.type.receivable', '=', True), ('account.type.payable', '=', True)], ('party', '!=', None), ('reconciliation', '=', None), ('payment_amount', '!=', 0), ('move_state', '=', 'posted'), ('maturity_date', '!=', None)]"
                pyson="1"/>
            <field name="search_value"
                eval="[('payment_blocked', '=', False)]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_move_line_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="move_line_view_list"/>
            <field name="act_window" ref="act_move_line_form"/>
        </record>
        <record model="ir.action.act_window.domain"
            id="act_move_line_form_domain_payable">
            <field name="name">Payable</field>
            <field name="sequence" eval="10"/>
            <field name="domain"
                eval="[['OR', ('credit', '&gt;', 0), ('debit', '&lt;', 0)], ('payment_direct_debit', '=', False)]"
                pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_move_line_form"/>
        </record>
        <record model="ir.action.act_window.domain"
            id="act_move_line_form_domain_receivable">
            <field name="name">Receivable</field>
            <field name="sequence" eval="20"/>
            <field name="domain"
                eval="['OR', ('debit', '&gt;', 0), ('credit', '&lt;', 0)]"
                pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_move_line_form"/>
        </record>

        <menuitem
            parent="menu_payments"
            action="act_move_line_form"
            sequence="10"
            id="menu_move_line_form"/>

        <record model="ir.model.access" id="access_move_line_payment">
            <field name="model">account.move.line</field>
            <field name="group" ref="group_payment"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.action.wizard" id="wizard_create_direct_debit">
            <field name="name">Create Direct Debit</field>
            <field name="wiz_name">account.move.line.create_direct_debit</field>
        </record>
        <menuitem
            parent="menu_payments"
            action="wizard_create_direct_debit"
            sequence="40"
            id="menu_create_direct_debit"/>

        <record model="ir.action-res.group" id="wizard_create_direct_debit-group_payment">
            <field name="action" ref="wizard_create_direct_debit"/>
            <field name="group" ref="group_payment"/>
        </record>

        <record model="ir.ui.view" id="move_line_create_direct_debit_view_form">
            <field name="model">account.move.line.create_direct_debit.start</field>
            <field name="type">form</field>
            <field name="name">move_line_create_direct_debit_form</field>
        </record>

        <record model="ir.ui.view" id="move_line_pay_start_view_form">
            <field name="model">account.move.line.pay.start</field>
            <field name="type">form</field>
            <field name="name">move_line_pay_start_form</field>
        </record>

        <record model="ir.ui.view" id="move_line_pay_ask_journal_view_form">
            <field name="model">account.move.line.pay.ask_journal</field>
            <field name="type">form</field>
            <field name="name">move_line_pay_ask_journal_form</field>
        </record>

        <record model="ir.action.wizard" id="act_pay_line">
            <field name="name">Pay Lines</field>
            <field name="wiz_name">account.move.line.pay</field>
            <field name="model">account.move.line</field>
        </record>
        <record model="ir.action-res.group"
            id="act_pay_line-group_payment">
            <field name="action" ref="act_pay_line"/>
            <field name="group" ref="group_payment"/>
        </record>

        <record model="ir.model.button" id="move_line_pay_button">
            <field name="model">account.move.line</field>
            <field name="name">pay</field>
            <field name="string">Pay</field>
        </record>
        <record model="ir.model.button-res.group" id="move_line_pay_button_group_payment">
            <field name="button" ref="move_line_pay_button"/>
            <field name="group" ref="group_payment"/>
        </record>

        <record model="ir.model.button" id="move_line_payment_block_button">
            <field name="model">account.move.line</field>
            <field name="name">payment_block</field>
            <field name="string">Block</field>
        </record>
        <record model="ir.model.button-res.group"
            id="move_line_payment_block_button_group_payment">
            <field name="button" ref="move_line_payment_block_button"/>
            <field name="group" ref="group_payment"/>
        </record>

        <record model="ir.model.button" id="move_line_payment_unblock_button">
            <field name="model">account.move.line</field>
            <field name="name">payment_unblock</field>
            <field name="string">Unblock</field>
        </record>
        <record model="ir.model.button-res.group"
            id="move_line_payment_unblock_button_group_payment">
            <field name="button" ref="move_line_payment_unblock_button"/>
            <field name="group" ref="group_payment"/>
        </record>

        <record model="ir.ui.view" id="configuration_view_form">
            <field name="model">account.configuration</field>
            <field name="inherit" ref="account.configuration_view_form"/>
            <field name="name">configuration_form</field>
        </record>
    </data>
    <data depends="account_invoice">
        <record model="ir.ui.view" id="invoice_view_form">
            <field name="model">account.invoice</field>
            <field name="inherit" ref="account_invoice.invoice_view_form"/>
            <field name="name">invoice_form</field>
        </record>
        <record model="ir.ui.view" id="move_line_view_list_to_pay">
            <field name="model">account.move.line</field>
            <field name="inherit" ref="account_invoice.move_line_view_list_to_pay"/>
            <field name="name">move_line_list_to_pay</field>
        </record>
    </data>
</tryton>
