Skip to content

Commit

Permalink
!fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Oct 29, 2018
1 parent a1824fe commit 670d722
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions account_analytic_parent/models/account_analytic_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _compute_debit_credit_balance(self):
analytic_line_obj = self.env['account.analytic.line']
# compute only analytic line
for account in self.filtered(lambda x: x.child_ids):
domain = [('account_id', 'in', account.child_ids.ids)]
domain = [('account_id', 'child_of', account.ids)]
credit_groups = analytic_line_obj.read_group(
domain=domain + [('amount', '>=', 0.0)],
fields=['account_id', 'amount'],
Expand All @@ -43,8 +43,8 @@ def _compute_debit_credit_balance(self):
groupby=['account_id']
)
data_debit = sum(l['amount'] for l in debit_groups)
account.debit += data_debit
account.credit += data_credit
account.debit = data_debit
account.credit = data_credit
account.balance = account.credit - account.debit

@api.multi
Expand Down

0 comments on commit 670d722

Please sign in to comment.