mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 14:09:19 +00:00
refactor: minor UI tweaks
This commit is contained in:
@@ -10,26 +10,24 @@ frappe.ui.form.on("Transaction Deletion Record", {
|
|||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
doctypes_to_be_ignored_array = r.message;
|
doctypes_to_be_ignored_array = r.message;
|
||||||
populate_doctypes_to_be_ignored(doctypes_to_be_ignored_array, frm);
|
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) {
|
refresh: function (frm) {
|
||||||
if (frm.doc.docstatus==1 && ['Queued', 'Failed'].find(x => x == frm.doc.status)) {
|
if (frm.doc.docstatus == 1 && ["Queued", "Failed"].find((x) => x == frm.doc.status)) {
|
||||||
let execute_btn = __("Start Deletion")
|
let execute_btn = frm.doc.status == "Queued" ? __("Start Deletion") : __("Retry");
|
||||||
|
|
||||||
frm.add_custom_button(execute_btn, () => {
|
frm.add_custom_button(execute_btn, () => {
|
||||||
// Entry point for chain of events
|
// Entry point for chain of events
|
||||||
frm.call({
|
frm.call({
|
||||||
method: 'process_tasks',
|
method: "process_tasks",
|
||||||
doc: frm.doc
|
doc: frm.doc,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ class TransactionDeletionRecord(Document):
|
|||||||
else:
|
else:
|
||||||
self.db_set("status", "Completed")
|
self.db_set("status", "Completed")
|
||||||
self.db_set("delete_transactions", 1)
|
self.db_set("delete_transactions", 1)
|
||||||
|
self.db_set("error_log", None)
|
||||||
|
|
||||||
def get_doctypes_to_be_ignored_list(self):
|
def get_doctypes_to_be_ignored_list(self):
|
||||||
singles = frappe.get_all("DocType", filters={"issingle": 1}, pluck="name")
|
singles = frappe.get_all("DocType", filters={"issingle": 1}, pluck="name")
|
||||||
|
|||||||
Reference in New Issue
Block a user