Skip to content
Snippets Groups Projects
account_consultation.xml 6.89 KiB
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Views for the account consultation dialog. -->

    <record id="account_consultation_main" model="ir.ui.view">
        <field name="name">account_consultation_main</field>
        <field name="model">account.consultation</field>
        <field name="arch" type="xml">

            <form>
                <sheet>

                    <!-- Utility fields. -->
                    <field name="period_closed_state" invisible="1" />

                    <group name="account_selection_group" string="Account selection">
                        <group>
                            <field name="account_type_id" string="Type"
                                options="{'no_create': 1}" style="max-width: 200px;" />
                            <field name="account_id" options="{'no_create': True}"
                                style="max-width: 400px;" />
                        </group>
                    </group>

                    <group string="Transaction filters" col="6">

                        <group colspan="4">

                            <label for="period_from_id" string="Period: Filter" />
                            <div class="fieldblock">
                                <span> from</span>
                                <field name="period_from_id" widget="selection"
                                    domain="[
                                        ('special', '=', False),
                                        '|',
                                            ('state', '=', 'draft'),
                                            ('state', '=', period_closed_state),
                                    ]"
                                    nolabel="1" class="oe_inline" />

                                <span> to</span>
                                <field name="period_to_id" widget="selection"
                                    domain="[
                                        ('special', '=', False),
                                        '|',
                                            ('state', '=', 'draft'),
                                            ('state', '=', period_closed_state),
                                    ]"
                                    nolabel="1" class="oe_inline" />
                            </div>

                            <label for="due_date_from" string="Due date: Filter" />
                            <div class="fieldblock">
                                <span> from</span>
                                <field name="due_date_from" nolabel="1"
                                    class="oe_inline" />

                                <span> to</span>
                                <field name="due_date_to" nolabel="1"
                                    class="oe_inline" />
                            </div>

                            <label for="ref_filter" string="Reference: Filter" />
                            <div class="fieldblock">
                                <span> from</span>
                                <field name="ref_from" nolabel="1" class="oe_inline" />

                                <span> to</span>
                                <field name="ref_to" nolabel="1" class="oe_inline" />
                            </div>

                        </group>

                        <group>

                            <field name="transaction_state" style="width: 100px;" />
                            <field name="include_reconciled" />
                            <field name="include_closed_periods" />

                        </group>

                    </group>

                    <group string="Matching references">
                        <label
                            string="No accounting entry could be found with the specified parameters."
                            attrs="{'invisible': [('matching_count', '!=', 0)]}"
                            colspan="2" />
                        <field name="matching_count" string="Matching entries"
                            attrs="{'invisible': [('matching_count', '=', 0)]}" />
                        <field name="norefs_matching_count" string="Matching entries without ref"
                            attrs="{'invisible': [('matching_count', '=', 0)]}" />
                        <div attrs="{'invisible': [('matching_count', '=', 0)]}"
                            colspan="2">
                            <field name="refs_matching_count" nolabel="1"
                                class="oe_inline" style="font-weight: bolder;" />
                            <span> </span> <!-- Non-breaking space. -->
                            <div
                                style="
                                    display: inline-block;
                                    margin-top: 2px;
                                    margin-right: 6px;
                                ">
                                references:
                            </div>
                            <field name="refs_matching" nolabel="1"
                                class="oe_inline" />
                        </div>
                    </group>

                </sheet>

                <footer>

                    <button name="open_general_list" type="object" class="oe_highlight"
                        style="margin-right: 10px;">
                        <span>
                            <i class="fa fa-list" aria-hidden="true"></i>
                            Open the general list
                        </span>
                    </button>

                    <button name="open_analytic_list" type="object"
                        class="oe_highlight" style="margin-right: 10px;">
                        <span>
                            <i class="fa fa-list" aria-hidden="true"></i>
                            Open the analytic list
                        </span>
                    </button>

                    <button name="print_statement" type="object" class="oe_highlight"
                        style="margin-right: 10px;">
                        <span>
                            <i class="fa fa-file-text-o" aria-hidden="true"></i>
                            Print the statement
                        </span>
                    </button>

                </footer>
            </form>

        </field>
    </record>

    <!-- Add a menu command to launch the account consultation dialog. -->

    <record id="account_consultation_action" model="ir.actions.act_window">
        <field name="name">Account consultation</field>
        <field name="res_model">account.consultation</field>
        <field name="target">inline</field>
        <field name="view_mode">form</field>
        <field name="view_type">form</field>
    </record>

    <menuitem id="account_consultation_menu_command" name="Account consultation"
        parent="account_report.account_consultation_sub_menu" sequence="1"
        action="account_consultation_action" />

</odoo>