From 454518bce35f862084c258833764c8f7ed953f9a Mon Sep 17 00:00:00 2001 From: David Date: Tue, 1 Oct 2024 12:24:59 +0200 Subject: [PATCH] feat: add column selection heuristics --- erpnext/edi/doctype/code_list/code_list_import.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/edi/doctype/code_list/code_list_import.js b/erpnext/edi/doctype/code_list/code_list_import.js index 8db1ff5c4283..28b3d6cdcbf7 100644 --- a/erpnext/edi/doctype/code_list/code_list_import.js +++ b/erpnext/edi/doctype/code_list/code_list_import.js @@ -30,6 +30,7 @@ function show_column_selection_dialog(context) { label: __("as Title"), fieldtype: "Select", options: [null].concat(context.columns), + default: context.columns.includes("name") ? "name" : null, }, { fieldname: "code_column", @@ -37,6 +38,11 @@ function show_column_selection_dialog(context) { fieldtype: "Select", options: context.columns, reqd: 1, + default: context.columns.includes("code") + ? "code" + : context.columns.includes("value") + ? "value" + : null, }, { fieldname: "filters_column",