refactor: raise exception on invalid date
This commit is contained in:
parent
a52a1b49af
commit
a393a6b76c
@ -14,7 +14,7 @@ frappe.ui.form.on("Bulk Transaction Log", {
|
||||
frappe.call({
|
||||
method: "erpnext.utilities.bulk_transaction.retry",
|
||||
args: {date: frm.doc.date}
|
||||
}).then(()=> { });
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -15,6 +15,13 @@ class BulkTransactionLog(Document):
|
||||
|
||||
def load_from_db(self):
|
||||
log_detail = qb.DocType("Bulk Transaction Log Detail")
|
||||
|
||||
has_records = frappe.db.sql(
|
||||
f"select exists (select * from `tabBulk Transaction Log Detail` where date = '{self.name}');"
|
||||
)[0][0]
|
||||
if not has_records:
|
||||
raise frappe.DoesNotExistError
|
||||
|
||||
succeeded_logs = (
|
||||
qb.from_(log_detail)
|
||||
.select(Count(log_detail.date).as_("count"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user