fix(Report): validate 'Script Manager' role only for report type 'Script Report'

This commit is contained in:
Rucha Mahabal 2019-11-12 13:37:51 +05:30
parent f0f2f001c2
commit 9a23312ad7

View file

@ -30,7 +30,7 @@ class Report(Document):
if self.is_standard == "No":
# allow only script manager to edit scripts
if frappe.session.user!="Administrator":
if self.report_type == 'Script Report' and frappe.conf.server_script_enabled and frappe.session.user != "Administrator":
frappe.only_for('Script Manager', True)
if frappe.db.get_value("Report", self.name, "is_standard") == "Yes":