refactor: change variable name from hide_name_for_insert_when_not_set_by_user ton hide_name_for_autoname

This commit is contained in:
Sumit Jain 2026-04-24 13:35:24 +05:30
parent 78b81fc7cf
commit 75c43493a8

View file

@ -197,7 +197,7 @@ frappe.data_import.DataExporter = class DataExporter {
...multicheck_fields.map((fieldname) => { ...multicheck_fields.map((fieldname) => {
let field = this.dialog.get_field(fieldname); let field = this.dialog.get_field(fieldname);
return field.options return field.options
.filter((option) => option.danger || option.include_in_import_template) .filter((option) => option.danger || option.in_import_template)
.map((option) => option.$checkbox.find("input").get(0)); .map((option) => option.$checkbox.find("input").get(0));
}) })
); );
@ -282,7 +282,7 @@ frappe.data_import.DataExporter = class DataExporter {
let fieldname = meta.autoname.slice("field:".length); let fieldname = meta.autoname.slice("field:".length);
autoname_field = frappe.meta.get_field(doctype, fieldname); autoname_field = frappe.meta.get_field(doctype, fieldname);
} }
const hide_name_for_insert_when_not_set_by_user = const hide_name_for_autoname =
this.exporting_for === "Insert New Records" && this.exporting_for === "Insert New Records" &&
!this.hide_blank_template && !this.hide_blank_template &&
!["Prompt", "prompt"].includes(meta.autoname); !["Prompt", "prompt"].includes(meta.autoname);
@ -325,7 +325,7 @@ frappe.data_import.DataExporter = class DataExporter {
.filter((df) => { .filter((df) => {
if ( if (
this.exporting_for === "Insert New Records" && this.exporting_for === "Insert New Records" &&
(autoname_field || hide_name_for_insert_when_not_set_by_user) && (autoname_field || hide_name_for_autoname) &&
df.fieldname === "name" df.fieldname === "name"
) { ) {
return false; return false;
@ -339,7 +339,7 @@ frappe.data_import.DataExporter = class DataExporter {
danger: is_field_mandatory(df), danger: is_field_mandatory(df),
warning: is_field_depends_on(df), warning: is_field_depends_on(df),
warning_title: get_info_title(df), warning_title: get_info_title(df),
include_in_import_template: !!df.include_in_import_template, in_import_template: !!df.in_import_template,
checked: false, checked: false,
description: `${df.fieldname} ${df.reqd ? __("(Mandatory)") : ""}`, description: `${df.fieldname} ${df.reqd ? __("(Mandatory)") : ""}`,
}; };