From 1aff1e3de8cacd5e69239c649271013fa2f4a017 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 9 Jun 2017 12:23:54 +0200 Subject: [PATCH] [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 --- addons/point_of_sale/point_of_sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index ee976d61af1..370e150295d 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -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({