[FIX] account: Updating currency on Vendor bill

Steps to reproduce the bug:

- Enable Multi-Currencies and Multi-Companies
- Create a vendor bill
- Remove the default journal
- Set an other currencies

Bug:

A traceback was raised

opw:2350490

closes odoo/odoo#59546

X-original-commit: d9f8efcc330bc7454411aad3546de663424724f7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
Goffin Simon
2020-10-13 07:51:27 +00:00
committed by oco-odoo
parent b2be7e7193
commit 5d5c460784
+1 -1
View File
@@ -951,7 +951,7 @@ class AccountMove(models.Model):
existing_terms_lines = self.line_ids.filtered(lambda line: line.account_id.user_type_id.type in ('receivable', 'payable'))
others_lines = self.line_ids.filtered(lambda line: line.account_id.user_type_id.type not in ('receivable', 'payable'))
company_currency_id = self.company_id.currency_id
company_currency_id = (self.company_id or self.env.company).currency_id
total_balance = sum(others_lines.mapped(lambda l: company_currency_id.round(l.balance)))
total_amount_currency = sum(others_lines.mapped('amount_currency'))