From 10f7460648787f65a04a816e7ef7c657dcd5c82c Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 10 Jun 2022 15:46:22 +0200 Subject: [PATCH] Fix repository export with enabled stock management [SCI-6907] --- app/services/repository_zip_export.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/repository_zip_export.rb b/app/services/repository_zip_export.rb index feffd2a02..6ca7904ac 100644 --- a/app/services/repository_zip_export.rb +++ b/app/services/repository_zip_export.rb @@ -31,15 +31,15 @@ module RepositoryZipExport zip = ZipExport.create(user: current_user) zip.generate_exportable_zip( current_user, - to_csv(rows, params[:header_ids], current_user, repository), + to_csv(rows, params[:header_ids], current_user, repository, nil, params[:my_module_id].present?), :repositories ) end - def self.to_csv(rows, column_ids, user, repository, handle_file_name_func = nil) + def self.to_csv(rows, column_ids, user, repository, handle_file_name_func = nil, in_module = false) # Parse column names csv_header = [] - add_consumption = !repository.is_a?(RepositorySnapshot) && repository.has_stock_management? + add_consumption = in_module && !repository.is_a?(RepositorySnapshot) && repository.has_stock_management? column_ids.each do |c_id| csv_header << case c_id.to_i when -1, -2