Fixes #4103 - Reporting export file shows empty fields in selected columns when "custom sort option" is enabled.

This commit is contained in:
Rolf Schmidt 2022-05-31 15:18:20 +02:00
parent 62ae0e9944
commit bb80177a02

View file

@ -156,10 +156,11 @@ class ExcelSheet
record
end
case object[:data_type]
when 'boolean', 'select'
if object[:data_option] && object[:data_option]['options'] && object[:data_option]['options'][value]
value = object[:data_option]['options'][value]
when 'boolean', %r{^(multi|tree_)?select$}
if object[:data_option].present? && object[:data_option]['options'].present?
value = ObjectManager::Attribute.data_options_hash(object[:data_option]['options'])[value]
end
@worksheet.write_string(@current_row, @current_column, value) if value.present?
when 'datetime'
@worksheet.write_date_time(@current_row, @current_column, timestamp_in_localtime(value), @format_time) if value.present?