[MERGE] forward port branch 11.0 up to ab8c564f44
This commit is contained in:
@@ -519,7 +519,7 @@ class AccountMoveLine(models.Model):
|
|||||||
'line_ids', self._context['line_ids'], fields=['credit', 'debit']):
|
'line_ids', self._context['line_ids'], fields=['credit', 'debit']):
|
||||||
balance += line.get('debit', 0) - line.get('credit', 0)
|
balance += line.get('debit', 0) - line.get('credit', 0)
|
||||||
# if we are here, line_ids is in context, so journal_id should also be.
|
# 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:
|
if currency:
|
||||||
balance = currency.round(balance)
|
balance = currency.round(balance)
|
||||||
if balance < 0:
|
if balance < 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user