[FIX] sale,sale_stock: sales analysis view using incorrect JOIN and group by clause
authorOlivier Dony <odo@openerp.com>
Tue, 5 Nov 2013 10:30:11 +0000 (11:30 +0100)
committerOlivier Dony <odo@openerp.com>
Tue, 5 Nov 2013 10:30:11 +0000 (11:30 +0100)
commit0f7099bb30be0faa63f2d1f5ac1ed4dff0201cd5
tree8ff0301c88a0ad09d94f9981dda2d21ca75e9f27
parent4cf2887153ef187fd5de74bbbdd68789c8b55a7e
[FIX] sale,sale_stock: sales analysis view using incorrect JOIN and group by clause

Similarly to the recent fixes in Purchase Analysis,
the Sales Analysis view must not group on the quantity
field. It is one of the columns that must be aggregated,
not used to fold PO lines into the same
result row.
The line count was also incorrect because of this, and
had to be corrected to actually count() the underlying
SO lines.

In addition, the JOINs were done in the wrong order,
which could cause problems (e.g. if an empty SO ever
landed in the database, all the SO line columns
would be empty in the JOIN, and cause errors)

bzr revid: odo@openerp.com-20131105103011-vkix07lsb6q3y9fd
addons/sale/report/sale_report.py
addons/sale_stock/report/sale_report.py