From 4c8a08effbac2dd7a9b95d57a17e7c8ecfc7f339 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 29 Apr 2018 12:11:36 +0530 Subject: [PATCH 1/7] color field for calendar in course schedule --- erpnext/education/api.py | 2 +- .../course_schedule/course_schedule.json | 47 ++++++++++++++++++- .../course_schedule_calendar.js | 3 +- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/erpnext/education/api.py b/erpnext/education/api.py index 5edc0378e16..ef1cc46f2f5 100644 --- a/erpnext/education/api.py +++ b/erpnext/education/api.py @@ -189,7 +189,7 @@ def get_course_schedule_events(start, end, filters=None): from frappe.desk.calendar import get_event_conditions conditions = get_event_conditions("Course Schedule", filters) - data = frappe.db.sql("""select name, course, + data = frappe.db.sql("""select name, course, _color, timestamp(schedule_date, from_time) as from_datetime, timestamp(schedule_date, to_time) as to_datetime, room, student_group, 0 as 'allDay' diff --git a/erpnext/education/doctype/course_schedule/course_schedule.json b/erpnext/education/doctype/course_schedule/course_schedule.json index 9049a80bd9d..82128712165 100644 --- a/erpnext/education/doctype/course_schedule/course_schedule.json +++ b/erpnext/education/doctype/course_schedule/course_schedule.json @@ -42,6 +42,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -73,6 +74,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -104,6 +106,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -133,6 +136,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -165,6 +169,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 1, + "translatable": 0, "unique": 0 }, { @@ -196,6 +201,38 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "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 }, { @@ -225,6 +262,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -256,6 +294,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -287,6 +326,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -316,6 +356,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -346,6 +387,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -376,6 +418,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -406,6 +449,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -420,7 +464,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-11-10 19:10:28.797143", + "modified": "2018-04-29 12:02:31.960104", "modified_by": "Administrator", "module": "Education", "name": "Course Schedule", @@ -429,7 +473,6 @@ "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, diff --git a/erpnext/education/doctype/course_schedule/course_schedule_calendar.js b/erpnext/education/doctype/course_schedule/course_schedule_calendar.js index 803527e5480..09c441d0040 100644 --- a/erpnext/education/doctype/course_schedule/course_schedule_calendar.js +++ b/erpnext/education/doctype/course_schedule/course_schedule_calendar.js @@ -5,7 +5,8 @@ frappe.views.calendar["Course Schedule"] = { "end": "to_datetime", "id": "name", "title": "course", - "allDay": "allDay" + "allDay": "allDay", + "color": "_color" }, gantt: false, order_by: "schedule_date", From d71c0c1720d25581f72ad9ae4013f9492a3bed14 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 29 Apr 2018 12:12:03 +0530 Subject: [PATCH 2/7] color field for calendar in holiday list --- .../hr/doctype/holiday_list/holiday_list.json | 91 ++++++++++++++++++- .../hr/doctype/holiday_list/holiday_list.py | 3 +- .../holiday_list/holiday_list_calendar.js | 3 +- 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.json b/erpnext/hr/doctype/holiday_list/holiday_list.json index 6b71ffcd1ef..314a0ea9ceb 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.json +++ b/erpnext/hr/doctype/holiday_list/holiday_list.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, "autoname": "field:holiday_list_name", @@ -13,6 +14,7 @@ "engine": "InnoDB", "fields": [ { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -23,6 +25,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, "label": "Holiday List Name", @@ -39,9 +42,11 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -52,6 +57,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "label": "From Date", @@ -67,9 +73,11 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -80,6 +88,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "label": "To Date", @@ -95,9 +104,11 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -108,6 +119,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 1, "label": "Weekly Off", @@ -123,9 +135,11 @@ "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, @@ -136,6 +150,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "label": "Get Weekly Off Dates", @@ -151,9 +166,11 @@ "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, @@ -164,6 +181,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "label": "Holidays", @@ -181,9 +199,11 @@ "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, @@ -194,6 +214,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "label": "Clear Table", @@ -209,21 +230,83 @@ "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, + "columns": 0, + "fieldname": "section_break_9", + "fieldtype": "Section Break", + "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, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "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, + "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 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-calendar", "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-11-07 05:31:24.729126", + "modified": "2018-04-27 17:16:37.720416", "modified_by": "Administrator", "module": "HR", "name": "Holiday List", @@ -231,7 +314,6 @@ "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, @@ -239,7 +321,6 @@ "export": 0, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -254,7 +335,9 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, + "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 17d0a91b240..b668719b94c 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -78,8 +78,7 @@ def get_events(start, end, filters=None): filters.append(['Holiday', 'holiday_date', '>', getdate(start)]) if end: filters.append(['Holiday', 'holiday_date', '<', getdate(end)]) - return frappe.get_list('Holiday List', - fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description'], + fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`._color'], filters = filters, update={"allDay": 1}) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js index 507d070444b..7ac0b6b0b28 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js +++ b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js @@ -7,7 +7,8 @@ frappe.views.calendar["Holiday List"] = { "end": "to_date", "id": "name", "title": "description", - "allDay": "allDay" + "allDay": "allDay", + "color": "_color" }, get_events_method: "erpnext.hr.doctype.holiday_list.holiday_list.get_events", filters: [ From 62907472f3c8e770a90ea8a00e7a0f61b19e5419 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 29 Apr 2018 12:12:30 +0530 Subject: [PATCH 3/7] color field for calendar in task --- erpnext/projects/doctype/task/task.json | 72 ++++++++++++++++++- .../projects/doctype/task/task_calendar.js | 3 +- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json index 8e72d0339e7..fd80d5ed680 100644 --- a/erpnext/projects/doctype/task/task.json +++ b/erpnext/projects/doctype/task/task.json @@ -40,6 +40,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -72,6 +73,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -103,6 +105,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -133,6 +136,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, @@ -166,6 +170,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -198,6 +203,7 @@ "reqd": 0, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -229,6 +235,7 @@ "reqd": 0, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -260,6 +267,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -292,6 +300,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -326,6 +335,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -357,6 +367,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -386,6 +397,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -418,6 +430,7 @@ "reqd": 0, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -449,6 +462,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -480,6 +494,38 @@ "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, + "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": 0, + "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 }, { @@ -512,6 +558,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -545,6 +592,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "300px" }, @@ -578,6 +626,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -610,6 +659,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -641,6 +691,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -675,6 +726,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, @@ -708,6 +760,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -742,6 +795,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -771,6 +825,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -803,6 +858,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -833,6 +889,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -866,6 +923,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -898,6 +956,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -927,6 +986,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -958,6 +1018,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -987,6 +1048,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1019,6 +1081,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1051,6 +1114,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1079,6 +1143,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1109,6 +1174,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1139,6 +1205,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1169,6 +1236,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1199,6 +1267,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -1214,7 +1283,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2017-11-10 18:37:19.660293", + "modified": "2018-04-27 16:31:41.490545", "modified_by": "Administrator", "module": "Projects", "name": "Task", @@ -1222,7 +1291,6 @@ "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, diff --git a/erpnext/projects/doctype/task/task_calendar.js b/erpnext/projects/doctype/task/task_calendar.js index 49dbb76a1a5..a21672317b8 100644 --- a/erpnext/projects/doctype/task/task_calendar.js +++ b/erpnext/projects/doctype/task/task_calendar.js @@ -8,7 +8,8 @@ frappe.views.calendar["Task"] = { "id": "name", "title": "subject", "allDay": "allDay", - "progress": "progress" + "progress": "progress", + "color": "_color" }, gantt: true, filters: [ From a7b2fc9250bea57fdb7590b2afb2f99a7cc22ec3 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 29 Apr 2018 12:13:09 +0530 Subject: [PATCH 4/7] color field for calendar in sales order and work order --- .../doctype/work_order/work_order.json | 35 +++++++++++++++++-- .../doctype/work_order/work_order_calendar.js | 1 + .../doctype/sales_order/sales_order.json | 10 ++---- .../doctype/sales_order/sales_order.py | 2 +- .../sales_order/sales_order_calendar.js | 3 +- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.json b/erpnext/manufacturing/doctype/work_order/work_order.json index e6bdc26a78d..6ce53ca02f3 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.json +++ b/erpnext/manufacturing/doctype/work_order/work_order.json @@ -1481,6 +1481,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, @@ -1526,7 +1557,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-03-05 12:43:10.442928", + "modified": "2018-04-27 16:48:31.251817", "modified_by": "Administrator", "module": "Manufacturing", "name": "Work Order", @@ -1534,7 +1565,6 @@ "permissions": [ { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -1554,7 +1584,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, diff --git a/erpnext/manufacturing/doctype/work_order/work_order_calendar.js b/erpnext/manufacturing/doctype/work_order/work_order_calendar.js index c44b1e2700d..fb444c94e98 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order_calendar.js +++ b/erpnext/manufacturing/doctype/work_order/work_order_calendar.js @@ -7,6 +7,7 @@ frappe.views.calendar["Work Order"] = { "end": "planned_end_date", "id": "name", "title": "name", + "color": "_color", "allDay": "allDay", "progress": function(data) { return flt(data.produced_qty) / data.qty * 100; diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 221eca78ff6..303ff9a1a31 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -2825,9 +2825,9 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "translatable": 0, + "translatable": 0, "unique": 0 - }, + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -3650,7 +3650,6 @@ "permissions": [ { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -3670,7 +3669,6 @@ }, { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -3690,7 +3688,6 @@ }, { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -3710,7 +3707,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, @@ -3730,7 +3726,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, @@ -3750,7 +3745,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 4ac29fde153..a96e3a55be9 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -662,7 +662,7 @@ def get_events(start, end, filters=None): data = frappe.db.sql(""" select distinct `tabSales Order`.name, `tabSales Order`.customer_name, `tabSales Order`.status, - `tabSales Order`.delivery_status, `tabSales Order`.billing_status, + `tabSales Order`.delivery_status, `tabSales Order`.billing_status, `tabSales Order`._color, `tabSales Order Item`.delivery_date from `tabSales Order`, `tabSales Order Item` diff --git a/erpnext/selling/doctype/sales_order/sales_order_calendar.js b/erpnext/selling/doctype/sales_order/sales_order_calendar.js index cb412cfb4a7..67c7ba35dca 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_calendar.js +++ b/erpnext/selling/doctype/sales_order/sales_order_calendar.js @@ -7,7 +7,8 @@ frappe.views.calendar["Sales Order"] = { "end": "delivery_date", "id": "name", "title": "customer_name", - "allDay": "allDay" + "allDay": "allDay", + "color": "_color" }, gantt: true, filters: [ From 9c688f6dbf71ce02a3426738577c1a21206e968e Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 29 Apr 2018 12:14:13 +0530 Subject: [PATCH 5/7] color field for calendar in leave application --- .../leave_application/leave_application.json | 33 ++++++++++++++++++- .../leave_application/leave_application.py | 6 ++-- .../leave_application_calendar.js | 3 +- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index d657ec4b9b8..24f2dc67e34 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -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", diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index df554e85a5a..eca858b8468 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -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) diff --git a/erpnext/hr/doctype/leave_application/leave_application_calendar.js b/erpnext/hr/doctype/leave_application/leave_application_calendar.js index 0286f300646..3fbf42a182d 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 @@ frappe.views.calendar["Leave Application"] = { "end": "to_date", "id": "name", "title": "title", - "docstatus": 1 + "docstatus": 1, + "color": "_color" }, options: { header: { From fd47b921380ae95f1e3718b1671d510476aaabba Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 30 Apr 2018 13:58:17 +0530 Subject: [PATCH 6/7] renamed color field --- erpnext/education/api.py | 2 +- .../education/doctype/course_schedule/course_schedule.json | 4 ++-- .../doctype/course_schedule/course_schedule_calendar.js | 3 +-- erpnext/hr/doctype/holiday_list/holiday_list.json | 4 ++-- erpnext/hr/doctype/holiday_list/holiday_list.py | 2 +- erpnext/hr/doctype/holiday_list/holiday_list_calendar.js | 2 +- erpnext/hr/doctype/leave_application/leave_application.json | 4 ++-- erpnext/hr/doctype/leave_application/leave_application.py | 6 +++--- .../doctype/leave_application/leave_application_calendar.js | 5 ++--- erpnext/projects/doctype/task/task.json | 4 ++-- erpnext/projects/doctype/task/task_calendar.js | 3 +-- 11 files changed, 18 insertions(+), 21 deletions(-) diff --git a/erpnext/education/api.py b/erpnext/education/api.py index ef1cc46f2f5..8571bf9381b 100644 --- a/erpnext/education/api.py +++ b/erpnext/education/api.py @@ -189,7 +189,7 @@ def get_course_schedule_events(start, end, filters=None): from frappe.desk.calendar import get_event_conditions conditions = get_event_conditions("Course Schedule", filters) - data = frappe.db.sql("""select name, course, _color, + data = frappe.db.sql("""select name, course, color, timestamp(schedule_date, from_time) as from_datetime, timestamp(schedule_date, to_time) as to_datetime, room, student_group, 0 as 'allDay' diff --git a/erpnext/education/doctype/course_schedule/course_schedule.json b/erpnext/education/doctype/course_schedule/course_schedule.json index 82128712165..9b7d89794c6 100644 --- a/erpnext/education/doctype/course_schedule/course_schedule.json +++ b/erpnext/education/doctype/course_schedule/course_schedule.json @@ -210,7 +210,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "_color", + "fieldname": "color", "fieldtype": "Color", "hidden": 0, "ignore_user_permissions": 0, @@ -464,7 +464,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-04-29 12:02:31.960104", + "modified": "2018-04-30 12:49:51.094872", "modified_by": "Administrator", "module": "Education", "name": "Course Schedule", diff --git a/erpnext/education/doctype/course_schedule/course_schedule_calendar.js b/erpnext/education/doctype/course_schedule/course_schedule_calendar.js index 09c441d0040..803527e5480 100644 --- a/erpnext/education/doctype/course_schedule/course_schedule_calendar.js +++ b/erpnext/education/doctype/course_schedule/course_schedule_calendar.js @@ -5,8 +5,7 @@ frappe.views.calendar["Course Schedule"] = { "end": "to_datetime", "id": "name", "title": "course", - "allDay": "allDay", - "color": "_color" + "allDay": "allDay" }, gantt: false, order_by: "schedule_date", diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.json b/erpnext/hr/doctype/holiday_list/holiday_list.json index 314a0ea9ceb..f417cb2b71b 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.json +++ b/erpnext/hr/doctype/holiday_list/holiday_list.json @@ -269,7 +269,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "_color", + "fieldname": "color", "fieldtype": "Color", "hidden": 0, "ignore_user_permissions": 0, @@ -306,7 +306,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-04-27 17:16:37.720416", + "modified": "2018-04-30 12:49:59.239227", "modified_by": "Administrator", "module": "HR", "name": "Holiday List", diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index b668719b94c..269195957a8 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -79,6 +79,6 @@ def get_events(start, end, filters=None): if end: filters.append(['Holiday', 'holiday_date', '<', getdate(end)]) return frappe.get_list('Holiday List', - fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`._color'], + fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'], filters = filters, update={"allDay": 1}) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js index 7ac0b6b0b28..8f4dc284414 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js +++ b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js @@ -8,7 +8,7 @@ frappe.views.calendar["Holiday List"] = { "id": "name", "title": "description", "allDay": "allDay", - "color": "_color" + "color": "color" }, get_events_method: "erpnext.hr.doctype.holiday_list.holiday_list.get_events", filters: [ diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index 24f2dc67e34..290120b5bfd 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -695,7 +695,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "_color", + "fieldname": "color", "fieldtype": "Color", "hidden": 0, "ignore_user_permissions": 0, @@ -854,7 +854,7 @@ "issingle": 0, "istable": 0, "max_attachments": 3, - "modified": "2018-04-27 17:37:43.021792", + "modified": "2018-04-30 12:49:40.845022", "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 eca858b8468..6ad8b7efcac 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -407,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, _color, 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 @@ -421,8 +421,8 @@ 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, + "docstatus": d.docstatus, + "color": d.color, "title": cstr(d.employee_name) + \ (d.half_day and _(" (Half Day)") or ""), } diff --git a/erpnext/hr/doctype/leave_application/leave_application_calendar.js b/erpnext/hr/doctype/leave_application/leave_application_calendar.js index 3fbf42a182d..0e0d8645fa4 100644 --- a/erpnext/hr/doctype/leave_application/leave_application_calendar.js +++ b/erpnext/hr/doctype/leave_application/leave_application_calendar.js @@ -7,8 +7,7 @@ frappe.views.calendar["Leave Application"] = { "end": "to_date", "id": "name", "title": "title", - "docstatus": 1, - "color": "_color" + "docstatus": 1 }, options: { header: { @@ -16,6 +15,6 @@ frappe.views.calendar["Leave Application"] = { center: 'title', right: 'month' } - }, + }, get_events_method: "erpnext.hr.doctype.leave_application.leave_application.get_events" } \ No newline at end of file diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json index fd80d5ed680..ee93bcc7404 100644 --- a/erpnext/projects/doctype/task/task.json +++ b/erpnext/projects/doctype/task/task.json @@ -503,7 +503,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "_color", + "fieldname": "color", "fieldtype": "Color", "hidden": 0, "ignore_user_permissions": 0, @@ -1283,7 +1283,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2018-04-27 16:31:41.490545", + "modified": "2018-04-30 12:48:52.743838", "modified_by": "Administrator", "module": "Projects", "name": "Task", diff --git a/erpnext/projects/doctype/task/task_calendar.js b/erpnext/projects/doctype/task/task_calendar.js index a21672317b8..49dbb76a1a5 100644 --- a/erpnext/projects/doctype/task/task_calendar.js +++ b/erpnext/projects/doctype/task/task_calendar.js @@ -8,8 +8,7 @@ frappe.views.calendar["Task"] = { "id": "name", "title": "subject", "allDay": "allDay", - "progress": "progress", - "color": "_color" + "progress": "progress" }, gantt: true, filters: [ From eb54331d5f91b200e001774f798ff7fc2e87df49 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 30 Apr 2018 13:58:44 +0530 Subject: [PATCH 7/7] removed color field from sales order and work order --- .../holiday_list/holiday_list_calendar.js | 3 +- .../leave_application/leave_application.py | 2 +- .../leave_application_calendar.js | 2 +- .../doctype/work_order/work_order.json | 33 +------------------ .../doctype/work_order/work_order_calendar.js | 1 - .../doctype/sales_order/sales_order.json | 2 +- .../doctype/sales_order/sales_order.py | 2 +- .../sales_order/sales_order_calendar.js | 3 +- 8 files changed, 7 insertions(+), 41 deletions(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js index 8f4dc284414..507d070444b 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js +++ b/erpnext/hr/doctype/holiday_list/holiday_list_calendar.js @@ -7,8 +7,7 @@ frappe.views.calendar["Holiday List"] = { "end": "to_date", "id": "name", "title": "description", - "allDay": "allDay", - "color": "color" + "allDay": "allDay" }, get_events_method: "erpnext.hr.doctype.holiday_list.holiday_list.get_events", filters: [ diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 6ad8b7efcac..4231cc24246 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -421,7 +421,7 @@ 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, + "docstatus": d.docstatus, "color": d.color, "title": cstr(d.employee_name) + \ (d.half_day and _(" (Half Day)") or ""), diff --git a/erpnext/hr/doctype/leave_application/leave_application_calendar.js b/erpnext/hr/doctype/leave_application/leave_application_calendar.js index 0e0d8645fa4..0286f300646 100644 --- a/erpnext/hr/doctype/leave_application/leave_application_calendar.js +++ b/erpnext/hr/doctype/leave_application/leave_application_calendar.js @@ -15,6 +15,6 @@ frappe.views.calendar["Leave Application"] = { center: 'title', right: 'month' } - }, + }, get_events_method: "erpnext.hr.doctype.leave_application.leave_application.get_events" } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/work_order/work_order.json b/erpnext/manufacturing/doctype/work_order/work_order.json index 6ce53ca02f3..1cc2459ab26 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.json +++ b/erpnext/manufacturing/doctype/work_order/work_order.json @@ -1481,37 +1481,6 @@ "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, @@ -1557,7 +1526,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-04-27 16:48:31.251817", + "modified": "2018-04-30 12:49:21.211740", "modified_by": "Administrator", "module": "Manufacturing", "name": "Work Order", diff --git a/erpnext/manufacturing/doctype/work_order/work_order_calendar.js b/erpnext/manufacturing/doctype/work_order/work_order_calendar.js index fb444c94e98..c44b1e2700d 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order_calendar.js +++ b/erpnext/manufacturing/doctype/work_order/work_order_calendar.js @@ -7,7 +7,6 @@ frappe.views.calendar["Work Order"] = { "end": "planned_end_date", "id": "name", "title": "name", - "color": "_color", "allDay": "allDay", "progress": function(data) { return flt(data.produced_qty) / data.qty * 100; diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 303ff9a1a31..ea1b573e698 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -3642,7 +3642,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-03-10 07:35:33.258624", + "modified": "2018-04-30 12:49:10.225292", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order", diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index a96e3a55be9..4ac29fde153 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -662,7 +662,7 @@ def get_events(start, end, filters=None): data = frappe.db.sql(""" select distinct `tabSales Order`.name, `tabSales Order`.customer_name, `tabSales Order`.status, - `tabSales Order`.delivery_status, `tabSales Order`.billing_status, `tabSales Order`._color, + `tabSales Order`.delivery_status, `tabSales Order`.billing_status, `tabSales Order Item`.delivery_date from `tabSales Order`, `tabSales Order Item` diff --git a/erpnext/selling/doctype/sales_order/sales_order_calendar.js b/erpnext/selling/doctype/sales_order/sales_order_calendar.js index 67c7ba35dca..cb412cfb4a7 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_calendar.js +++ b/erpnext/selling/doctype/sales_order/sales_order_calendar.js @@ -7,8 +7,7 @@ frappe.views.calendar["Sales Order"] = { "end": "delivery_date", "id": "name", "title": "customer_name", - "allDay": "allDay", - "color": "_color" + "allDay": "allDay" }, gantt: true, filters: [