[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
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user