On cancel, check if doc is linked with other docs
This commit is contained in:
parent
c454efaa70
commit
296fbcb52c
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue