From 5b15e85ada4d66bb2926ab1ab8d63c604d88daa8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 20 Jun 2014 11:30:52 +0530 Subject: [PATCH] Do not validate links, selects, mandatory, etc. on cancel --- frappe/model/document.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/model/document.py b/frappe/model/document.py index 1ccc9d2aa9..c5e18e60f7 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -159,7 +159,10 @@ class Document(BaseDocument): self.check_if_latest() self.set_parent_in_children() self.run_before_save_methods() - self._validate() + + if self._action != "cancel": + self._validate() + if self._action == "update_after_submit": self.validate_update_after_submit()