From b43ce7c73f0ccb9c0ee68672ec16796d0f091185 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 26 Sep 2024 14:21:22 +0200 Subject: [PATCH] Fix sublocation counter for deleted locations [SCI-11101] --- app/services/lists/storage_locations_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/lists/storage_locations_service.rb b/app/services/lists/storage_locations_service.rb index 0686b88db..cd6904f93 100644 --- a/app/services/lists/storage_locations_service.rb +++ b/app/services/lists/storage_locations_service.rb @@ -20,7 +20,7 @@ module Lists @records = StorageLocation.joins('LEFT JOIN storage_locations AS sub_locations ' \ - 'ON storage_locations.id = sub_locations.parent_id') + 'ON storage_locations.id = sub_locations.parent_id AND sub_locations.discarded_at IS NULL') .left_joins(:team, :created_by) .select(shared_sql_select) .select(