From fafc048d028a1356e5dc73628a97ef3c751d59ec Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Tue, 1 Nov 2016 16:50:07 -0700 Subject: [PATCH] [FIX] point_of_sale: only set qty_done on non-tracked products The POS attempts to auto-validate pickings and so it sets qty_done of the pack operations to equal product_qty. In the case of a pack operation about a tracked product this doesn't make much sense, as in that case auto-validation will fail and serial/lot numbers have to be manually specified by the user. Without this patch you end up with pack operations that look like they're done, but still need to have serial/lot numbers set. opw-690516 --- addons/point_of_sale/point_of_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 1d35dc8437c..50023d1d347 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -957,7 +957,7 @@ class pos_order(osv.osv): picking_obj.force_assign(cr, uid, [picking_id], context=context) # Mark pack operations as done pick = picking_obj.browse(cr, uid, picking_id, context=context) - for pack in pick.pack_operation_ids: + for pack in pick.pack_operation_ids.filtered(lambda pack: pack.product_id.tracking == 'none'): self.pool['stock.pack.operation'].write(cr, uid, [pack.id], {'qty_done': pack.product_qty}, context=context) picking_obj.action_done(cr, uid, [picking_id], context=context)