Browse Source

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

develop
Rushabh Mehta 12 years ago
parent
commit
cd7a02c489
  1. 4
      hr/doctype/expense_claim/expense_claim.py
  2. 6
      hr/doctype/leave_application/leave_application.py
  3. 6
      website/doctype/product_settings/product_settings.py

4
hr/doctype/expense_claim/expense_claim.py

@ -32,10 +32,6 @@ class DocType:
def validate(self):
# if self.doc.exp_approver == self.doc.owner:
# 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_exp_details()

6
hr/doctype/leave_application/leave_application.py

@ -32,10 +32,6 @@ class DocType:
def validate(self):
# 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_balance_leaves()
self.validate_leave_overlap()
@ -43,7 +39,7 @@ class DocType:
def on_submit(self):
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)
def get_holidays(self):

6
website/doctype/product_settings/product_settings.py

@ -10,4 +10,8 @@ class DocType:
def on_update(self):
"""clear web 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()
Loading…
Cancel
Save