Nabin Hait | 0357fbc | 2018-03-09 13:19:52 +0530 | [diff] [blame] | 1 | # Copyright (c) 2018, Frappe Technologies and contributors |
| 2 | # For license information, please see license.txt |
| 3 | |
Aditya Hase | f3c22f3 | 2019-01-22 18:22:20 +0530 | [diff] [blame] | 4 | from __future__ import unicode_literals |
Nabin Hait | 0357fbc | 2018-03-09 13:19:52 +0530 | [diff] [blame] | 5 | import frappe |
| 6 | from frappe import _ |
| 7 | from erpnext import get_region |
| 8 | |
| 9 | def check_deletion_permission(doc, method): |
| 10 | region = get_region() |
Nabin Hait | a334ed8 | 2019-01-22 10:41:50 +0530 | [diff] [blame] | 11 | if region in ["Nepal", "France"] and doc.docstatus != 0: |
| 12 | frappe.throw(_("Deletion is not permitted for country {0}".format(region))) |