mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: Allow all System Managers to delete company transactions (#25834)
This commit is contained in:
@@ -12,10 +12,6 @@ from frappe.desk.notifications import clear_notifications
|
|||||||
class TransactionDeletionRecord(Document):
|
class TransactionDeletionRecord(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
frappe.only_for('System Manager')
|
frappe.only_for('System Manager')
|
||||||
company_obj = frappe.get_doc('Company', self.company)
|
|
||||||
if frappe.session.user != company_obj.owner and frappe.session.user != 'Administrator':
|
|
||||||
frappe.throw(_('Transactions can only be deleted by the creator of the Company or the Administrator.'),
|
|
||||||
frappe.PermissionError)
|
|
||||||
doctypes_to_be_ignored_list = get_doctypes_to_be_ignored()
|
doctypes_to_be_ignored_list = get_doctypes_to_be_ignored()
|
||||||
for doctype in self.doctypes_to_be_ignored:
|
for doctype in self.doctypes_to_be_ignored:
|
||||||
if doctype.doctype_name not in doctypes_to_be_ignored_list:
|
if doctype.doctype_name not in doctypes_to_be_ignored_list:
|
||||||
|
|||||||
Reference in New Issue
Block a user