From 2d17e1ee573449f2dc452b271fa49a8e0bcf0412 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Thu, 13 Jan 2011 18:44:33 +0530 Subject: [PATCH] [IMP]: stock: when scrapping some stock move, if the source location is virtual, and if the destination isn't, take the destination location instead of the source as source for the scrapped move bzr revid: rpa@tinyerp.com-20110113131433-ya5q5ldwrx3jgnra --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 68b6edb5f8d..62e24a3f80a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2221,6 +2221,8 @@ class stock_move(osv.osv): 'tracking_id': move.tracking_id.id, 'prodlot_id': move.prodlot_id.id, } + if move.location_id.usage <> 'internal': + default_val.update({'location_id': move.location_dest_id.id}) new_move = self.copy(cr, uid, move.id, default_val) res += [new_move]