From 16cee3522ec65fbdeee48c5ea92f16eda0f7cbb7 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 25 Jun 2015 11:26:17 +0200 Subject: [PATCH] [FIX] stock: intermediate calculation remaining qty for backorder check: 0 qty should not take all of pack operation [IMP] Put in pack below everything --- addons/stock/stock.py | 4 ++-- addons/stock/stock_view.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index dd531491c38..773f131f398 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1283,7 +1283,7 @@ class stock_picking(models.Model): for ops in operations: #for each operation, create the links with the stock move by seeking on the matching reserved quants, #and deffer the operation if there is some ambiguity on the move to select - if ops.package_id and not ops.product_id and (not done_qtys or ops.product_qty): + if ops.package_id and not ops.product_id and (not done_qtys or ops.qty_done): #entire package quant_ids = package_obj.get_content(cr, uid, [ops.package_id.id], context=context) for quant in quant_obj.browse(cr, uid, quant_ids, context=context): @@ -1298,7 +1298,7 @@ class stock_picking(models.Model): need_rereserve = True elif ops.product_id.id: #Check moves with same product - product_qty = done_qtys and ops.qty_done or ops.product_qty + product_qty = ops.qty_done if done_qtys else ops.product_qty qty_to_assign = uom_obj._compute_qty_obj(cr, uid, ops.product_uom_id, product_qty, ops.product_id.uom_id, context=context) for move_dict in prod2move_ids.get(ops.product_id.id, []): move = move_dict['move'] diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index b53f0b9bdd5..602d4919d0d 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -753,7 +753,6 @@ states="confirmed,assigned,waiting,partially_available"/> -