Skip to content

Commit

Permalink
fix(edi-import): Add description column only when more than two colum…
Browse files Browse the repository at this point in the history
…ns are available
  • Loading branch information
blaggacao committed Oct 1, 2024
1 parent 52dcb2b commit 46ab6ef
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions erpnext/edi/doctype/code_list/code_list_import.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,23 @@ function show_column_selection_dialog(context) {
? "value"
: null,
},
{
fieldname: "description_column",
label: __("as Description"),
fieldtype: "Select",
options: [null].concat(context.columns),
default: context.columns.includes("description") ? "description" : null,
},
{
fieldname: "filters_column",
label: __("Filter"),
fieldtype: "Column Break",
},
];

if (context.columns.length > 2) {
fields.splice(5, 0, {
fieldname: "description_column",
label: __("as Description"),
fieldtype: "Select",
options: [null].concat(context.columns),
default: context.columns.includes("description") ? "description" : null,
});
}

// Add filterable columns
for (let column in context.filterable_columns) {
fields.push({
Expand Down

0 comments on commit 46ab6ef

Please sign in to comment.