From fb621da402663e12ede5f3ee3e7b6db385551cb8 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 5 Jul 2018 09:41:42 +0200 Subject: [PATCH] [ADD] special treatment for profit&loss reports --- .../models/account_financial_report.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_financial_report_horizontal/models/account_financial_report.py b/account_financial_report_horizontal/models/account_financial_report.py index ab993e61..ef887b69 100644 --- a/account_financial_report_horizontal/models/account_financial_report.py +++ b/account_financial_report_horizontal/models/account_financial_report.py @@ -41,6 +41,14 @@ class AccountFinancialReport(models.Model): for report in reports: if not report.parent_id: result += report + # special treatment for profit and loss if they have the + # standard configuration type='other' + elif side == 'right' and report == self.env.ref( + 'account.account_financial_report_income0' + ) or side == 'left' and report == self.env.ref( + 'account.account_financial_report_expense0' + ): + last_bad_report = report # don't check children if we already checked the parent elif report.parent_id == last_bad_report: continue