[FIX] point_of_sale: error picking
- Create a stockable and a service product - In the POS, sell 1 unit of the stockable product and -1 unit of the service product - Validate and pay 2 pickings are created: a picking containing the stockable product which stays in state 'Draft' and an empty picking in state 'Available'. The problem comes from the negative quantity on a service product: we should filter out services when checking the quantities. opw-745712
This commit is contained in:
@@ -1042,10 +1042,10 @@ class pos_order(osv.osv):
|
||||
'location_id': location_id,
|
||||
'location_dest_id': destination_id,
|
||||
}
|
||||
pos_qty = any([x.qty > 0 for x in order.lines])
|
||||
pos_qty = any([x.qty > 0 for x in order.lines if x.product_id.type in ['product', 'consu']])
|
||||
if pos_qty:
|
||||
order_picking_id = picking_obj.create(cr, uid, picking_vals.copy(), context=context)
|
||||
neg_qty = any([x.qty < 0 for x in order.lines])
|
||||
neg_qty = any([x.qty < 0 for x in order.lines if x.product_id.type in ['product', 'consu']])
|
||||
if neg_qty:
|
||||
return_vals = picking_vals.copy()
|
||||
return_vals.update({
|
||||
|
||||
Reference in New Issue
Block a user