From 5c1695e248ceeebf30dca9326b5795053141124d Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 6 May 2010 12:50:19 +0530 Subject: [PATCH] [FIX] :point_of_sale: fix the probelm of ir_property bzr revid: sbh@tinyerp.com-20100506072019-yyoeeq5lrfdepc4e --- addons/point_of_sale/pos.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 8b31c3348d3..6a1e78ecbe0 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -496,11 +496,11 @@ 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 - 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 @@ -609,7 +609,7 @@ class pos_order(osv.osv): if 'payment_name' in data.keys(): args['name'] = data['payment_name'] + ' ' +order.name account_def = self.pool.get('ir.property').get(cr, uid, 'property_account_receivable', 'res.partner', context=context) - args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id + args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id if data.get('is_acc',False): args['is_acc']=data['is_acc'] args['account_id']= prod_obj.browse(cr,uid, data['product_id']).property_account_income and prod_obj.browse(cr,uid, data['product_id']).property_account_income.id @@ -773,7 +773,7 @@ class pos_order(osv.osv): to_reconcile = [] group_tax = {} account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context) - order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id + order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id # Create an entry for the sale move_id = account_move_obj.create(cr, uid, {