make leave application importable

This commit is contained in:
Anand Doshi 2013-02-18 18:02:47 +05:30
parent 78352d1e71
commit 17bc54107f
2 changed files with 5 additions and 6 deletions

View File

@ -20,7 +20,6 @@ from webnotes import _
from webnotes.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_url_to_form, get_fullname
from webnotes import msgprint
from webnotes.utils.email_lib import sendmail
class LeaveDayBlockedError(Exception): pass
@ -33,7 +32,6 @@ class DocType(DocListController):
self.previous_doc = None
def validate(self):
# if self.doc.leave_approver == self.doc.owner:
self.validate_to_date()
self.validate_balance_leaves()
self.validate_leave_overlap()
@ -41,8 +39,8 @@ class DocType(DocListController):
self.validate_block_days()
def on_update(self):
if (not self.previous_doc and self.doc.leave_approver) or (self.doc.status == "Open" \
and self.previous_doc.leave_approver != self.doc.leave_approver):
if (not self.previous_doc and self.doc.leave_approver) or (self.previous_doc and \
self.doc.status == "Open" and self.previous_doc.leave_approver != self.doc.leave_approver):
# notify leave approver about creation
self.notify_leave_approver()
elif self.previous_doc and \

View File

@ -1,12 +1,13 @@
[
{
"creation": "2013-02-18 13:36:20",
"creation": "2013-02-18 17:08:32",
"docstatus": 0,
"modified": "2013-02-18 16:59:53",
"modified": "2013-02-18 17:20:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_import": 1,
"autoname": "LAP/.#####",
"description": "Apply / Approve Leaves",
"doctype": "DocType",