<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2018-2020 Akretion (http://www.akretion.com/)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>


<record id="account_invoice_report_tree" model="ir.ui.view">
    <field name="name">usability.account.invoice.report.tree</field>
    <field name="model">account.invoice.report</field>
    <field name="arch" type="xml">
        <tree string="Invoices Analysis">
            <field name="move_id"/>
            <field name="journal_id" optional="hide"/>
            <field name="company_id" optional="hide" groups="base.group_multi_company"/>
            <field name="invoice_date"/>
            <field name="invoice_date_due"/>
            <field name="move_type"/>
            <field name="commercial_partner_id"/>
            <field name="partner_id" optional="hide"/>
            <field name="country_id" optional="hide"/>
            <field name="industry_id" optional="hide"/>
            <field name="invoice_user_id"/>
            <field name="fiscal_position_id" optional="hide"/>
            <field name="product_id"/>
            <field name="product_categ_id" optional="hide"/>
            <field name="account_id" optional="hide"/>
            <field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting"/>
            <field name="quantity" sum="1"/>
            <field name="product_uom_id" groups="uom.group_uom"/>
            <field name="price_subtotal" sum="1"/>
            <field name="state"/>
            <field name="payment_state" optional="hide"/>
        </tree>
    </field>
</record>

<record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window">
    <field name="context">{'search_default_current': 1, 'search_default_supplier': 1, 'group_by': ['invoice_date']}</field>  <!-- Remove group_by_no_leaf, which breaks tree view -->
    <field name="view_mode">pivot,graph</field>
</record>

<record id="account.action_account_invoice_report_all" model="ir.actions.act_window">
    <field name="context">{'search_default_current': 1, 'search_default_customer': 1, 'group_by': ['invoice_date']}</field>  <!-- Remove group_by_no_leaf, which breaks tree view -->
    <field name="view_mode">pivot,graph</field>
</record>

<record id="view_account_invoice_report_pivot" model="ir.ui.view">
    <field name="name">usability.account.invoice.report</field>
    <field name="model">account.invoice.report</field>
    <field name="inherit_id" ref="account.view_account_invoice_report_pivot"/>
    <field name="arch" type="xml">
        <pivot position="attributes">
            <attribute name="disable_linking"></attribute>
        </pivot>
    </field>
</record>


</odoo>
