Merge pull request #541 from Eficent/11.0-afr-trial_balance-hierarhcy
[11.0] account_financial_report: add option to hide parent hierarchy levelspull/544/head
commit
4c859bca68
|
@ -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)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -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,'
|
||||
|
|
|
@ -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)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<field name="hierarchy_on" widget="radio" attrs="{'invisible':[('show_partner_details','=',True)]}"/>
|
||||
<field name="limit_hierarchy_level" attrs="{'invisible':['|', ('hierarchy_on','=','none'),('show_partner_details','=',True)]}"/>
|
||||
<field name="show_hierarchy_level" attrs="{'invisible':[('limit_hierarchy_level','=', False)]}"/>
|
||||
<field name="hide_parent_hierarchy_level" attrs="{'invisible':[('limit_hierarchy_level','=', False)]}"/>
|
||||
<field name="foreign_currency"/>
|
||||
</group>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue