[FIX] purchase: updating code with _update_name_and_code

When updating the code of a warehouse, there was a missing condition.

opw:693387
This commit is contained in:
Goffin Simon
2016-11-14 10:04:08 +01:00
parent c544aa298f
commit fcd3d4d315
+1 -1
View File
@@ -128,7 +128,7 @@ class StockWarehouse(models.Model):
res = super(StockWarehouse, self)._update_name_and_code(name, code)
warehouse = self[0]
#change the buy procurement rule name
if warehouse.buy_pull_id:
if warehouse.buy_pull_id and name:
warehouse.buy_pull_id.write({'name': warehouse.buy_pull_id.name.replace(warehouse.name, name, 1)})
return res