blob: 7388ea0e7298317049e4c15c13c7e69025daa6b8 [file] [log] [blame]
Nabin Hait0357fbc2018-03-09 13:19:52 +05301# Copyright (c) 2018, Frappe Technologies and contributors
2# For license information, please see license.txt
3
Aditya Hasef3c22f32019-01-22 18:22:20 +05304from __future__ import unicode_literals
Nabin Hait0357fbc2018-03-09 13:19:52 +05305import frappe
6from frappe import _
7from erpnext import get_region
8
9def check_deletion_permission(doc, method):
Himanshu Mishra35b26272018-11-13 11:13:04 +053010 region = get_region(doc.company)
Nabin Haita334ed82019-01-22 10:41:50 +053011 if region in ["Nepal", "France"] and doc.docstatus != 0:
Himanshu Mishra35b26272018-11-13 11:13:04 +053012 frappe.throw(_("Deletion is not permitted for country {0}".format(region)))