From d01ecb6e7989cd239b81f932fe8b32487e6297be Mon Sep 17 00:00:00 2001 From: bima Date: Wed, 3 Feb 2016 14:12:22 +0700 Subject: [PATCH] [FIX] stock: wrong variable used in _handle_renaming Could incorrectly rename the stock.location.path objects, and in case the route has push_ids but no pull_ids would crash the method entirely. closes #10747 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f60e2ce6684..0562f2fe289 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3620,7 +3620,7 @@ class stock_warehouse(osv.osv): for pull in route.pull_ids: pull_obj.write(cr, uid, pull.id, {'name': pull.name.replace(warehouse.name, name, 1)}, context=context) for push in route.push_ids: - push_obj.write(cr, uid, push.id, {'name': pull.name.replace(warehouse.name, name, 1)}, context=context) + push_obj.write(cr, uid, push.id, {'name': push.name.replace(warehouse.name, name, 1)}, context=context) #change the mto pull rule name if warehouse.mto_pull_id.id: pull_obj.write(cr, uid, warehouse.mto_pull_id.id, {'name': warehouse.mto_pull_id.name.replace(warehouse.name, name, 1)}, context=context)