[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:
luc-demeyer 2016-06-17 10:27:53 +02:00 committed by qdp-odoo
parent 9007ed4c0b
commit 1750b90252
1 changed files with 3 additions and 0 deletions

View File

@ -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 = []