[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user