[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
This commit is contained in:
bima 2016-02-03 14:12:22 +07:00 committed by Xavier Morel
parent e8d06f7b20
commit d01ecb6e79
1 changed files with 1 additions and 1 deletions

View File

@ -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)