[FIX] MRP: Proper context value passed for PO creation from packing via SO
authorJay (Open ERP) <jvo@tinyerp.com>
Fri, 4 Dec 2009 14:12:46 +0000 (19:42 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Fri, 4 Dec 2009 14:12:46 +0000 (19:42 +0530)
lp bug: https://launchpad.net/bugs/490883 fixed

bzr revid: jvo@tinyerp.com-20091204141246-ek5f8axx0zvg121q

addons/mrp/mrp.py

index 33e3eb0..e87962e 100644 (file)
@@ -1078,11 +1078,13 @@ class mrp_procurement(osv.osv):
             newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
             newdate = newdate - procurement.product_id.seller_ids[0].delay
 
-            context.update({'lang':partner.lang})
+            #Passing partner_id to context for purchase order line integrity of Line name
+            context.update({'lang':partner.lang, 'partner_id':partner_id})
+            
             product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context)
 
             line = {
-                'name': product.name,
+                'name': product.partner_ref,
                 'product_qty': qty,
                 'product_id': procurement.product_id.id,
                 'product_uom': uom_id,