message updates in Leave / Expense, catch localstorage error
This commit is contained in:
parent
ea025d50a1
commit
c09128ab47
@ -28,9 +28,15 @@ class DocType:
|
|||||||
self.doc = doc
|
self.doc = doc
|
||||||
self.doclist = doclist
|
self.doclist = doclist
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
if self.doc.exp_approver == self.doc.owner:
|
||||||
|
webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1)
|
||||||
|
self.validate_fiscal_year()
|
||||||
|
self.validate_exp_details()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
if self.doc.status=="Draft":
|
if self.doc.approval_status=="Draft":
|
||||||
webnotes.msgprint("""Please set status to 'Approved' or 'Rejected' before submitting""",
|
webnotes.msgprint("""Please set Approval Status to 'Approved' or 'Rejected' before submitting""",
|
||||||
raise_exception=1)
|
raise_exception=1)
|
||||||
|
|
||||||
def validate_fiscal_year(self):
|
def validate_fiscal_year(self):
|
||||||
@ -41,9 +47,6 @@ class DocType:
|
|||||||
msgprint("Posting Date is not within the Fiscal Year selected")
|
msgprint("Posting Date is not within the Fiscal Year selected")
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
def validate(self):
|
|
||||||
self.validate_fiscal_year()
|
|
||||||
|
|
||||||
def validate_exp_details(self):
|
def validate_exp_details(self):
|
||||||
if not getlist(self.doclist, 'expense_voucher_details'):
|
if not getlist(self.doclist, 'expense_voucher_details'):
|
||||||
msgprint("Please add expense voucher details")
|
msgprint("Please add expense voucher details")
|
||||||
|
|||||||
@ -90,6 +90,9 @@ class DocType:
|
|||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
if self.doc.leave_approver == self.doc.owner:
|
||||||
|
webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1)
|
||||||
|
|
||||||
self.validate_to_date()
|
self.validate_to_date()
|
||||||
self.validate_balance_leaves()
|
self.validate_balance_leaves()
|
||||||
self.validate_leave_overlap()
|
self.validate_leave_overlap()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user