diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 0f83cefa852..711c41f1960 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -496,12 +496,12 @@ class pos_order(osv.osv): if line.product_id and line.product_id.type=='service': continue prop_ids = self.pool.get("ir.property").search(cr, uid, [('name', '=', 'property_stock_customer')]) - val = self.pool.get("ir.property").browse(cr, uid, prop_ids[0]).value + val = self.pool.get("ir.property").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.shop_id.warehouse_id.id)) res=cr.fetchone() location_id=res and res[0] or None # location_id = order and order.shop_id and order.shop_id.warehouse_id and order.shop_id.warehouse_id.lot_stock_id.id or None - stock_dest_id = int(val.split(',')[1]) + stock_dest_id = val.id if line.qty < 0: location_id, stock_dest_id = stock_dest_id, location_id diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml index 637d37fa0b8..4958afc82fd 100644 --- a/addons/point_of_sale/pos_view.xml +++ b/addons/point_of_sale/pos_view.xml @@ -175,7 +175,9 @@ - + + + diff --git a/addons/point_of_sale/posrule_data.xml b/addons/point_of_sale/posrule_data.xml index b85fe0b8e4c..57e909ae913 100644 --- a/addons/point_of_sale/posrule_data.xml +++ b/addons/point_of_sale/posrule_data.xml @@ -25,23 +25,18 @@ - - - - - - - - - + POS line + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + @@ -66,42 +61,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + - + - - - - + + ['|',('user_id','=',False),('user_id','=',[user.id])] diff --git a/addons/point_of_sale/statement_data.xml b/addons/point_of_sale/statement_data.xml index 947348a990d..098f4cb2b00 100644 --- a/addons/point_of_sale/statement_data.xml +++ b/addons/point_of_sale/statement_data.xml @@ -21,13 +21,13 @@ - + - + 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: