From 61304087e7f48c677837dabdc8f1f8aeb18fb52e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 13 Jul 2017 15:58:48 +0200 Subject: [PATCH] [FIX] point_of_sale: Creating pos order line with qty=0 Steps to reproduce: 1.Create pos order with two products. 2.One of the products, must be type="Stockable Product" and quantity=0. 3.Pay order. 4.Check order --> extra info --> picking Bug: picking state = Waiting Availability In 9.0, the picking state is equal to "Done". Fixes #18089 opw:751565 --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 41025175d86..3ad1c0adb42 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -628,7 +628,7 @@ class PosOrder(models.Model): return_picking = Picking.create(return_vals) return_picking.message_post(body=message) - for line in order.lines.filtered(lambda l: l.product_id.type in ['product', 'consu']): + for line in order.lines.filtered(lambda l: l.product_id.type in ['product', 'consu'] and not float_is_zero(l.qty, precision_digits=l.product_id.uom_id.rounding)): moves |= Move.create({ 'name': line.name, 'product_uom': line.product_id.uom_id.id,