From e1b62581d22536520fe87348189f90978c618e8f Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Fri, 12 Jun 2020 16:17:08 +0200 Subject: [PATCH] [IMP] account_financial_report: * fix speed issue in VAT report * rename Cost Center to Analytic Account in General Ledger --- account_financial_report/report/general_ledger_xlsx.py | 4 ++-- .../report/templates/general_ledger.xml | 4 ++-- account_financial_report/report/vat_report.py | 3 ++- account_financial_report/wizard/general_ledger_wizard.py | 2 +- .../wizard/general_ledger_wizard_view.xml | 7 ++++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/account_financial_report/report/general_ledger_xlsx.py b/account_financial_report/report/general_ledger_xlsx.py index da3f03c4..ea5ed0c5 100644 --- a/account_financial_report/report/general_ledger_xlsx.py +++ b/account_financial_report/report/general_ledger_xlsx.py @@ -35,9 +35,9 @@ class GeneralLedgerXslx(models.AbstractModel): ] if report.show_cost_center: res += [ - {'header': _('Cost center'), + {'header': _('Analytic Account'), 'field': 'analytic_account', - 'width': 15}, + 'width': 20}, ] if report.show_analytic_tags: res += [ diff --git a/account_financial_report/report/templates/general_ledger.xml b/account_financial_report/report/templates/general_ledger.xml index d8c1916f..1f8e6957 100644 --- a/account_financial_report/report/templates/general_ledger.xml +++ b/account_financial_report/report/templates/general_ledger.xml @@ -141,8 +141,8 @@ Label -
Cost - center
+
Analytic Account
diff --git a/account_financial_report/report/vat_report.py b/account_financial_report/report/vat_report.py index d8a14a4b..da215819 100644 --- a/account_financial_report/report/vat_report.py +++ b/account_financial_report/report/vat_report.py @@ -44,7 +44,6 @@ class VATReport(models.AbstractModel): domain = [('company_id', '=', company_id), ('date', '>=', date_from), ('date', '<=', date_to), - ('tax_ids', '!=', False), ('tax_exigible', '=', True)] if only_posted_moves: domain += [('move_id.state', '=', 'posted')] @@ -68,6 +67,8 @@ class VATReport(models.AbstractModel): domain=net_domain, fields=ml_fields, ) + taxed_move_lines = list( + filter(lambda d: d['tax_ids'], taxed_move_lines)) vat_data = [] for tax_move_line in tax_move_lines: vat_data.append({ diff --git a/account_financial_report/wizard/general_ledger_wizard.py b/account_financial_report/wizard/general_ledger_wizard.py index a668a049..a1d6118a 100644 --- a/account_financial_report/wizard/general_ledger_wizard.py +++ b/account_financial_report/wizard/general_ledger_wizard.py @@ -100,7 +100,7 @@ class GeneralLedgerReportWizard(models.TransientModel): default=True, ) show_cost_center = fields.Boolean( - string='Show Cost Center', + string='Show Analytic Account', default=True, ) diff --git a/account_financial_report/wizard/general_ledger_wizard_view.xml b/account_financial_report/wizard/general_ledger_wizard_view.xml index b7dc984c..1efc61e0 100644 --- a/account_financial_report/wizard/general_ledger_wizard_view.xml +++ b/account_financial_report/wizard/general_ledger_wizard_view.xml @@ -61,10 +61,11 @@ widget="many2many_tags" options="{'no_create': True}"/> - + + widget="many2many_tags" + options="{'no_create': True}"/> +