From 0bb1e1cba0343d995ea1b98692200534f7a620e9 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 24 May 2011 17:49:58 +0530 Subject: [PATCH 1/2] [FIX]mrp:extensibility broken in action_scrap lp bug: https://launchpad.net/bugs/780589 fixed bzr revid: ron@tinyerp.com-20110524121958-t1vu2wpnk2yimgo2 --- addons/mrp/stock.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 0c1454edf98..29994398f06 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -137,14 +137,13 @@ class StockMove(osv.osv): wf_service = netsvc.LocalService("workflow") for move in self.browse(cr, uid, ids, context=context): new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context) - self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False}) production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])]) for prod_id in production_ids: wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr) for new_move in new_moves: production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]}) res.append(new_move) - return {} + return res StockMove() From 87aa4380d4008db1d0058cdd08c9d2989edabaa4 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 3 Jun 2011 12:29:38 +0530 Subject: [PATCH 2/2] [IMP]mrp: instead of removing the line give the proper comment of that line bzr revid: ron@tinyerp.com-20110603065938-chm15leo6r9aazil --- addons/mrp/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 29994398f06..2756e383adb 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -137,6 +137,8 @@ class StockMove(osv.osv): wf_service = netsvc.LocalService("workflow") for move in self.browse(cr, uid, ids, context=context): new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context) + #If we are not scrapping our whole move, tracking and lot references must not be removed + #self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False}) production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])]) for prod_id in production_ids: wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr)