From 8f23404ad3e5683b50c8ef5c7af3ec6d0a3d5781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Tue, 16 Mar 2021 09:54:52 +0000 Subject: [PATCH] [FIX] stock: avoid raise a useless warning During the creation of the second warehouse, a warning popup to tell that it will activate also the Storage Locations setting even if this one is already activate. Only raise this warning if the is Storage Locations not activate yet. task-2558097 --- addons/stock/models/stock_warehouse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py index 18e5e8384e1..e1afcfb4e22 100644 --- a/addons/stock/models/stock_warehouse.py +++ b/addons/stock/models/stock_warehouse.py @@ -96,7 +96,8 @@ class Warehouse(models.Model): def _onchange_company_id(self): group_user = self.env.ref('base.group_user') group_stock_multi_warehouses = self.env.ref('stock.group_stock_multi_warehouses') - if group_stock_multi_warehouses not in group_user.implied_ids: + group_stock_multi_location = self.env.ref('stock.group_stock_multi_locations') + if group_stock_multi_warehouses not in group_user.implied_ids and group_stock_multi_location not in group_user.implied_ids: return { 'warning': { 'title': _('Warning'),