From f2ef46e9f4ad0afe65b4a4da1cfaa6462545ee9d Mon Sep 17 00:00:00 2001 From: Adil Houmadi Date: Tue, 21 Apr 2015 17:12:52 +0200 Subject: [PATCH] [FIX] product: purchase report, correct warehouse Fix stock warehouse column on purchase report, we need to join stock_picking_type and stock_warehouse in order to have the warehouse itself Closes #6409 --- addons/purchase/report/purchase_report.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index 263084f8fe9..4cf3f647340 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -75,7 +75,7 @@ class purchase_report(osv.osv): s.dest_address_id, s.pricelist_id, s.validator, - s.picking_type_id as picking_type_id, + spt.warehouse_id as picking_type_id, s.partner_id as partner_id, s.create_uid as user_id, s.company_id as company_id, @@ -98,6 +98,7 @@ class purchase_report(osv.osv): LEFT JOIN ir_property ip ON (ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',t.id) AND ip.company_id=s.company_id) left join product_uom u on (u.id=l.product_uom) left join product_uom u2 on (u2.id=t.uom_id) + left join stock_picking_type spt on (spt.id=s.picking_type_id) group by s.company_id, s.create_uid, @@ -116,7 +117,7 @@ class purchase_report(osv.osv): t.categ_id, s.date_order, s.state, - s.picking_type_id, + spt.warehouse_id, u.uom_type, u.category_id, t.uom_id,