[FIX] account: debit/credit values for move lines in foreign currencies
When the target currency is the company currency, there is no need to re-compute the debit/credit amounts of the move lines, since these debit/credit values already contains the amount of the move line within the company currency. Avoiding the recomputation prevents gain/loss during currencies exchanges opw-631748 opw-632133 opw-631895
This commit is contained in:
parent
4392289745
commit
9335fed9fe
|
@ -825,6 +825,11 @@ class account_move_line(osv.osv):
|
|||
total_amount_currency_str = rml_parser.formatLang(total_amount, currency_obj=line_currency)
|
||||
ret_line['credit_currency'] = actual_credit
|
||||
ret_line['debit_currency'] = actual_debit
|
||||
if target_currency == company_currency:
|
||||
actual_debit = debit
|
||||
actual_credit = credit
|
||||
total_amount = debit or credit
|
||||
else:
|
||||
ctx = context.copy()
|
||||
if target_date:
|
||||
ctx.update({'date': target_date})
|
||||
|
|
Loading…
Reference in New Issue