brotherton-erpnext/erpnext/regional/__init__.py

13 lines
420 B
Python
Raw Normal View History

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