diff --git a/src/dataImport.ts b/src/dataImport.ts index 8dc23dd95..197667e14 100644 --- a/src/dataImport.ts +++ b/src/dataImport.ts @@ -51,7 +51,7 @@ function formatValue(value: string, fieldtype: FieldType): unknown { return new Date(value); case FieldType.Currency: // @ts-ignore - return frappe.pesa(value); + return frappe.pesa(value || 0); case FieldType.Int: case FieldType.Float: { const n = parseFloat(value); @@ -364,9 +364,9 @@ export class Importer { } const doc = frappe.getNewDoc(this.doctype); - await doc.set(docObj); try { + await doc.set(docObj); await doc.insert(); if (this.shouldSubmit) { await doc.submit(); diff --git a/src/pages/DataImport.vue b/src/pages/DataImport.vue index 0e6e77b12..4e4e44adc 100644 --- a/src/pages/DataImport.vue +++ b/src/pages/DataImport.vue @@ -212,7 +212,7 @@ :key="'matrix-row-' + i" >