mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +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) {
|
refresh: function(frm) {
|
||||||
@@ -25,6 +22,7 @@ frappe.ui.form.on("Transaction Deletion Record", {
|
|||||||
let execute_btn = __("Start Deletion")
|
let execute_btn = __("Start Deletion")
|
||||||
|
|
||||||
frm.add_custom_button(execute_btn, () => {
|
frm.add_custom_button(execute_btn, () => {
|
||||||
|
// Entry point for chain of events
|
||||||
frm.call({
|
frm.call({
|
||||||
method: 'delete_bins',
|
method: 'delete_bins',
|
||||||
doc: frm.doc
|
doc: frm.doc
|
||||||
|
|||||||
@@ -41,7 +41,8 @@
|
|||||||
"fieldname": "doctypes_to_be_ignored",
|
"fieldname": "doctypes_to_be_ignored",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Excluded DocTypes",
|
"label": "Excluded DocTypes",
|
||||||
"options": "Transaction Deletion Record Item"
|
"options": "Transaction Deletion Record Item",
|
||||||
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "amended_from",
|
"fieldname": "amended_from",
|
||||||
@@ -123,7 +124,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-02-04 10:55:09.430373",
|
"modified": "2024-02-04 15:28:29.532826",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Transaction Deletion Record",
|
"name": "Transaction Deletion Record",
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ class TransactionDeletionRecord(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def delete_bins(self):
|
def delete_bins(self):
|
||||||
|
# This methid is the entry point for the chain of events that follow
|
||||||
if not self.delete_bin_data:
|
if not self.delete_bin_data:
|
||||||
frappe.db.sql(
|
frappe.db.sql(
|
||||||
"""delete from `tabBin` where warehouse in
|
"""delete from `tabBin` where warehouse in
|
||||||
|
|||||||
Reference in New Issue
Block a user