From c2f267917334175c964ebb83b60a48874b5f83ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 31 Oct 2021 10:30:52 +0100 Subject: [PATCH] Fill second_currency when amount_second_currency is set issue10916 review389191002 (grafted from 14eb7ee05e0ca0ff8184572f70a45b6410cff927) --HG-- branch : 6.0 --- account.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account.py b/account.py index 511427e300..d7654b29f1 100644 --- a/account.py +++ b/account.py @@ -168,10 +168,12 @@ class Invoice(metaclass=PoolMeta): config = Configuration(1) total = Decimal(0) total_currency = Decimal(0) + second_currency = None for line in move.lines: total += line.debit - line.credit if line.amount_second_currency: total_currency += line.amount_second_currency + second_currency = line.second_currency if total or total_currency: line = MoveLine() if total <= 0: @@ -191,6 +193,7 @@ class Invoice(metaclass=PoolMeta): '.msg_missing_cash_rounding_account')) if total_currency: line.amount_second_currency = total_currency + line.second_currency = second_currency lines = list(move.lines) lines.append(line) move.lines = lines