[FIX] analytic: missing depends

This commit adds a missing `depends` on the `debit` and `credit` computed
field on analytic account model. Indeed, without that, the recompute is not
done when accessing thoses fields after adding lines in the same
transaction (like in tests).

Task-1911581
This commit is contained in:
jem-odoo
2019-08-21 11:22:58 +00:00
parent 00ac6c60f6
commit 7c5ce75aeb
@@ -78,6 +78,7 @@ class AccountAnalyticAccount(models.Model):
line['credit'] = sum(accounts.mapped('credit'))
return res
@api.depends('line_ids.amount')
def _compute_debit_credit_balance(self):
Curr = self.env['res.currency']
analytic_line_obj = self.env['account.analytic.line']