[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
This commit is contained in:
Rémy Voet (ryv)
2021-07-13 06:57:17 +00:00
parent 892087c71b
commit 8f23404ad3
+2 -1
View File
@@ -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'),