From dfc68b997c7ea6e9a0a5e341b12674a244aa5da8 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Tue, 10 May 2022 22:21:48 +0200 Subject: [PATCH] Fix display of repository snapshot with stock consumption [SCI-6824] --- app/helpers/repository_datatable_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/helpers/repository_datatable_helper.rb b/app/helpers/repository_datatable_helper.rb index 7626df8da..2b2a68e9f 100644 --- a/app/helpers/repository_datatable_helper.rb +++ b/app/helpers/repository_datatable_helper.rb @@ -178,15 +178,14 @@ module RepositoryDatatableHelper end if options[:include_stock_consumption] && repository_snapshot.has_stock_management? - stock_present = record.repository_stock_cell.present? - row['stock'] = if stock_present + row['stock'] = if record.repository_stock_cell.present? display_cell_value(record.repository_stock_cell, team, repository_snapshot) else { value_type: 'RepositoryStockValue' } end row['consumedStock'] = - if stock_present + if record.repository_stock_consumption_cell.present? display_cell_value(record.repository_stock_consumption_cell, team, repository_snapshot) else {}