Minor fixes
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index f220d78..424da90 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -233,9 +233,9 @@
holiday_list = frappe.get_doc(dict(
doctype = 'Holiday List',
- name = 'test holiday list for optional holiday'
+ name = 'test holiday list for optional holiday',
from_date = year_start_date(),
- from_date = year_end_date()
+ to_date = year_end_date(),
holidays = [
dict(holiday_date = today, description = 'test')
]
@@ -276,12 +276,15 @@
def test_leaves_allowed(self):
# TODO: test cannot allocate more than max leaves
+ pass
def test_applicable_after(self):
# TODO: test not applicable until applicable working days
+ pass
def test_max_continuous_leaves(self):
# TODO: test cannot take continuous leaves more than
+ pass
def test_earned_leave(self):
leave_period = get_leave_period()
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
index e5188c3..c9269d7 100644
--- a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
+++ b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
@@ -12,24 +12,24 @@
def validate(self):
self.validate_dates()
- def validate_date(self):
+ def validate_dates(self):
joining_date, relieving_date = frappe.db.get_value("Employee", self.employee,
["date_of_joining", "relieving_date"])
if self.from_date:
if joining_date and getdate(self.from_date) < joining_date:
- frappe.throw(_("From Date {0} cannot be before employee's joining Date {2}")
+ frappe.throw(_("From Date {0} cannot be before employee's joining Date {1}")
.format(self.from_date, joining_date))
if relieving_date and getdate(self.from_date) > relieving_date:
- frappe.throw(_("From Date {0} cannot be after employee's relieving Date {2}")
+ frappe.throw(_("From Date {0} cannot be after employee's relieving Date {1}")
.format(self.from_date, relieving_date))
if self.to_date:
- if self.from_date and getdate(self.from_date) < getdate(self.to_date):
- frappe.throw(_("From Date {0} cannot be before To Date {2}")
+ if self.from_date and getdate(self.from_date) > getdate(self.to_date):
+ frappe.throw(_("From Date {0} cannot be after To Date {1}")
.format(self.from_date, self.to_date))
if relieving_date and getdate(self.to_date) > relieving_date:
- frappe.throw(_("To Date {0} cannot be after employee's relieving Date {2}")
+ frappe.throw(_("To Date {0} cannot be after employee's relieving Date {1}")
.format(self.to_date, relieving_date))
def validate_duplicate_assignments(self):
diff --git a/erpnext/patches/v11_0/create_salary_structure_assignments.py b/erpnext/patches/v11_0/create_salary_structure_assignments.py
index e321db6..fc3a431 100644
--- a/erpnext/patches/v11_0/create_salary_structure_assignments.py
+++ b/erpnext/patches/v11_0/create_salary_structure_assignments.py
@@ -7,9 +7,9 @@
def execute():
frappe.reload_doc("hr", "doctype", "salary_structure_assignment")
for d in frappe.db.sql("""
- select * from `tabSalary Structure Employee` sse, `tabSalary Structure` ss
+ select sse.*, ss.company from `tabSalary Structure Employee` sse, `tabSalary Structure` ss
where ss.name = sse.parent""", as_dict=1):
-
+ print(d)
s = frappe.new_doc("Salary Structure Assignment")
s.employee = d.employee
s.employee_name = d.employee_name