<?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="res.group" id="group_document_incoming">
            <field name="name">Document Incoming</field>
        </record>
        <record model="res.user-res.group" id="user_admin_group_document_incoming">
            <field name="user" ref="res.user_admin"/>
            <field name="group" ref="group_document_incoming"/>
        </record>

        <record model="res.group" id="group_document_incoming_admin">
            <field name="name">Document Incoming Administrator</field>
            <field name="parent" ref="group_document_incoming"/>
        </record>
        <record model="res.user-res.group" id="user_admin_group_document_incoming_admin">
            <field name="user" ref="res.user_admin"/>
            <field name="group" ref="group_document_incoming_admin"/>
        </record>

        <record model="ir.ui.icon" id="document_incoming_icon">
            <field name="name">tryton-document-incoming</field>
            <field name="path">icons/tryton-document-incoming.svg</field>
        </record>

        <record model="ir.ui.icon" id="document_incoming_split_icon">
            <field name="name">tryton-document-incoming-split</field>
            <field name="path">icons/tryton-document-incoming-split.svg</field>
        </record>

        <menuitem
            name="Documents"
            sequence="60"
            id="menu_document"
            icon="tryton-document-incoming"/>
        <record model="ir.ui.menu-res.group" id="menu_document_group_document_incoming">
            <field name="menu" ref="menu_document"/>
            <field name="group" ref="group_document_incoming"/>
        </record>

        <menuitem
            name="Configuration"
            parent="menu_document"
            sequence="0"
            id="menu_configuration"
            icon="tryton-settings"/>
        <record model="ir.ui.menu-res.group"
            id="menu_configuration_group_document_incoming_admin">
            <field name="menu" ref="menu_configuration"/>
            <field name="group" ref="group_document_incoming_admin"/>
        </record>

        <record model="ir.ui.view" id="document_incoming_configuration_view_form">
            <field name="model">document.incoming.configuration</field>
            <field name="type">form</field>
            <field name="name">document_incoming_configuration_form</field>
        </record>

        <record model="ir.action.act_window" id="act_document_incoming_configuration_form">
            <field name="name">Incoming Configuration</field>
            <field name="res_model">document.incoming.configuration</field>
        </record>
        <record model="ir.action.act_window.view" id="act_document_incoming_configuration_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="document_incoming_configuration_view_form"/>
            <field name="act_window" ref="act_document_incoming_configuration_form"/>
        </record>

        <menuitem
            parent="menu_configuration"
            action="act_document_incoming_configuration_form"
            sequence="10"
            id="menu_ocument_incoming_configuration"
            icon="tryton-list"/>

        <record model="ir.model.access" id="access_document_incoming_configuration">
            <field name="model">document.incoming.configuration</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_document_incoming_configuration_group_document_incoming_admin">
            <field name="model">document.incoming.configuration</field>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.ui.view" id="document_incoming_view_form">
            <field name="model">document.incoming</field>
            <field name="type">form</field>
            <field name="name">document_incoming_form</field>
        </record>

        <record model="ir.ui.view" id="document_incoming_view_list">
            <field name="model">document.incoming</field>
            <field name="type">tree</field>
            <field name="name">document_incoming_list</field>
        </record>

        <record model="ir.action.act_window" id="act_document_incoming_form">
            <field name="name">Incoming Documents</field>
            <field name="res_model">document.incoming</field>
            <field name="order" eval="[('id', 'DESC')]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_document_incoming_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="document_incoming_view_list"/>
            <field name="act_window" ref="act_document_incoming_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_document_incoming_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="document_incoming_view_form"/>
            <field name="act_window" ref="act_document_incoming_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_document_incoming_form_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_document_incoming_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_document_incoming_form_domain_processing">
            <field name="name">Processing</field>
            <field name="sequence" eval="20"/>
            <field name="domain" eval="[('state', '=', 'processing')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_document_incoming_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_document_incoming_form_domain_all">
            <field name="name">All</field>
            <field name="sequence" eval="9999"/>
            <field name="domain"></field>
            <field name="act_window" ref="act_document_incoming_form"/>
        </record>

        <menuitem
            parent="menu_document"
            action="act_document_incoming_form"
            sequence="10"
            id="menu_document_incoming"/>
        <record model="ir.ui.menu-res.group" id="menu_document_incoming_group_document_incoming">
            <field name="menu" ref="menu_document_incoming"/>
            <field name="group" ref="group_document_incoming"/>
        </record>

        <record model="ir.model.access" id="access_document_incoming">
            <field name="model">document.incoming</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_document_incoming_group_document_incoming">
            <field name="model">document.incoming</field>
            <field name="group" ref="group_document_incoming"/>
            <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_document_incoming_companies">
            <field name="name">User in companies</field>
            <field name="model">document.incoming</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_document_incoming_companies1">
            <field name="domain" eval="[('company', 'in', Eval('companies', []))]" pyson="1"/>
            <field name="rule_group" ref="rule_group_document_incoming_companies"/>
        </record>
        <record model="ir.rule" id="rule_document_incoming_companies2">
            <field name="domain" eval="[('company', '=', None)]" pyson="1"/>
            <field name="rule_group" ref="rule_group_document_incoming_companies"/>
        </record>

        <record model="ir.model.button" id="document_incoming_cancel_button">
            <field name="model">document.incoming</field>
            <field name="name">cancel</field>
            <field name="string">Cancel</field>
        </record>

        <record model="ir.model.button" id="document_incoming_draft_button">
            <field name="model">document.incoming</field>
            <field name="name">draft</field>
            <field name="string">Draft</field>
        </record>

        <record model="ir.model.button" id="document_incoming_split_wizard_button">
            <field name="model">document.incoming</field>
            <field name="name">split_wizard</field>
            <field name="string">Split</field>
        </record>

        <record model="ir.model.button" id="document_incoming_extract_email_button">
            <field name="model">document.incoming</field>
            <field name="name">extract_email</field>
            <field name="string">Extract Email</field>
        </record>

        <record model="ir.model.button" id="document_incoming_process_button">
            <field name="model">document.incoming</field>
            <field name="name">process</field>
            <field name="string">Process</field>
        </record>

        <record model="ir.model.button" id="document_incoming_proceed_button">
            <field name="model">document.incoming</field>
            <field name="name">proceed</field>
            <field name="string">Proceed</field>
        </record>

        <record model="ir.action.wizard" id="wizard_document_incoming_split">
            <field name="name">Split Incoming Document</field>
            <field name="wiz_name">document.incoming.split</field>
            <field name="model">document.incoming</field>
        </record>

        <record model="ir.ui.view" id="document_incoming_split_start_view_form">
            <field name="model">document.incoming.split.start</field>
            <field name="type">form</field>
            <field name="name">document_incoming_split_start_form</field>
        </record>
    </data>
</tryton>
