import frappe

def execute():
	frappe.reload_doc('core', 'doctype', 'user_permission')
	frappe.db.commit()
import frappe

def execute():
	frappe.flags.in_patch = True
	frappe.reload_doc('core', 'doctype', 'user_permission')
	frappe.db.commit()

set is_patch flag before running patch