<?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="Journals"
            parent="menu_account_configuration"
            sequence="50"
            id="menu_journal_configuration"/>

        <record model="ir.ui.view" id="journal_view_form">
            <field name="model">account.journal</field>
            <field name="type">form</field>
            <field name="name">journal_form</field>
        </record>
        <record model="ir.ui.view" id="journal_view_tree">
            <field name="model">account.journal</field>
            <field name="priority" eval="10"/>
            <field name="type">tree</field>
            <field name="name">journal_tree</field>
        </record>

        <record model="ir.ui.view" id="journal_view_list_matching_sequence">
            <field name="model">account.journal</field>
            <field name="priority" eval="20"/>
            <field name="type">tree</field>
            <field name="name">journal_list_matching_sequence</field>
        </record>

        <record model="ir.ui.view" id="journal_view_list_cash">
            <field name="model">account.journal</field>
            <field name="priority" eval="20"/>
            <field name="type">tree</field>
            <field name="name">journal_list_cash</field>
        </record>

        <record model="ir.action.act_window" id="act_journal_form">
            <field name="name">Journals</field>
            <field name="res_model">account.journal</field>
            <field name="order" eval="[('matching_sequence', 'ASC'), ('id', 'ASC')]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_journal_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="journal_view_list_matching_sequence"/>
            <field name="act_window" ref="act_journal_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_journal_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="journal_view_form"/>
            <field name="act_window" ref="act_journal_form"/>
        </record>
        <menuitem
            parent="menu_journal_configuration"
            action="act_journal_form"
            sequence="10"
            id="menu_journal_form"/>

        <record model="ir.ui.view" id="journal_cash_context_view_form">
            <field name="model">account.journal.open_cash.context</field>
            <field name="type">form</field>
            <field name="name">journal_open_cash_context</field>
        </record>

        <record model="ir.action.act_window" id="act_journal_open_cash">
            <field name="name">Journals Cash</field>
            <field name="res_model">account.journal</field>
            <field name="domain" eval="[('type', '=', 'cash')]" pyson="1"/>
            <field name="context_model">account.journal.open_cash.context</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_journal_open_cash_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="journal_view_list_cash"/>
            <field name="act_window" ref="act_journal_open_cash"/>
        </record>
        <menuitem
            parent="menu_reporting"
            action="act_journal_open_cash"
            sequence="50"
            id="menu_journal_open_cash"/>

        <record model="ir.model.access" id="access_journal">
            <field name="model">account.journal</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_journal_account_admin">
            <field name="model">account.journal</field>
            <field name="group" ref="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.sequence.type" id="sequence_type_account_journal">
            <field name="name">Account Journal</field>
        </record>
        <record model="ir.sequence.type-res.group"
            id="sequence_type_account_journal_group_admin">
            <field name="sequence_type" ref="sequence_type_account_journal"/>
            <field name="group" ref="res.group_admin"/>
        </record>
        <record model="ir.sequence.type-res.group"
            id="sequence_type_account_journal_group_account_admin">
            <field name="sequence_type" ref="sequence_type_account_journal"/>
            <field name="group" ref="group_account_admin"/>
        </record>

        <record model="ir.sequence" id="sequence_account_journal">
            <field name="name">Default Account Journal</field>
            <field name="sequence_type" ref="sequence_type_account_journal"/>
            <field name="company" eval="None"/>
        </record>

        <record model="ir.ui.view" id="journal_period_view_form">
            <field name="model">account.journal.period</field>
            <field name="type">form</field>
            <field name="name">journal_period_form</field>
        </record>
        <record model="ir.ui.view" id="journal_period_view_tree">
            <field name="model">account.journal.period</field>
            <field name="type">tree</field>
            <field name="name">journal_period_tree</field>
        </record>
        <record model="ir.ui.view" id="journal_period_view_list_close">
            <field name="model">account.journal.period</field>
            <field name="type">tree</field>
            <field name="name">journal_period_list_close</field>
        </record>

        <record model="ir.action.act_window" id="act_journal_period_tree">
            <field name="name">Journals - Periods</field>
            <field name="res_model">account.journal.period</field>
            <field name="domain"
                eval="[('period.fiscalyear.company.id', '=', Eval('context', {}).get('company', -1))]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_journal_period_tree_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="journal_period_view_tree"/>
            <field name="act_window" ref="act_journal_period_tree"/>
        </record>
        <menuitem
            parent="menu_reporting"
            action="act_journal_period_tree"
            sequence="50"
            id="menu_journal_period_tree"/>

        <record model="ir.action.act_window" id="act_journal_period_tree2">
            <field name="name">Journals - Periods</field>
            <field name="res_model">account.journal.period</field>
            <field name="domain"
                eval="[('period.fiscalyear.company.id', '=', Eval('context', {}).get('company', -1))]"
                pyson="1"/>
            <field name="search_value"
                eval="[('state', '=', 'open')]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_journal_period_tree2_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="journal_period_view_tree"/>
            <field name="act_window" ref="act_journal_period_tree2"/>
        </record>
        <menuitem
            parent="menu_entries"
            action="act_journal_period_tree2"
            sequence="20"
            id="menu_journal_period_tree2"/>

        <record model="ir.action.act_window" id="act_journal_period_form_close">
            <field name="name">Close Journals - Periods</field>
            <field name="res_model">account.journal.period</field>
            <field name="search_value"
                eval="[('state', '=', 'open')]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_journal_period_form_close_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="journal_period_view_list_close"/>
            <field name="act_window" ref="act_journal_period_form_close"/>
        </record>

        <menuitem
            parent="menu_processing"
            action="act_journal_period_form_close"
            sequence="20"
            id="menu_close_journal_period"/>

        <record model="ir.model.access" id="access_journal_period">
            <field name="model">account.journal.period</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_journal_period_account">
            <field name="model">account.journal.period</field>
            <field name="group" ref="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="False"/>
        </record>
        <record model="ir.model.access" id="access_journal_period_account_admin">
            <field name="model">account.journal.period</field>
            <field name="group" ref="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.rule.group" id="rule_group_journal_period_companies">
            <field name="name">User in companies</field>
            <field name="model">account.journal.period</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_journal_period_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_journal_period_companies"/>
        </record>

        <record model="ir.model.button" id="journal_period_close_button">
            <field name="model">account.journal.period</field>
            <field name="name">close</field>
            <field name="string">Close</field>
        </record>
        <record model="ir.model.button" id="journal_period_reopen_button">
            <field name="model">account.journal.period</field>
            <field name="name">reopen</field>
            <field name="string">Reopen</field>
        </record>
    </data>

    <data noupdate="1">
        <record model="account.journal" id="journal_revenue">
            <field name="name">Revenue</field>
            <field name="code">REV</field>
            <field name="type">revenue</field>
        </record>
        <record model="account.journal" id="journal_expense">
            <field name="name">Expense</field>
            <field name="code">EXP</field>
            <field name="type">expense</field>
        </record>
        <record model="account.journal" id="journal_cash">
            <field name="name">Cash</field>
            <field name="code">CASH</field>
            <field name="type">cash</field>
        </record>
        <record model="account.journal" id="journal_stock">
            <field name="name">Stock</field>
            <field name="code">STO</field>
            <field name="type">general</field>
        </record>
        <record model="account.journal" id="journal_miscellaneous">
            <field name="name">Miscellaneous</field>
            <field name="code">MISC</field>
            <field name="type">general</field>
        </record>
        <record model="account.journal" id="journal_currency_exchange">
            <field name="name">Currency Exchange</field>
            <field name="code">EXC</field>
            <field name="type">write-off</field>
        </record>
    </data>
</tryton>
