fix: patch not able to delete standard report

This commit is contained in:
Rohit Waghchaure 2020-10-22 13:11:44 +05:30
parent 6f9517864a
commit bd0bc62f12

View file

@ -49,7 +49,8 @@ class Report(Document):
self.export_doc()
def on_trash(self):
if self.is_standard == 'Yes' and not cint(getattr(frappe.local.conf, 'developer_mode',0)):
if (self.is_standard == 'Yes' and
not cint(getattr(frappe.local.conf, 'developer_mode',0)) and not frappe.flags.in_patch):
frappe.throw(_("You are not allowed to delete Standard Report"))
delete_custom_role('report', self.name)