From fcd3d4d315d4361608d2ac613ebf831f4fd60dd7 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 10 Nov 2016 10:12:25 +0100 Subject: [PATCH] [FIX] purchase: updating code with _update_name_and_code When updating the code of a warehouse, there was a missing condition. opw:693387 --- addons/purchase/models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/models/stock.py b/addons/purchase/models/stock.py index 93b3f99a902..0b56586ccb7 100644 --- a/addons/purchase/models/stock.py +++ b/addons/purchase/models/stock.py @@ -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