[FIX] account: fixed group_lines method of invoices.
The group_lines method didn't make the sum of the quantity field, hence resulting in incorrect results when making product based statistics from the account.move.line records. Courtesy of Luc De Meyer. Was PR #10551
This commit is contained in:
parent
9007ed4c0b
commit
1750b90252
|
@ -781,6 +781,9 @@ class account_invoice(models.Model):
|
|||
line2[tmp]['tax_amount'] += l['tax_amount']
|
||||
line2[tmp]['amount_currency'] += l['amount_currency']
|
||||
line2[tmp]['analytic_lines'] += l['analytic_lines']
|
||||
qty = l.get('quantity')
|
||||
if qty:
|
||||
line2[tmp]['quantity'] = line2[tmp].get('quantity', 0.0) + qty
|
||||
else:
|
||||
line2[tmp] = l
|
||||
line = []
|
||||
|
|
Loading…
Reference in New Issue