refactor: minor UI tweaks

This commit is contained in:
ruthra kumar
2024-03-19 17:41:37 +05:30
parent 4a55240e63
commit 0455d0c46c
2 changed files with 8 additions and 9 deletions

View File

@@ -10,26 +10,24 @@ frappe.ui.form.on("Transaction Deletion Record", {
callback: function (r) {
doctypes_to_be_ignored_array = r.message;
populate_doctypes_to_be_ignored(doctypes_to_be_ignored_array, frm);
frm.refresh_field('doctypes_to_be_ignored');
}
frm.refresh_field("doctypes_to_be_ignored");
},
});
}
},
refresh: function(frm) {
if (frm.doc.docstatus==1 && ['Queued', 'Failed'].find(x => x == frm.doc.status)) {
let execute_btn = __("Start Deletion")
refresh: function (frm) {
if (frm.doc.docstatus == 1 && ["Queued", "Failed"].find((x) => x == frm.doc.status)) {
let execute_btn = frm.doc.status == "Queued" ? __("Start Deletion") : __("Retry");
frm.add_custom_button(execute_btn, () => {
// Entry point for chain of events
frm.call({
method: 'process_tasks',
doc: frm.doc
method: "process_tasks",
doc: frm.doc,
});
});
}
},
});

View File

@@ -329,6 +329,7 @@ class TransactionDeletionRecord(Document):
else:
self.db_set("status", "Completed")
self.db_set("delete_transactions", 1)
self.db_set("error_log", None)
def get_doctypes_to_be_ignored_list(self):
singles = frappe.get_all("DocType", filters={"issingle": 1}, pluck="name")