diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index da616cc63b7..522ea243542 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -489,6 +489,10 @@ class AccountMoveLine(models.Model): for line in self.move_id.resolve_2many_commands( '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 + if currency: + balance = currency.round(balance) if balance < 0: rec.update({'debit': -balance}) if balance > 0: