<?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>
        <menuitem
            name="Invoices"
            parent="account.menu_account"
            sequence="20"
            id="menu_invoices"/>

        <menuitem
            name="Invoice Payments"
            parent="account.menu_account_configuration"
            sequence="50"
            id="menu_payments_configuration"/>

        <record model="ir.action.wizard" id="wizard_pay">
            <field name="name">Pay Invoice</field>
            <field name="wiz_name">account.invoice.pay</field>
            <field name="model">account.invoice</field>
        </record>

        <record model="ir.ui.view" id="invoice_view_form">
            <field name="model">account.invoice</field>
            <field name="type">form</field>
            <field name="name">invoice_form</field>
        </record>
        <record model="ir.ui.view" id="invoice_view_tree">
            <field name="model">account.invoice</field>
            <field name="type">tree</field>
            <field name="name">invoice_tree</field>
        </record>

        <record model="ir.action.act_window" id="act_invoice_form">
            <field name="name">Invoices</field>
            <field name="res_model">account.invoice</field>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="invoice_view_tree"/>
            <field name="act_window" ref="act_invoice_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="invoice_view_form"/>
            <field name="act_window" ref="act_invoice_form"/>
        </record>

        <record model="ir.action.act_window" id="act_invoice_out_form">
            <field name="name">Customer Invoices</field>
            <field name="res_model">account.invoice</field>
            <field name="domain" eval="[('type', '=', 'out')]" pyson="1"/>
            <field name="context" eval="None"/>
            <field name="search_value"></field>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_out_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="invoice_view_tree"/>
            <field name="act_window" ref="act_invoice_out_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_out_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="invoice_view_form"/>
            <field name="act_window" ref="act_invoice_out_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_out_domain_draft">
            <field name="name">Draft</field>
            <field name="sequence" eval="10"/>
            <field name="domain" eval="[('state', '=', 'draft')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_out_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_out_domain_validated">
            <field name="name">Validated</field>
            <field name="sequence" eval="20"/>
            <field name="domain" eval="[('state', '=', 'validated')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_out_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_out_domain_posted">
            <field name="name">Posted</field>
            <field name="sequence" eval="30"/>
            <field name="domain" eval="[('state', '=', 'posted')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_out_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_out_domain_all">
            <field name="name">All</field>
            <field name="sequence" eval="9999"/>
            <field name="domain"></field>
            <field name="act_window" ref="act_invoice_out_form"/>
        </record>
        <menuitem
            parent="menu_invoices"
            action="act_invoice_out_form"
            sequence="10"
            id="menu_invoice_out_form"/>

        <record model="ir.action.act_window" id="act_invoice_in_form">
            <field name="name">Supplier Invoices</field>
            <field name="res_model">account.invoice</field>
            <field name="domain" eval="[('type', '=', 'in')]" pyson="1"/>
            <field name="context" eval="None"/>
            <field name="search_value"></field>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_in_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="invoice_view_tree"/>
            <field name="act_window" ref="act_invoice_in_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_in_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="invoice_view_form"/>
            <field name="act_window" ref="act_invoice_in_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_in_domain_draft">
            <field name="name">Draft</field>
            <field name="sequence" eval="10"/>
            <field name="domain" eval="[('state', '=', 'draft')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_in_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_in_domain_validated">
            <field name="name">Validated</field>
            <field name="sequence" eval="20"/>
            <field name="domain" eval="[('state', '=', 'validated')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_in_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_in_domain_posted">
            <field name="name">Posted</field>
            <field name="sequence" eval="30"/>
            <field name="domain" eval="[('state', '=', 'posted')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_in_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_in_domain_all">
            <field name="name">All</field>
            <field name="sequence" eval="9999"/>
            <field name="domain"></field>
            <field name="act_window" ref="act_invoice_in_form"/>
        </record>
        <menuitem
            parent="menu_invoices"
            action="act_invoice_in_form"
            sequence="10"
            id="menu_invoice_in_form"/>

        <record model="ir.action.act_window" id="act_invoice_relate">
            <field name="name">Invoices</field>
            <field name="res_model">account.invoice</field>
            <field name="domain"
                eval="[
                If(Eval('active_model') == 'party.party',
                ('party', 'in', Eval('active_ids', [])), ()),
                ]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_relate_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="invoice_view_tree"/>
            <field name="act_window" ref="act_invoice_relate"/>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_relate_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="invoice_view_form"/>
            <field name="act_window" ref="act_invoice_relate"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_relate_pending">
            <field name="name">Pending</field>
            <field name="sequence" eval="10"/>
            <field name="domain" eval="[('state', 'not in', ['paid', 'cancelled'])]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_relate"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_relate_paid">
            <field name="name">Paid</field>
            <field name="sequence" eval="20"/>
            <field name="domain" eval="[('state', '=', 'paid')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_invoice_relate"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_invoice_relate_all">
            <field name="name">All</field>
            <field name="sequence" eval="9999"/>
            <field name="domain"></field>
            <field name="act_window" ref="act_invoice_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_invoice_relate_keyword_party">
            <field name="keyword">form_relate</field>
            <field name="model">party.party,-1</field>
            <field name="action" ref="act_invoice_relate"/>
        </record>

        <record model="ir.model.access" id="access_invoice">
            <field name="model">account.invoice</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_invoice_account">
            <field name="model">account.invoice</field>
            <field name="group" ref="account.group_account"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.model.button" id="invoice_cancel_button">
            <field name="model">account.invoice</field>
            <field name="name">cancel</field>
            <field name="string">Cancel</field>
            <field name="confirm">Are you sure you want to cancel the invoices?</field>
            <field name="help">Cancel the invoice</field>
        </record>

        <record model="ir.model.button" id="invoice_draft_button">
            <field name="model">account.invoice</field>
            <field name="name">draft</field>
            <field name="string">Draft</field>
        </record>

        <record model="ir.model.button" id="invoice_validate_button">
            <field name="model">account.invoice</field>
            <field name="name">validate_invoice</field>
            <field name="string">Validate</field>
            <field name="help">Also known as Pro Forma</field>
        </record>

        <record model="ir.model.button" id="invoice_post_button">
            <field name="model">account.invoice</field>
            <field name="name">post</field>
            <field name="string">Post</field>
            <field name="confirm">Are you sure you want to post the invoices?</field>
        </record>

        <record model="ir.model.button" id="invoice_pay_button">
            <field name="model">account.invoice</field>
            <field name="name">pay</field>
            <field name="string">Pay</field>
        </record>

        <record model="ir.model.button" id="invoice_reschedule_lines_to_pay_button">
            <field name="model">account.invoice</field>
            <field name="name">reschedule_lines_to_pay</field>
            <field name="string">Reschedule</field>
        </record>

        <record model="ir.model.button" id="invoice_delegate_lines_to_pay_button">
            <field name="model">account.invoice</field>
            <field name="name">delegate_lines_to_pay</field>
            <field name="string">Modify Payee</field>
        </record>

        <record model="ir.model.button" id="invoice_process_button">
            <field name="model">account.invoice</field>
            <field name="name">process</field>
            <field name="string">Process</field>
        </record>
        <record model="ir.model.button-res.group" id="invoice_process_button_group_account_admin">
            <field name="button" ref="invoice_process_button"/>
            <field name="group" ref="account.group_account_admin"/>
        </record>

        <record model="ir.action.wizard" id="refresh_invoice_report_wizard">
            <field name="name">Invoice (revised)</field>
            <field name="wiz_name">account.invoice.refresh_invoice_report</field>
            <field name="model">account.invoice</field>
        </record>
        <record model="ir.action.keyword" id="refresh_invoice_report_keyword">
            <field name="keyword">form_print</field>
            <field name="model">account.invoice,-1</field>
            <field name="action" ref="refresh_invoice_report_wizard"/>
        </record>
        <record model="ir.action-res.group" id="refresh_invoice_report-group_account_admin">
            <field name="action" ref="refresh_invoice_report_wizard"/>
            <field name="group" ref="account.group_account_admin"/>
        </record>

        <record model="ir.ui.view" id="invoice_report_revision_view_list">
            <field name="model">account.invoice.report.revision</field>
            <field name="type">tree</field>
            <field name="name">invoice_report_revision_list</field>
        </record>
        <record model="ir.ui.view" id="invoice_report_revision_view_form">
            <field name="model">account.invoice.report.revision</field>
            <field name="type">form</field>
            <field name="name">invoice_report_revision_form</field>
        </record>
        <record model="ir.model.access" id="access_invoice_report_revision">
            <field name="model">account.invoice.report.revision</field>
            <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.report" id="report_invoice">
            <field name="name">Invoice</field>
            <field name="model">account.invoice</field>
            <field name="report_name">account.invoice</field>
            <field name="report">account_invoice/invoice.fodt</field>
            <field name="single" eval="True"/>
        </record>
        <record model="ir.action.keyword" id="report_invoice_keyword">
            <field name="keyword">form_print</field>
            <field name="model">account.invoice,-1</field>
            <field name="action" ref="report_invoice"/>
        </record>

        <record model="ir.action.wizard" id="edocument">
            <field name="name">E-document</field>
            <field name="wiz_name">account.invoice.edocument</field>
            <field name="model">account.invoice</field>
            <field name="active" eval="False"/>
        </record>
        <record model="ir.action.keyword" id="edocument_keyword">
            <field name="keyword">form_print</field>
            <field name="model">account.invoice,-1</field>
            <field name="action" ref="edocument"/>
        </record>

        <record model="ir.ui.view" id="edocument_start_view_form">
            <field name="model">account.invoice.edocument.start</field>
            <field name="type">form</field>
            <field name="name">edocument_start_form</field>
        </record>

        <record model="ir.ui.view" id="edocument_result_view_form">
            <field name="model">account.invoice.edocument.result</field>
            <field name="type">form</field>
            <field name="name">edocument_result_form</field>
        </record>

        <record model="ir.sequence.type" id="sequence_type_account_invoice">
            <field name="name">Invoice</field>
        </record>
        <record model="ir.sequence.type-res.group"
            id="sequence_type_account_invoice_group_admin">
            <field name="sequence_type" ref="sequence_type_account_invoice"/>
            <field name="group" ref="res.group_admin"/>
        </record>
        <record model="ir.sequence.type-res.group"
            id="sequence_type_account_invoice_group_account_admin">
            <field name="sequence_type" ref="sequence_type_account_invoice"/>
            <field name="group" ref="account.group_account_admin"/>
        </record>

        <record model="ir.ui.view" id="invoice_line_view_form">
            <field name="model">account.invoice.line</field>
            <field name="type">form</field>
            <field name="name">invoice_line_form</field>
        </record>
        <record model="ir.ui.view" id="invoice_line_view_tree">
            <field name="model">account.invoice.line</field>
            <field name="type">tree</field>
            <field name="priority" eval="10"/>
            <field name="name">invoice_line_tree</field>
        </record>

        <record model="ir.ui.view" id="invoice_line_view_tree_sequence">
            <field name="model">account.invoice.line</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="name">invoice_line_tree_sequence</field>
        </record>

        <record model="ir.model.access" id="access_invoice_line">
            <field name="model">account.invoice.line</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_invoice_line_account">
            <field name="model">account.invoice.line</field>
            <field name="group" ref="account.group_account"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.ui.view" id="invoice_tax_view_form">
            <field name="model">account.invoice.tax</field>
            <field name="type">form</field>
            <field name="name">invoice_tax_form</field>
        </record>
        <record model="ir.ui.view" id="invoice_tax_view_tree">
            <field name="model">account.invoice.tax</field>
            <field name="type">tree</field>
            <field name="priority" eval="10"/>
            <field name="name">invoice_tax_tree</field>
        </record>

        <record model="ir.ui.view" id="invoice_tax_view_tree_sequence">
            <field name="model">account.invoice.tax</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="name">invoice_tax_tree_sequence</field>
        </record>

        <record model="ir.ui.view" id="invoice_payment_mean_view_form">
            <field name="model">account.invoice.payment.mean</field>
            <field name="type">form</field>
            <field name="name">invoice_payment_mean_form</field>
        </record>

        <record model="ir.ui.view" id="invoice_payment_mean_view_list">
            <field name="model">account.invoice.payment.mean</field>
            <field name="type">tree</field>
            <field name="name">invoice_payment_mean_list</field>
        </record>

        <record model="ir.ui.view" id="invoice_payment_mean_rule_view_form">
            <field name="model">account.invoice.payment.mean.rule</field>
            <field name="type">form</field>
            <field name="name">invoice_payment_mean_rule_form</field>
        </record>

        <record model="ir.ui.view" id="invoice_payment_mean_rule_view_list">
            <field name="model">account.invoice.payment.mean.rule</field>
            <field name="type">tree</field>
            <field name="name">invoice_payment_mean_rule_list</field>
        </record>

        <record model="ir.action.act_window" id="act_invoice_payment_mean_rule_form">
            <field name="name">Payment Means Rules</field>
            <field name="res_model">account.invoice.payment.mean.rule</field>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_payment_mean_rule_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="invoice_payment_mean_rule_view_list"/>
            <field name="act_window" ref="act_invoice_payment_mean_rule_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_invoice_payment_mean_rule_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="invoice_payment_mean_rule_view_form"/>
            <field name="act_window" ref="act_invoice_payment_mean_rule_form"/>
        </record>
        <menuitem
            parent="menu_payments_configuration"
            action="act_invoice_payment_mean_rule_form"
            sequence="20"
            id="menu_invoice_payment_mean_rule"/>

        <record model="ir.model.access" id="access_invoice_payment_mean_rule">
            <field name="model">account.invoice.payment.mean.rule</field>
            <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.model.access" id="access_invoice_payment_mean_rule_account">
            <field name="model">account.invoice.payment.mean.rule</field>
            <field name="group" ref="account.group_account"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.rule.group" id="rule_group_invoice_payment_mean_rule_companies">
            <field name="name">User in companies</field>
            <field name="model">account.invoice.payment.mean.rule</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_invoice_payment_mean_rule_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_invoice_payment_mean_rule_companies"/>
        </record>

        <record model="ir.ui.view" id="pay_start_view_form">
            <field name="model">account.invoice.pay.start</field>
            <field name="type">form</field>
            <field name="name">pay_start_form</field>
        </record>

        <record model="ir.ui.view" id="pay_ask_view_form">
            <field name="model">account.invoice.pay.ask</field>
            <field name="type">form</field>
            <field name="name">pay_ask_form</field>
        </record>

        <record model="ir.ui.view" id="payment_method_view_form">
            <field name="model">account.invoice.payment.method</field>
            <field name="type">form</field>
            <field name="name">payment_method_form</field>
        </record>
        <record model="ir.ui.view" id="payment_method_view_list">
            <field name="model">account.invoice.payment.method</field>
            <field name="type">tree</field>
            <field name="name">payment_method_tree</field>
        </record>
        <record model="ir.action.act_window" id="act_payment_method_form">
            <field name="name">Invoice Payment Methods</field>
            <field name="res_model">account.invoice.payment.method</field>
        </record>
        <record model="ir.action.act_window.view" id="act_payment_method_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="payment_method_view_list"/>
            <field name="act_window" ref="act_payment_method_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_payment_method_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="payment_method_view_form"/>
            <field name="act_window" ref="act_payment_method_form"/>
        </record>
        <menuitem
            parent="account.menu_journal_configuration"
            action="act_payment_method_form"
            sequence="50"
            id="menu_payment_method_form"/>

        <record model="ir.rule.group" id="rule_group_payment_method_companies">
            <field name="name">User in companies</field>
            <field name="model">account.invoice.payment.method</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_payment_method_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_payment_method_companies"/>
        </record>

        <record model="ir.model.access" id="access_payment_method">
            <field name="model">account.invoice.payment.method</field>
            <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.model.access" id="access_payment_method_account_admin">
            <field name="model">account.invoice.payment.method</field>
            <field name="group" ref="account.group_account_admin"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.ui.view" id="credit_start_view_form">
            <field name="model">account.invoice.credit.start</field>
            <field name="type">form</field>
            <field name="name">credit_start_form</field>
        </record>

        <record model="ir.action.wizard" id="credit">
            <field name="name">Credit</field>
            <field name="wiz_name">account.invoice.credit</field>
            <field name="model">account.invoice</field>
        </record>
        <record model="ir.action.keyword" id="credit_keyword">
            <field name="keyword">form_action</field>
            <field name="model">account.invoice,-1</field>
            <field name="action" ref="credit"/>
        </record>

        <record model="ir.rule.group" id="rule_group_invoice_companies">
            <field name="name">User in companies</field>
            <field name="model">account.invoice</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_invoice_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_invoice_companies"/>
        </record>

        <record model="ir.rule.group" id="rule_group_invoice_line_companies">
            <field name="name">User in companies</field>
            <field name="model">account.invoice.line</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_invoice_line_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_invoice_line_companies"/>
        </record>

        <record model="ir.action.wizard" id="act_reschedule_lines_to_pay_wizard">
            <field name="name">Reschedule Lines to Pay</field>
            <field name="wiz_name">account.invoice.lines_to_pay.reschedule</field>
            <field name="model">account.invoice</field>
        </record>

        <record model="ir.action.wizard" id="act_delegate_lines_to_pay_wizard">
            <field name="name">Delegate Lines to Pay</field>
            <field name="wiz_name">account.invoice.lines_to_pay.delegate</field>
            <field name="model">account.invoice</field>
        </record>
    </data>
</tryton>
