fix: Allow all System Managers to delete company transactions (#25834)
This commit is contained in:
parent
3f1231b77c
commit
0ea4d850e1
@ -12,10 +12,6 @@ from frappe.desk.notifications import clear_notifications
|
||||
class TransactionDeletionRecord(Document):
|
||||
def validate(self):
|
||||
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()
|
||||
for doctype in self.doctypes_to_be_ignored:
|
||||
if doctype.doctype_name not in doctypes_to_be_ignored_list:
|
||||
|
Loading…
x
Reference in New Issue
Block a user