[FIX] mrp: do not rename warehouse when changing code

If only the code of a warehouse is changed, `name` is None.
Do not try to set None as the new pull name.

Fixes #14766
This commit is contained in:
Martin Trigaux
2016-12-19 16:07:31 +01:00
parent 9d9592137b
commit 51e6bb4727
+1 -1
View File
@@ -122,6 +122,6 @@ class StockWarehouse(models.Model):
res = super(StockWarehouse, self)._update_name_and_code(name, code)
# change the manufacture procurement rule name
for warehouse in self:
if warehouse.manufacture_pull_id:
if warehouse.manufacture_pull_id and name:
warehouse.manufacture_pull_id.write({'name': warehouse.manufacture_pull_id.name.replace(warehouse.name, name, 1)})
return res