mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-09 15:29:30 +00:00
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
This commit is contained in:
@@ -1082,6 +1082,8 @@ def get_billing_shipping_address(name, billing_address=None, shipping_address=No
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_transaction_deletion_request(company):
|
def create_transaction_deletion_request(company):
|
||||||
frappe.only_for("System Manager")
|
frappe.only_for("System Manager")
|
||||||
|
# User Permission check
|
||||||
|
frappe.has_permission("Company", ptype="delete", doc=company, throw=True)
|
||||||
|
|
||||||
from erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record import (
|
from erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record import (
|
||||||
is_deletion_doc_running,
|
is_deletion_doc_running,
|
||||||
@@ -1090,6 +1092,7 @@ def create_transaction_deletion_request(company):
|
|||||||
is_deletion_doc_running(company)
|
is_deletion_doc_running(company)
|
||||||
|
|
||||||
tdr = frappe.get_doc({"doctype": "Transaction Deletion Record", "company": company})
|
tdr = frappe.get_doc({"doctype": "Transaction Deletion Record", "company": company})
|
||||||
|
tdr.flags.ignore_permissions = 1
|
||||||
tdr.insert()
|
tdr.insert()
|
||||||
|
|
||||||
tdr.generate_to_delete_list()
|
tdr.generate_to_delete_list()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"allow_bulk_edit": 1,
|
||||||
"autoname": "TDL.####",
|
"autoname": "TDL.####",
|
||||||
"creation": "2021-04-06 20:17:18.404716",
|
"creation": "2021-04-06 20:17:18.404716",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -166,19 +167,18 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"in_create": 1,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-11-18 15:02:46.427695",
|
"modified": "2026-09-02 20:32:19.679290",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Transaction Deletion Record",
|
"name": "Transaction Deletion Record",
|
||||||
"naming_rule": "Expression (old style)",
|
"naming_rule": "Expression",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"print": 1,
|
"print": 1,
|
||||||
@@ -186,7 +186,6 @@
|
|||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 1,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user