From ab8c564f44159cfef302412df6b2c6602f5d45df Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Thu, 22 Aug 2019 07:07:21 +0000 Subject: [PATCH] [FIX] account: fix default_get of account move lines Obvious typo of 67d82b875cd. opw 2046137 closes odoo/odoo#35939 Signed-off-by: Nans Lefebvre (len) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 522ea243542..733edb8f565 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -490,7 +490,7 @@ class AccountMoveLine(models.Model): 'line_ids', self._context['line_ids'], fields=['credit', 'debit']): balance += line.get('debit', 0) - line.get('credit', 0) # if we are here, line_ids is in context, so journal_id should also be. - currency = self._context.get('journal_id') and self.browse(self._context['journal_id']).company_id.currency_id + currency = self._context.get('journal_id') and self.env["account.journal"].browse(self._context['journal_id']).company_id.currency_id if currency: balance = currency.round(balance) if balance < 0: