From 94959f459a66cc84a35f6a58521c8946499ff044 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 21 Nov 2018 18:15:25 +0100 Subject: [PATCH] Restore drill-through on sale and invoice reports --- account_usability/__init__.py | 1 + account_usability/__manifest__.py | 1 + account_usability/account_invoice_report.py | 27 ++++++++++ .../account_invoice_report_view.xml | 51 +++++++++++++++++++ sale_usability/__manifest__.py | 1 + sale_usability/sale_report_view.xml | 46 +++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 account_usability/account_invoice_report.py create mode 100644 account_usability/account_invoice_report_view.xml create mode 100644 sale_usability/sale_report_view.xml diff --git a/account_usability/__init__.py b/account_usability/__init__.py index be026e1..dcab2b0 100644 --- a/account_usability/__init__.py +++ b/account_usability/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from . import account +from . import account_invoice_report from . import partner from . import wizard diff --git a/account_usability/__manifest__.py b/account_usability/__manifest__.py index 6e19a2d..2764262 100644 --- a/account_usability/__manifest__.py +++ b/account_usability/__manifest__.py @@ -38,6 +38,7 @@ This module has been written by Alexis de Lattre from Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields + + +class AccountInvoiceReport(models.Model): + _inherit = 'account.invoice.report' + + number = fields.Char(string="Number", readonly=True) + + def _sub_select(self): + select_str = super(AccountInvoiceReport, self)._sub_select() + select_str += ", ai.number" + return select_str + + def _select(self): + select_str = super(AccountInvoiceReport, self)._select() + select_str += ", sub.number" + return select_str + + def _group_by(self): + group_by_str = super(AccountInvoiceReport, self)._group_by() + group_by_str += ", ai.number" + return group_by_str diff --git a/account_usability/account_invoice_report_view.xml b/account_usability/account_invoice_report_view.xml new file mode 100644 index 0000000..b0b07b3 --- /dev/null +++ b/account_usability/account_invoice_report_view.xml @@ -0,0 +1,51 @@ + + + + + + + + usability.account.invoice.report.tree + account.invoice.report + + + + + + + + + + + + + + + + + + + {'search_default_current': 1, 'search_default_supplier': 1, 'search_default_year': 1} + + + + {'search_default_current': 1, 'search_default_customer': 1, 'search_default_year': 1} + + + + usability.account.invoice.report + account.invoice.report + + + + + + + + + + diff --git a/sale_usability/__manifest__.py b/sale_usability/__manifest__.py index 4577b53..2ce74aa 100644 --- a/sale_usability/__manifest__.py +++ b/sale_usability/__manifest__.py @@ -26,6 +26,7 @@ This module has been written by Alexis de Lattre from Akretion 'depends': ['sale'], 'data': [ 'sale_view.xml', + 'sale_report_view.xml', 'product_view.xml', 'security/ir.model.access.csv', ], diff --git a/sale_usability/sale_report_view.xml b/sale_usability/sale_report_view.xml new file mode 100644 index 0000000..3849bc6 --- /dev/null +++ b/sale_usability/sale_report_view.xml @@ -0,0 +1,46 @@ + + + + + + + + usability.sale.report.tree + sale.report + + + + + + + + + + + + + + + + + + + {'search_default_Sales': 1} + + + + usability.sale.report.pivot + sale.report + + + + + + + + +