Update __init__.py

This commit is contained in:
Nabin Hait 2019-01-22 10:41:50 +05:30 committed by GitHub
parent 9adfd2d7b4
commit a334ed879f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,5 +7,5 @@ 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)))
if region in ["Nepal", "France"] and doc.docstatus != 0:
frappe.throw(_("Deletion is not permitted for country {0}".format(region)))