mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
make leave application importable
This commit is contained in:
@@ -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.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_url_to_form, get_fullname
|
||||||
from webnotes import msgprint
|
from webnotes import msgprint
|
||||||
from webnotes.utils.email_lib import sendmail
|
|
||||||
|
|
||||||
class LeaveDayBlockedError(Exception): pass
|
class LeaveDayBlockedError(Exception): pass
|
||||||
|
|
||||||
@@ -33,7 +32,6 @@ class DocType(DocListController):
|
|||||||
self.previous_doc = None
|
self.previous_doc = None
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
# if self.doc.leave_approver == self.doc.owner:
|
|
||||||
self.validate_to_date()
|
self.validate_to_date()
|
||||||
self.validate_balance_leaves()
|
self.validate_balance_leaves()
|
||||||
self.validate_leave_overlap()
|
self.validate_leave_overlap()
|
||||||
@@ -41,8 +39,8 @@ class DocType(DocListController):
|
|||||||
self.validate_block_days()
|
self.validate_block_days()
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
if (not self.previous_doc and self.doc.leave_approver) or (self.doc.status == "Open" \
|
if (not self.previous_doc and self.doc.leave_approver) or (self.previous_doc and \
|
||||||
and self.previous_doc.leave_approver != self.doc.leave_approver):
|
self.doc.status == "Open" and self.previous_doc.leave_approver != self.doc.leave_approver):
|
||||||
# notify leave approver about creation
|
# notify leave approver about creation
|
||||||
self.notify_leave_approver()
|
self.notify_leave_approver()
|
||||||
elif self.previous_doc and \
|
elif self.previous_doc and \
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"creation": "2013-02-18 13:36:20",
|
"creation": "2013-02-18 17:08:32",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-02-18 16:59:53",
|
"modified": "2013-02-18 17:20:23",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_import": 1,
|
||||||
"autoname": "LAP/.#####",
|
"autoname": "LAP/.#####",
|
||||||
"description": "Apply / Approve Leaves",
|
"description": "Apply / Approve Leaves",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
|
|||||||
Reference in New Issue
Block a user