[FIX]: fix a problem Point of sale create outgoing shipments incl. service items

lp bug: https://launchpad.net/bugs/433898 fixed

bzr revid: mga@tinyerp.com-20091207150852-dax23h6nfa1t6640
This commit is contained in:
Mantavya Gajjar
2009-12-07 20:38:52 +05:30
parent c9a07db7c0
commit 7af597ffed
+22 -21
View File
@@ -339,28 +339,29 @@ class pos_order(osv.osv):
if new:
for line in order.lines:
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
location_id = order.shop_id.warehouse_id.lot_stock_id.id
stock_dest_id = int(val.split(',')[1])
if line.qty < 0:
(location_id, stock_dest_id)= (stock_dest_id, location_id)
if line.product_id.type != 'service':
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
location_id = order.shop_id.warehouse_id.lot_stock_id.id
stock_dest_id = int(val.split(',')[1])
if line.qty < 0:
(location_id, stock_dest_id)= (stock_dest_id, location_id)
self.pool.get('stock.move').create(cr, uid, {
'name': 'Stock move (POS %d)' % (order.id, ),
'product_uom': line.product_id.uom_id.id,
'product_uos': line.product_id.uom_id.id,
'picking_id': picking_id,
'product_id': line.product_id.id,
'product_uos_qty': abs(line.qty),
'product_qty': abs(line.qty),
'tracking_id': False,
'state': 'waiting',
'location_id': location_id,
'location_dest_id': stock_dest_id,
})
self.pool.get('stock.move').create(cr, uid, {
'name': 'Stock move (POS %d)' % (order.id, ),
'product_uom': line.product_id.uom_id.id,
'product_uos': line.product_id.uom_id.id,
'picking_id': picking_id,
'product_id': line.product_id.id,
'product_uos_qty': abs(line.qty),
'product_qty': abs(line.qty),
'tracking_id': False,
'state': 'waiting',
'location_id': location_id,
'location_dest_id': stock_dest_id,
})
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking',