[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:
@@ -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'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user