odoo/odoo — pull request #1393 by ddico (2014-07-26 03:34:10+00:00)
Title: FIX: timesheet invoice - prevent duplicate line on invoice

Impacted versions:
8.0 and above

Steps to reproduce:
Record timesheet entries for more than one user. Process invoice for these timesheet entries.

Current behavior:
Multiple invoice lines will be created for each user with duplicated "note" in description.

Expected behavior:
One line per product with appropriate note in description

The issue is caused by the select statements on line #212 and line #265. Both are used to create the invoice line. As we observe the first select statement groups by user_id and second select doesn't. So the note (description) is not accurate. It makes sense to remove the group by "user_id" so the invoice will not have multiple lines for multiple users... We should create multiple lines for different "product_id".