commonfied regional function for checking delete permission

This commit is contained in:
Nabin Hait
2018-03-09 13:19:52 +05:30
parent 6d532a82ee
commit 0357fbc9c1
5 changed files with 13 additions and 25 deletions

View File

@@ -0,0 +1,11 @@
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from erpnext import get_region
def check_deletion_permission(doc, method):
region = get_region()
if region in ["Nepal", "France"]:
frappe.throw(_("Deletion is not permitted for country {0}".format(region)))