diff --git a/account_financial_report/README.rst b/account_financial_report/README.rst index 200392b3..0f0be83b 100644 --- a/account_financial_report/README.rst +++ b/account_financial_report/README.rst @@ -50,6 +50,12 @@ currency balances are not available. Changelog ========= +11.0.2.5.0 (2019-04-26) +~~~~~~~~~~~~~~~~~~~~~~~ + +* In the Trial Balance you have an option to hide parent hierarchy levels + + 11.0.2.4.1 (2019-01-08) ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/account_financial_report/__manifest__.py b/account_financial_report/__manifest__.py index b42d2894..59d023e7 100644 --- a/account_financial_report/__manifest__.py +++ b/account_financial_report/__manifest__.py @@ -4,7 +4,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Account Financial Reports', - 'version': '11.0.2.4.3', + 'version': '11.0.2.5.0', 'category': 'Reporting', 'summary': 'OCA Financial Reports', 'author': 'Camptocamp SA,' diff --git a/account_financial_report/readme/HISTORY.rst b/account_financial_report/readme/HISTORY.rst index a9568b0b..1d53d794 100644 --- a/account_financial_report/readme/HISTORY.rst +++ b/account_financial_report/readme/HISTORY.rst @@ -1,3 +1,8 @@ +11.0.2.5.0 (2019-04-26) +~~~~~~~~~~~~~~~~~~~~~~~ + +* In the Trial Balance you have an option to hide parent hierarchy levels + 11.0.2.4.1 (2019-01-08) ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/account_financial_report/report/trial_balance.py b/account_financial_report/report/trial_balance.py index 43a5cb20..8e81dced 100644 --- a/account_financial_report/report/trial_balance.py +++ b/account_financial_report/report/trial_balance.py @@ -48,6 +48,8 @@ class TrialBalanceReport(models.TransientModel): limit_hierarchy_level = fields.Boolean('Limit hierarchy levels') show_hierarchy_level = fields.Integer('Hierarchy Levels to display', default=1) + hide_parent_hierarchy_level = fields.Boolean( + 'Do not display parent levels', default=False) # General Ledger Report Data fields, # used as base for compute the data reports general_ledger_id = fields.Many2one( @@ -136,9 +138,16 @@ class TrialBalanceReportAccount(models.TransientModel): and float_is_zero(rec.debit, precision_rounding=r) and float_is_zero(rec.credit, precision_rounding=r)): rec.hide_line = True - elif report.limit_hierarchy_level and \ - rec.level > report.show_hierarchy_level: - rec.hide_line = True + elif report.limit_hierarchy_level and report.show_hierarchy_level: + if report.hide_parent_hierarchy_level: + distinct_level = rec.level != report.show_hierarchy_level + if rec.account_group_id and distinct_level: + rec.hide_line = True + elif rec.level and distinct_level: + rec.hide_line = True + elif not report.hide_parent_hierarchy_level and \ + rec.level > report.show_hierarchy_level: + rec.hide_line = True class TrialBalanceReportPartner(models.TransientModel): diff --git a/account_financial_report/wizard/trial_balance_wizard.py b/account_financial_report/wizard/trial_balance_wizard.py index 655d4a1f..0a01535d 100644 --- a/account_financial_report/wizard/trial_balance_wizard.py +++ b/account_financial_report/wizard/trial_balance_wizard.py @@ -50,6 +50,8 @@ class TrialBalanceReportWizard(models.TransientModel): limit_hierarchy_level = fields.Boolean('Limit hierarchy levels') show_hierarchy_level = fields.Integer('Hierarchy Levels to display', default=1) + hide_parent_hierarchy_level = fields.Boolean( + 'Do not display parent levels', default=False) account_ids = fields.Many2many( comodel_name='account.account', string='Filter accounts', @@ -230,6 +232,7 @@ class TrialBalanceReportWizard(models.TransientModel): 'hierarchy_on': self.hierarchy_on, 'limit_hierarchy_level': self.limit_hierarchy_level, 'show_hierarchy_level': self.show_hierarchy_level, + 'hide_parent_hierarchy_level': self.hide_parent_hierarchy_level, 'show_partner_details': self.show_partner_details, } diff --git a/account_financial_report/wizard/trial_balance_wizard_view.xml b/account_financial_report/wizard/trial_balance_wizard_view.xml index a95d2acd..f2542f92 100644 --- a/account_financial_report/wizard/trial_balance_wizard_view.xml +++ b/account_financial_report/wizard/trial_balance_wizard_view.xml @@ -25,6 +25,7 @@ +