[FIX] account_financial_report: 2 things:

* Fix account group level computation

  Depends was not correct for recomputing when needed + better algorithm

* Make hide details on 0 work properly

  * Passing values to general ledger was stripping some correct records
  * Computed field for hiding lines doesn't have proper dependencies nor is not
    taking into account float currency accuracy
This commit is contained in:
Pedro M. Baeza
2019-01-07 14:53:51 +01:00
committed by chaule97
parent 5080632d83
commit 072859bcb7
2 changed files with 24 additions and 14 deletions

View File

@@ -25,15 +25,13 @@ class AccountGroup(models.Model):
string="Accounts", store=True)
@api.multi
@api.depends('parent_id')
@api.depends('parent_id', 'parent_id.level')
def _compute_level(self):
for group in self:
level = 0
new_group = group
while new_group.parent_id:
level += 1
new_group = new_group.parent_id
group.level = level
if not group.parent_id:
group.level = 0
else:
group.level = group.parent_id.level + 1
@api.multi
@api.depends('code_prefix', 'account_ids', 'account_ids.code',