From a23eea7523fc10d9f037857f4c33ee68f147b1d1 Mon Sep 17 00:00:00 2001 From: ajugo Date: Tue, 24 May 2022 11:49:36 +0200 Subject: [PATCH] Hide stock column at importing items after stock is disabled [SCI-6801] (#4093) * Add stock column check at importing inventory items [SCI-6801] * Fix hound message [SCI-6801] --- app/models/repository_column.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/repository_column.rb b/app/models/repository_column.rb index ef0e598d3..94239886a 100644 --- a/app/models/repository_column.rb +++ b/app/models/repository_column.rb @@ -87,7 +87,11 @@ class RepositoryColumn < ApplicationRecord end def importable? - Extends::REPOSITORY_IMPORTABLE_TYPES.include?(data_type.to_sym) + if data_type == 'RepositoryStockValue' + RepositoryBase.stock_management_enabled? + else + Extends::REPOSITORY_IMPORTABLE_TYPES.include?(data_type.to_sym) + end end def deep_dup