refactor: make Excluded doctype table read only

(cherry picked from commit 7c4cff2649)
This commit is contained in:
ruthra kumar
2024-02-04 15:29:39 +05:30
committed by Mergify
parent efebec3f95
commit c827be4345
3 changed files with 5 additions and 5 deletions

View File

@@ -15,9 +15,6 @@ frappe.ui.form.on("Transaction Deletion Record", {
});
}
frm.get_field('doctypes_to_be_ignored').grid.cannot_add_rows = true;
},
refresh: function(frm) {
@@ -25,6 +22,7 @@ frappe.ui.form.on("Transaction Deletion Record", {
let execute_btn = __("Start Deletion")
frm.add_custom_button(execute_btn, () => {
// Entry point for chain of events
frm.call({
method: 'delete_bins',
doc: frm.doc

View File

@@ -41,7 +41,8 @@
"fieldname": "doctypes_to_be_ignored",
"fieldtype": "Table",
"label": "Excluded DocTypes",
"options": "Transaction Deletion Record Item"
"options": "Transaction Deletion Record Item",
"read_only": 1
},
{
"fieldname": "amended_from",
@@ -123,7 +124,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-02-04 10:55:09.430373",
"modified": "2024-02-04 15:28:29.532826",
"modified_by": "Administrator",
"module": "Setup",
"name": "Transaction Deletion Record",

View File

@@ -110,6 +110,7 @@ class TransactionDeletionRecord(Document):
@frappe.whitelist()
def delete_bins(self):
# This methid is the entry point for the chain of events that follow
if not self.delete_bin_data:
frappe.db.sql(
"""delete from `tabBin` where warehouse in