Merge pull request #14154 from rohitwaghchaure/set_default_leave_approver
Set leave approver in the leave application
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 15a93bd..bc18d77 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -157,9 +157,10 @@
# scan description only if items are less than 50000
description_cond = 'or tabItem.description LIKE %(txt)s'
- return frappe.db.sql("""select tabItem.name, tabItem.item_group,
+ return frappe.db.sql("""select tabItem.name,
if(length(tabItem.item_name) > 40,
concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name,
+ tabItem.item_group,
if(length(tabItem.description) > 40, \
concat(substr(tabItem.description, 1, 40), "..."), description) as decription
from tabItem
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index 83079d4..f40b442 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -116,7 +116,7 @@
frappe.db.sql("""update `tabAttendance` set status = %s, leave_type = %s\
where name = %s""",(status, self.leave_type, d.name))
- elif self.from_date <= nowdate():
+ elif self.to_date <= nowdate():
for dt in daterange(getdate(self.from_date), getdate(self.to_date)):
date = dt.strftime("%Y-%m-%d")
if not date == self.half_day_date:
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 44b0c00..060218d 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -266,6 +266,7 @@
task_doc.append('depends_on', {"task": dt_name})
task_doc.save()
+@frappe.whitelist()
def get_timeline_data(doctype, name):
'''Return timeline for attendance'''
return dict(frappe.db.sql('''select unix_timestamp(from_time), count(*)
diff --git a/erpnext/projects/doctype/project/project_dashboard.py b/erpnext/projects/doctype/project/project_dashboard.py
index 0ac7d6f..be33c9d 100644
--- a/erpnext/projects/doctype/project/project_dashboard.py
+++ b/erpnext/projects/doctype/project/project_dashboard.py
@@ -4,6 +4,7 @@
return {
'heatmap': True,
'heatmap_message': _('This is based on the Time Sheets created against this project'),
+ 'method' : 'erpnext.projects.doctype.project.project.get_timeline_data',
'fieldname': 'project',
'transactions': [
{
diff --git a/erpnext/stock/doctype/warehouse/warehouse.js b/erpnext/stock/doctype/warehouse/warehouse.js
index 1bfa416..1bea00e 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.js
+++ b/erpnext/stock/doctype/warehouse/warehouse.js
@@ -39,6 +39,8 @@
frm.toggle_enable(['is_group', 'company'], false);
+ frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Warehouse'};
+
frm.fields_dict['parent_warehouse'].get_query = function(doc) {
return {
filters: {