mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 09:35:03 +00:00
refactor: make Excluded doctype table read only
(cherry picked from commit 7c4cff2649)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user