account_financial_report: add option to hide parent hierarchy levels
This commit is contained in:
committed by
chaule97
parent
c9576fc899
commit
70c329e4b0
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user