color field for calendar in leave application
This commit is contained in:
parent
a7b2fc9250
commit
9c688f6dbf
@ -689,6 +689,37 @@
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"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,
|
||||
@ -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",
|
||||
|
@ -382,7 +382,6 @@ def get_events(start, end, filters=None):
|
||||
|
||||
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 @@ def add_department_leaves(events, start, end, employee, company):
|
||||
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 @@ def add_leaves(events, start, end, match_conditions=None):
|
||||
"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)
|
||||
|
@ -7,7 +7,8 @@ frappe.views.calendar["Leave Application"] = {
|
||||
"end": "to_date",
|
||||
"id": "name",
|
||||
"title": "title",
|
||||
"docstatus": 1
|
||||
"docstatus": 1,
|
||||
"color": "_color"
|
||||
},
|
||||
options: {
|
||||
header: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user