From 17bc54107fa19ba9cdbdbee2c4341bd908d2aca1 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Feb 2013 18:02:47 +0530 Subject: [PATCH] make leave application importable --- hr/doctype/leave_application/leave_application.py | 6 ++---- hr/doctype/leave_application/leave_application.txt | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index 06652ad66d0..472efe28e64 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -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 \ diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt index 32d4cc51014..cda0eb533f1 100644 --- a/hr/doctype/leave_application/leave_application.txt +++ b/hr/doctype/leave_application/leave_application.txt @@ -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",