[FIX] purchase: Purchase Analysis view was using incorrect JOIN order
authorOlivier Dony <odo@openerp.com>
Mon, 4 Nov 2013 16:58:26 +0000 (17:58 +0100)
committerOlivier Dony <odo@openerp.com>
Mon, 4 Nov 2013 16:58:26 +0000 (17:58 +0100)
commitaac6fede99fc1f08aa6f9300afd9be1f9d6141a7
tree16f94191071c6cc31bd3430f8706e69e2774fdec
parent15062bdffe6930fd6b80575cae97369ede50c3e5
[FIX] purchase: Purchase Analysis view was using incorrect JOIN order

The starting table for Purchase Analysis is purchase_order_line
not purchase_order. The previous code was using a wrong JOIN
combination starting from purchase_order, which resulted in
a crash if an empty PO was created.
In order to prevent this an extra  WHERE clause on product_id
being NOT NULL was added, but this was incorrect too as it
prevented PO lines with no product_id value from appearing
in the Purchase Analysis results, while being perfectly valid.

bzr revid: odo@openerp.com-20131104165826-kltuzlh4i8q89sk0
addons/purchase/report/purchase_report.py