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