refactor: raise exception on invalid date
(cherry picked from commit a393a6b76c35d95e4422fbf239c468ab48e67b71)
This commit is contained in:
parent
f28d718732
commit
0134be4915
@ -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