On cancel, check if doc is linked with other docs

This commit is contained in:
Nabin Hait 2014-05-29 19:46:34 +05:30
parent c454efaa70
commit 296fbcb52c

View file

@ -400,9 +400,15 @@ class Document(BaseDocument):
self.run_method("on_submit")
elif self._action=="cancel":
self.run_method("on_cancel")
self.check_no_back_links_exist()
elif self._action=="update_after_submit":
self.run_method("on_update_after_submit")
def check_no_back_links_exist(self):
from frappe.model.delete_doc import check_if_doc_is_linked
if not self.get("ignore_links"):
check_if_doc_is_linked(self, method="Cancel")
@staticmethod
def whitelist(f):
f.whitelisted = True