mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
added workflow help, fixed button primary action in form and refactored permissions
This commit is contained in:
@@ -32,10 +32,6 @@ class DocType:
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
# if self.doc.exp_approver == self.doc.owner:
|
# if self.doc.exp_approver == self.doc.owner:
|
||||||
# webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1)
|
# webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1)
|
||||||
|
|
||||||
import utilities
|
|
||||||
utilities.validate_status(self.doc.approval_status, ["Draft", "Approved", "Rejected"])
|
|
||||||
|
|
||||||
self.validate_fiscal_year()
|
self.validate_fiscal_year()
|
||||||
self.validate_exp_details()
|
self.validate_exp_details()
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,6 @@ class DocType:
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
# if self.doc.leave_approver == self.doc.owner:
|
# if self.doc.leave_approver == self.doc.owner:
|
||||||
# webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1)
|
|
||||||
import utilities
|
|
||||||
utilities.validate_status(self.doc.status, ["Open", "Approved", "Rejected"])
|
|
||||||
|
|
||||||
self.validate_to_date()
|
self.validate_to_date()
|
||||||
self.validate_balance_leaves()
|
self.validate_balance_leaves()
|
||||||
self.validate_leave_overlap()
|
self.validate_leave_overlap()
|
||||||
@@ -43,7 +39,7 @@ class DocType:
|
|||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
if self.doc.status != "Approved":
|
if self.doc.status != "Approved":
|
||||||
webnotes.msgprint("""Only Approved Leave Applications can be Submitted.""",
|
webnotes.msgprint("""Only Leave Applications with status 'Approved' can be Submitted.""",
|
||||||
raise_exception=True)
|
raise_exception=True)
|
||||||
|
|
||||||
def get_holidays(self):
|
def get_holidays(self):
|
||||||
|
|||||||
@@ -11,3 +11,7 @@ class DocType:
|
|||||||
"""clear web cache"""
|
"""clear web cache"""
|
||||||
from website.utils import clear_cache
|
from website.utils import clear_cache
|
||||||
clear_cache()
|
clear_cache()
|
||||||
|
|
||||||
|
if self.doc.default_product_category:
|
||||||
|
webnotes.model_wrapper("Item Group",
|
||||||
|
self.doc.default_product_category).save()
|
||||||
Reference in New Issue
Block a user