From b0929a59a28622f2306192e6588ec8628ffa2189 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 6 May 2010 12:54:37 +0530 Subject: [PATCH] [FIX] :point_of_sale: fix the probelm of ir_property in pos_return wizard bzr revid: sbh@tinyerp.com-20100506072437-2qw1unb3bdn3mhre --- addons/point_of_sale/wizard/pos_return.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py index f0a63eeb00f..592ce3db56b 100644 --- a/addons/point_of_sale/wizard/pos_return.py +++ b/addons/point_of_sale/wizard/pos_return.py @@ -147,11 +147,11 @@ class pos_return(osv.osv_memory): for order_id in order_obj.browse(cr, uid, [record_id], context=context): prop_ids = property_obj.search(cr, uid,[('name', '=', 'property_stock_customer')]) - val = property_obj.browse(cr, uid,prop_ids[0]).value + val = property_obj.browse(cr, uid,prop_ids[0]).value_reference cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id)) res=cr.fetchone() location_id=res and res[0] or None - stock_dest_id = int(val.split(',')[1]) + stock_dest_id = val.id new_picking=picking_obj.copy(cr, uid, order_id.last_out_picking.id, {'name':'%s (return)' % order_id.name, 'move_lines':[], 'state':'draft', 'type':'in', @@ -232,11 +232,11 @@ class add_product(osv.osv_memory): prod=data['product_id'] qty=data['quantity'] prop_ids = property_obj.search(cr, uid,[('name', '=', 'property_stock_customer')]) - val = property_obj.browse(cr, uid,prop_ids[0]).value + val = property_obj.browse(cr, uid,prop_ids[0]).value_reference cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id)) res=cr.fetchone() location_id=res and res[0] or None - stock_dest_id = int(val.split(',')[1]) + stock_dest_id = val.id prod_id=prod_obj.browse(cr,uid,prod) new_picking=picking_obj.create(cr,uid,{ @@ -295,11 +295,11 @@ class add_product(osv.osv_memory): wf_service = netsvc.LocalService("workflow") for order_id in order_obj.browse(cr, uid, [record_id], context=context): prop_ids =property_obj.search(cr, uid,[('name', '=', 'property_stock_customer')]) - val = property_obj.browse(cr, uid,prop_ids[0]).value + val = property_obj.browse(cr, uid,prop_ids[0]).value_reference cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id)) res=cr.fetchone() location_id=res and res[0] or None - stock_dest_id = int(val.split(',')[1]) + stock_dest_id = val.id order_obj.write(cr,uid,[order_id.id],{'type_rec':'Exchange'}) if order_id.invoice_id: