Revert "Fix: Exclude "No Copy" Fields in Child Table Duplication"

This commit is contained in:
rohitwaghchaure 2025-04-01 20:34:31 +05:30 committed by GitHub
parent 9a1509bcf0
commit e95302425a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -895,25 +895,20 @@ export default class Grid {
}
duplicate_row(d, copy_doc) {
const noCopyFields = new Set([
"creation",
"modified",
"modified_by",
"idx",
"owner",
"parent",
"doctype",
"name",
"parentfield",
]);
const docfields = frappe.get_meta(this.doctype).fields || [];
$.each(docfields, function (_index, df) {
if (cint(df.no_copy)) noCopyFields.add(df.fieldname);
});
$.each(copy_doc, function (key, value) {
if (!noCopyFields.has(key)) {
if (
![
"creation",
"modified",
"modified_by",
"idx",
"owner",
"parent",
"doctype",
"name",
"parentfield",
].includes(key)
) {
d[key] = value;
}
});