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