Skip to content

Commit

Permalink
fix: copy paste from Excel (issue #24371)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0832f3b)
  • Loading branch information
treasuryesc authored and mergify[bot] committed Apr 9, 2024
1 parent 8d3d2e9 commit 30da5c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions frappe/public/js/frappe/form/controls/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ frappe.ui.form.ControlTable = class ControlTable extends frappe.ui.form.Control
data[0].forEach((column) => {
fieldnames.push(this.get_field(column));
var df = frappe.meta.get_docfield(doctype, this.get_field(column));
fieldtypes.push(df.fieldtype);
if (df) {
fieldtypes.push(df.fieldtype);
} else {
fieldtypes.push("");
}
});
data.shift();
} else {
Expand All @@ -62,7 +66,11 @@ frappe.ui.form.ControlTable = class ControlTable extends frappe.ui.form.Control
) {
fieldnames.push(column.fieldname);
var df = frappe.meta.get_docfield(doctype, column.fieldname);
fieldtypes.push(df.fieldtype);
if (df) {
fieldtypes.push(df.fieldtype);
} else {
fieldtypes.push("");
}
target_column_matched = true;
}
});
Expand Down

0 comments on commit 30da5c5

Please sign in to comment.