color field for calendar in leave application
diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json
index d657ec4..24f2dc6 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.json
+++ b/erpnext/hr/doctype/leave_application/leave_application.json
@@ -691,6 +691,37 @@
},
{
"allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "_color",
+ "fieldtype": "Color",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Color",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -823,7 +854,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
- "modified": "2018-04-16 09:46:44.650629",
+ "modified": "2018-04-27 17:37:43.021792",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Application",
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index df554e8..eca858b 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -382,7 +382,6 @@
from frappe.desk.reportview import get_filters_cond
conditions = get_filters_cond("Leave Application", filters, [])
-
# show department leaves for employee
if "Employee" in frappe.get_roles():
add_department_leaves(events, start, end, employee, company)
@@ -408,7 +407,7 @@
add_leaves(events, start, end, match_conditions=match_conditions)
def add_leaves(events, start, end, match_conditions=None):
- query = """select name, from_date, to_date, employee_name, half_day,
+ query = """select name, from_date, to_date, employee_name, _color, half_day,
employee, docstatus
from `tabLeave Application` where
from_date <= %(end)s and to_date >= %(start)s <= to_date
@@ -422,9 +421,10 @@
"doctype": "Leave Application",
"from_date": d.from_date,
"to_date": d.to_date,
+ "docstatus": d.docstatus,
+ "color": d._color,
"title": cstr(d.employee_name) + \
(d.half_day and _(" (Half Day)") or ""),
- "docstatus": d.docstatus
}
if e not in events:
events.append(e)
diff --git a/erpnext/hr/doctype/leave_application/leave_application_calendar.js b/erpnext/hr/doctype/leave_application/leave_application_calendar.js
index 0286f30..3fbf42a 100644
--- a/erpnext/hr/doctype/leave_application/leave_application_calendar.js
+++ b/erpnext/hr/doctype/leave_application/leave_application_calendar.js
@@ -7,7 +7,8 @@
"end": "to_date",
"id": "name",
"title": "title",
- "docstatus": 1
+ "docstatus": 1,
+ "color": "_color"
},
options: {
header: {