[FIX] :point_of_sale: fix the probelm of ir_property

bzr revid: sbh@tinyerp.com-20100506072019-yyoeeq5lrfdepc4e
This commit is contained in:
sbh (Open ERP)
2010-05-06 12:50:19 +05:30
parent 822935a55b
commit 5c1695e248
+4 -4
View File
@@ -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, {