added workflow help, fixed button primary action in form and refactored permissions

This commit is contained in:
Rushabh Mehta
2013-01-04 14:03:36 +05:30
parent a40a381d08
commit cd7a02c489
3 changed files with 6 additions and 10 deletions

View File

@@ -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()

View File

@@ -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):

View File

@@ -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()