mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
fix: catch promise error
This commit is contained in:
parent
0109296750
commit
e9b52c8d1b
@ -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();
|
||||
|
@ -212,7 +212,7 @@
|
||||
:key="'matrix-row-' + i"
|
||||
>
|
||||
<button
|
||||
class="w-4 h-4 text-gray-600 hover:text-gray-900 cursor-pointer"
|
||||
class="w-4 h-4 text-gray-600 hover:text-gray-900 cursor-pointer outline-none"
|
||||
@click="
|
||||
() => {
|
||||
importer.dropRow(i);
|
||||
@ -443,6 +443,10 @@ export default {
|
||||
},
|
||||
},
|
||||
deactivated() {
|
||||
if (!this.complete) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.clear();
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
Reference in New Issue
Block a user