2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

fix: don't set empty values

This commit is contained in:
18alantom 2022-02-25 15:22:28 +05:30
parent e9b52c8d1b
commit eade5770b0

View File

@ -350,7 +350,6 @@ export class Importer {
} }
} }
// return docObjs;
return Object.keys(docMap).map((k) => docMap[k]); return Object.keys(docMap).map((k) => docMap[k]);
} }
@ -363,8 +362,15 @@ export class Importer {
delete docObj.name; delete docObj.name;
} }
const doc = frappe.getNewDoc(this.doctype); for (const key in docObj) {
if (docObj[key] !== '') {
continue;
}
delete docObj[key];
}
const doc = frappe.getNewDoc(this.doctype);
try { try {
await doc.set(docObj); await doc.set(docObj);
await doc.insert(); await doc.insert();