From 7c5ce75aeb2804cf13411017dc5c710fdf433506 Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Tue, 20 Aug 2019 08:31:42 +0000 Subject: [PATCH] [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 --- addons/analytic/models/analytic_account.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py index 2ec45c72f73..9d08316ee01 100644 --- a/addons/analytic/models/analytic_account.py +++ b/addons/analytic/models/analytic_account.py @@ -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']