[FIX] account: `amount_currency` when grouping invoice lines

when using a journal with 'Group Invoice Lines'
and issuing an invoice with foreign currency with more than 1 line
(of the same product, or no product),
the amount currency in the journal item
associated to the merged invoice lines was wrong.

It took into account the `amount_currency` of the first line only,
ignoring the `amount_currency` of the remaining merged lines.

opw-670972
Closes #10375
This commit is contained in:
eLBati 2016-01-08 18:08:49 +01:00 committed by Denis Ledoux
parent 14282f1659
commit e0555a66e1
1 changed files with 1 additions and 0 deletions

View File

@ -779,6 +779,7 @@ class account_invoice(models.Model):
line2[tmp]['debit'] = (am > 0) and am or 0.0
line2[tmp]['credit'] = (am < 0) and -am or 0.0
line2[tmp]['tax_amount'] += l['tax_amount']
line2[tmp]['amount_currency'] += l['amount_currency']
line2[tmp]['analytic_lines'] += l['analytic_lines']
else:
line2[tmp] = l