From e6dd55d9f2e612d8bf09f4bc9890da5ec69f8d90 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 3 Jun 2019 17:48:39 +0530 Subject: [PATCH 1/3] feat: dashboards for HR module --- .../appraisal_template_dashboard.py | 12 ++++++++ .../hr/doctype/employee/employee_dashboard.py | 22 +++++++++----- .../employee_onboarding_template_dashboard.py | 12 ++++++++ .../employee_separation_template_dashboard.py | 12 ++++++++ .../holiday_list/holiday_list_dashboard.py | 3 ++ .../job_applicant/job_applicant_dashboard.py | 16 ++++++++++ .../job_opening/job_opening_dashboard.py | 12 ++++++++ .../leave_allocation_dashboard.py | 15 ++++++++++ .../loan_application_dashboard.py | 12 ++++++++ .../doctype/loan_type/loan_type_dashboard.py | 12 ++++++++ .../payroll_period_dashboard.py | 13 ++++++++ .../salary_structure_dashboard.py | 10 +++++-- .../shift_request/shift_request_dashboard.py | 12 ++++++++ .../shift_type/shift_type_dashboard.py | 12 ++++++++ .../staffing_plan/staffing_plan_dashboard.py | 12 ++++++++ .../training_event_dashboard.py | 13 ++++++++ .../hr/doctype/vehicle/vehicle_dashboard.py | 30 ++++++++++++------- 17 files changed, 210 insertions(+), 20 deletions(-) create mode 100644 erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py create mode 100644 erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py create mode 100644 erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py create mode 100644 erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py create mode 100644 erpnext/hr/doctype/job_opening/job_opening_dashboard.py create mode 100644 erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py create mode 100644 erpnext/hr/doctype/loan_application/loan_application_dashboard.py create mode 100644 erpnext/hr/doctype/loan_type/loan_type_dashboard.py create mode 100644 erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py create mode 100644 erpnext/hr/doctype/shift_request/shift_request_dashboard.py create mode 100644 erpnext/hr/doctype/shift_type/shift_type_dashboard.py create mode 100644 erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py create mode 100644 erpnext/hr/doctype/training_event/training_event_dashboard.py diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py new file mode 100644 index 0000000000..309427e30c --- /dev/null +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'kra_template', + 'transactions': [ + { + 'items': ['Appraisal'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index 46461da1a5..14fa466845 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -13,23 +13,31 @@ def get_data(): }, { 'label': _('Payroll'), - 'items': ['Salary Structure Assignment', 'Salary Slip', 'Timesheet'] + 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet'] + }, + { + 'label': _('Shift'), + 'items': ['Shift Request', 'Shift Assignment'] }, { 'label': _('Expense'), - 'items': ['Expense Claim'] + 'items': ['Expense Claim', 'Travel Request'] }, { 'label': _('Evaluation'), 'items': ['Appraisal'] }, - { - 'label': _('Training'), - 'items': ['Training Event', 'Training Result'] - }, { 'label': _('Lifecycle'), 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] - } + }, + { + 'label': _('Benefit'), + 'items': ['Employee Incentive', 'Retention Bonus','Employee Benefit Application', 'Employee Benefit Claim'] + }, + { + 'label': _('Training'), + 'items': ['Training Event', 'Training Result', 'Training Feedback', 'Employee Skill Map'] + }, ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py new file mode 100644 index 0000000000..837da53016 --- /dev/null +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'employee_onboarding_template', + 'transactions': [ + { + 'items': ['Employee Onboarding'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py new file mode 100644 index 0000000000..39345f0766 --- /dev/null +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'employee_separation_template', + 'transactions': [ + { + 'items': ['Employee Separation'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py index d1599a4f47..22e1de0c34 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py @@ -13,6 +13,9 @@ def get_data(): }, { 'items': ['Leave Period', 'Shift Type'] + }, + { + 'items': ['Service Level', 'Service Level Agreement'] } ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py new file mode 100644 index 0000000000..2478a6395a --- /dev/null +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -0,0 +1,16 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'job_applicant', + 'transactions': [ + { + 'label': _('Employee'), + 'items': ['Employee', 'Employee Onboarding'] + }, + { + 'items': ['Job Offer'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py new file mode 100644 index 0000000000..c0890b4f57 --- /dev/null +++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'job_title', + 'transactions': [ + { + 'items': ['Job Applicant'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py new file mode 100644 index 0000000000..72a1b7c194 --- /dev/null +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py @@ -0,0 +1,15 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'leave_allocation', + 'transactions': [ + { + 'items': ['Compensatory Leave Request'] + }, + { + 'items': ['Leave Encashment'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/loan_application/loan_application_dashboard.py b/erpnext/hr/doctype/loan_application/loan_application_dashboard.py new file mode 100644 index 0000000000..232c6e3c5b --- /dev/null +++ b/erpnext/hr/doctype/loan_application/loan_application_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'loan_application', + 'transactions': [ + { + 'items': ['Loan'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/loan_type/loan_type_dashboard.py b/erpnext/hr/doctype/loan_type/loan_type_dashboard.py new file mode 100644 index 0000000000..07b11fe627 --- /dev/null +++ b/erpnext/hr/doctype/loan_type/loan_type_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'loan_type', + 'transactions': [ + { + 'items': ['Loan Application'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py new file mode 100644 index 0000000000..d524861e4b --- /dev/null +++ b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'payroll_period', + 'transactions': [ + { + 'label': _('Employee Tax Exemption'), + 'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py index 3803c1d3ea..547f2b81be 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py @@ -4,9 +4,15 @@ from frappe import _ def get_data(): return { 'fieldname': 'salary_structure', + 'non_standard_fieldnames': { + 'Employee Grade': 'default_salary_structure' + }, 'transactions': [ { - 'items': ['Salary Structure Assignment'] - } + 'items': ['Salary Structure Assignment', 'Salary Slip'] + }, + { + 'items': ['Employee Grade'] + }, ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py new file mode 100644 index 0000000000..e3bf5df949 --- /dev/null +++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'shift_request', + 'transactions': [ + { + 'items': ['Shift Assignment'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py new file mode 100644 index 0000000000..91dfbad7b1 --- /dev/null +++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'shift_type', + 'transactions': [ + { + 'items': ['Shift Request', 'Shift Assignment'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py new file mode 100644 index 0000000000..35a303f0fb --- /dev/null +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'staffing_plan', + 'transactions': [ + { + 'items': ['Job Opening'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py new file mode 100644 index 0000000000..663832d45f --- /dev/null +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'training_event', + 'transactions': [ + { + 'label': _('Result And Feedback'), + 'items': ['Training Result', 'Training Feedback'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index d27c7ac009..00f1baf859 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -1,14 +1,22 @@ from __future__ import unicode_literals from frappe import _ -data = { - 'heatmap': True, - 'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'), - 'fieldname': 'license_plate', - 'transactions': [ - { - 'label': _('Logs'), - 'items': ['Vehicle Log'] - } - ] -} \ No newline at end of file +def get_data(): + return { + 'heatmap': True, + 'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'), + 'fieldname': 'license_plate', + 'non_standard_fieldnames':{ + 'Delivery Trip': 'vehicle' + }, + 'transactions': [ + { + 'label': _('Logs'), + 'items': ['Vehicle Log'] + }, + { + 'label': _('Trip'), + 'items': ['Delivery Trip'] + } + ] + } \ No newline at end of file From 0ae6cbdd01dd155b8d5fefef9dd7ad9e17309ca5 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 13 Jun 2019 19:47:11 +0530 Subject: [PATCH 2/3] fix: requested Changes --- erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py | 1 - erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py | 1 - erpnext/hr/doctype/training_event/training_event_dashboard.py | 1 - erpnext/hr/doctype/vehicle/vehicle_dashboard.py | 2 -- 4 files changed, 5 deletions(-) diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py index 2478a6395a..7f131151e1 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'job_applicant', 'transactions': [ { - 'label': _('Employee'), 'items': ['Employee', 'Employee Onboarding'] }, { diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py index d524861e4b..4e9c7c9e7c 100644 --- a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py +++ b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'payroll_period', 'transactions': [ { - 'label': _('Employee Tax Exemption'), 'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration'] }, ], diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py index 663832d45f..1c1645c766 100644 --- a/erpnext/hr/doctype/training_event/training_event_dashboard.py +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'training_event', 'transactions': [ { - 'label': _('Result And Feedback'), 'items': ['Training Result', 'Training Feedback'] }, ], diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index 00f1baf859..761c70182b 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -11,11 +11,9 @@ def get_data(): }, 'transactions': [ { - 'label': _('Logs'), 'items': ['Vehicle Log'] }, { - 'label': _('Trip'), 'items': ['Delivery Trip'] } ] From e87ebcaf046f9c70c5285f53b39e7b1aabea1ac4 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 14 Jun 2019 14:10:38 +0530 Subject: [PATCH 3/3] fix: upadated employee dashboard --- .../hr/doctype/employee/employee_dashboard.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index 14fa466845..e3cc33d142 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -12,8 +12,8 @@ def get_data(): 'items': ['Attendance', 'Attendance Request', 'Leave Application', 'Leave Allocation'] }, { - 'label': _('Payroll'), - 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet'] + 'label': _('Lifecycle'), + 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] }, { 'label': _('Shift'), @@ -23,17 +23,17 @@ def get_data(): 'label': _('Expense'), 'items': ['Expense Claim', 'Travel Request'] }, + { + 'label': _('Benefit'), + 'items': ['Employee Benefit Application', 'Employee Benefit Claim'] + }, { 'label': _('Evaluation'), 'items': ['Appraisal'] }, { - 'label': _('Lifecycle'), - 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] - }, - { - 'label': _('Benefit'), - 'items': ['Employee Incentive', 'Retention Bonus','Employee Benefit Application', 'Employee Benefit Claim'] + 'label': _('Payroll'), + 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet','Employee Incentive', 'Retention Bonus'] }, { 'label': _('Training'),