Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Remove HR and Payroll modules from ERPNext #31467

Merged
merged 58 commits into from Jul 20, 2022

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Jun 28, 2022

New App

HR & Payroll modules are now going to be a part of a new app https://github.com/frappe/hrms.
This app still depends on ERPNext.

Why not standalone?

Unlike other modules that were separated from the ERPNext core, HR and Payroll have a high dependency on the core. Some doctypes from HR are also widely used in the ERPNext core.

Separation Details

Generic

  • The following doctypes are used in ERPNext and hence they are moved from HR module to Setup module in ERPNext:

    • Employee 😢: used in Telephony, Stock, Quality, Projects, Manufacturing, Loans, Buying, Assets, Accounts, Dependent Apps: Healthcare
    • Holiday List: CRM (Appointment Booking), Projects, Healthcare, Support (SLA), Education (Student's Holiday List)
    • Branch: Selling (SMS Center), used widely as an accounting dimension
    • Department: Assets, Projects, SMS Center, used widely as an accounting dimension
    • Designation: Lead, Healthcare Practitioner, used in Employee master which will now be in core
    • Employee Group: Telephony, Communication
    • Child Tables for above doctypes: Employee Group Table (Employee Group), Employee Education (Employee), Employee External Work History (Employee), Employee Internal Work History (Employee), Holiday (Holiday List)
    • Driver, Vehicle, Driving License Category (child table): Delivery Trip
  • Fields in the above masters that are HR-specific have been removed and would be added as Custom Fields on the HRMS app setup: frappe/hrms@4d0aa1f, frappe/hrms@6a1caa7

    Fields
      Department
        1. payroll_cost_center
        2. leave_block_list
        3. approvers
        4. leave_approvers
        5. expense_approvers
        6. shift_request_approver
    
      Employee
      	1. employment_type
      	2. job_applicant
      	3. grade
      	4. default_shift
      	5. health_insurance_section
      	6. health_insurance_provider
      	7. health_insurance_no
    
  • References to HR/Payroll doctypes in other form dashboards has been removed. Its added in the HRMS app using override_doctype_dashboards hook: frappe/hrms@6f9ef74

  • Removed HR reports from other modules: frappe/hrms@da9f190

    • Project Profitability report: moved from Projects
    • Employee Hours Utilization Based on Timesheet: moved from Projects
    • Unpaid Expense Claims: moved from Accounts
  • HR field removed from the "Terms and Conditions" doctype. HR specific Email Templates and Notifications moved. User Type and Permission setup moved: frappe/hrms@c958762

  • Removed HR and Payroll links from ERPNext Workspaces

Regional

Moved HR/Payroll Code from the Regional module:

  • HRA Tax Exemption Calculation
  • Regional Setups
    • India: Region-specific custom fields, salary components, and gratuity rules
    • UAE: Gratuity Rules
  • Reports: Professional Tax Deduction and Provident Fund Deductions

frappe/hrms@7f6a194

Loan Management

  • Repay from Salary field removed from Loan, Loan Repayment. Will be added as a custom field on HRMS setup
  • Moved Salary Slip Loan child table to HRMS app
  • Fixed references to Salary Slip Loan and repay_from_salary in queries

frappe/hrms@428cb2d, frappe/hrms@00bbdae

Accounting

Removed HR/Payroll code from Payment Entry and Journal Entry:

  • Expense Claim
  • Employee Advance
  • Full and Final Statement
  • Gratuity

ERPNext: 1ff0e45, 0f83e7a
HRMS: frappe/hrms@69b9519, frappe/hrms@a9b2ba1

Projects

Delivery Trip

Testing Details

To Test
  1. ESS User Role is created and is able to access required doctypes
  2. The following reports were moved from other modules to HR. Check if they are working fine with some data:
    • Project Profitability report: moved from Projects
    • Employee Hours Utilization Based on Timesheet: moved from Projects
    • Unpaid Expense Claims: moved from Accounts
    • Professional Tax Deduction
    • Provident Fund Deductions
  3. Following dashboards are overridden with the HRMS app. Check if all links show up correctly and navigation is working:
    • Employee
    • Holiday List
    • Project
    • Timesheet
  4. Check if HRA Tax Exemption Calculation is working fine for an Indian company
  5. Test Repay from Salary flow in Loans.
  6. Payment Entry and Journal Entry against:
    • Employee Advance. Check if the status is changing properly on Payment submission/cancellation.
    • Expense Claim. Check if the status is changing to Paid/Unpaid (on cancellation) properly.
  7. Payment against Gratuity
  8. Create Salary Slip workflow against Timesheet
  9. Link Project to Expense Claim and test if the Total Expense Claim field gets updated properly whenever Expense Claim is created against a Project and Task.
  10. Expense Claim creation against Delivery Trip
  11. Bank Reconciliation for Expense Claim
  12. Check if Payroll Entry is working fine (start to end)

ToDo

  • Expense Claim in Bank Reconciliation Tool and Bank Transaction
  • HR and Payroll Settings in Company master
  • Vehicle, Driver masters from HR being used in Delivery Trip. Move to Setup module
  • Patches (patch: Add post install patches for backward compatibility hrms#3)
  • Review roles and permissions (keeping them as is since HR is still dependent on ERPNext)
  • Unit tests
  • Manual Testing

- Employee: used in Telephony, Stock, Quality, Projects, Manufacturing, Loans, Buying, Assets, Accounts, Dependent Apps: Healthcare

- Holiday List: CRM (Appointment Booking), Projects, Healthcare, Support (SLA), Education (Student's Holiday List)

- Branch: Selling (SMS Center), used widely as an accounting dimension

- Department: Assets, Projects, SMS Center, used widely as an accounting dimension

- Designation: Lead, Healthcare Practitioner, used in Employee master which will now be in core

- Employee Group: Telephony, Communication

- Child Tables for above dts: Employee Group Table (Employee Group), Employee Education (Employee), Employee External Work History (Employee), Employee Internal Work History (Employee), Designation Skill (Designation), Holiday (Holiday List)
- these will be added to the masters as custom fields on HRMS app setup
- change `erpnext.hr.EmployeeController` to `erpnext.setup.EmployeeController`
- moved to hrms hooks, will only be triggered if app is installed
- Moved to the HRMS app
- Fixtures moved to HRMS app

- 'HR' field in Terms and Conditions removed, added via HRMS setup
…ms app

- Salary Slip Loan dt moved to hrms, removed from erpnext app

- Repay from Salary field removed from Loan and Loan Repayment, installed on hrms app setup

- fixed references to salary slip loan fields
… code from accounting

- Added hooks `advance_payment_doctypes`, `invoice_doctypes`, `period_closing_doctypes` for other apps to extend accounting functionality

- Removed `set_query` code from `journal_entry.js` and `payment_entry.js`

- removed `update_status_for_full_and_final_statement` trigger on JE submission/cancellation

- refactored `payment_entry.py`: split functions for validating reference doctypes for easy overriding, removed hrms references from `get_reference_details` and `get_payment_entry`

- removed dead code: functions `get_bill_no_and_update_amounts`, `get_total_amount_exchange_rate_base_on_currency`, `get_total_amount_exchange_rate_for_employee_advance`, `get_amounts_based_on_ref_doc`, `get_amounts_based_on_reference_doctype`
- Remove `total_expense_claim` field from Project and Task, will be installed with hrms setup

- Remove Expense Claim calculation from `update_costing` in project

- Remove `update_total_expense_claim` from task

- Remove Expense Claim references from employee form tour

- Remove 'Make Expense Claim' button from Delivery Trip, will only be available if hrms is installed

- Update delivery trip tests
- Project Profitability report: Projects

- Employee Hours Utilization Based on Timesheet: Projects

- Unpaid Expense Claims: Accounts
…orm scripts

- removed approver fields and payroll cost center from Employee master

- removed query filter code for HR related fields from employee and department form scripts

- removed `update_approver_role`
- Employee, Holiday List, Project, Task, Timesheet
- Removed reports Provident Fund Deductions, Professional Tax Deductions, helper js file `salary_slip_deductions_report_filters.js`

- Removed Gratuity rules setup for India and UAE

- Removed custom field setup for India

- Moved all setups to the HRMS app
- Removed template `employees_to_mark_attendance.html`

- Removed HR references from ERPNext Settings and Home workspaces
@github-actions github-actions bot added the HR label Jun 28, 2022
- Driver, Vehicle, Driving License Category (child table)

- Removed Email Account setup for Job Applicant from setup wizard
@ruchamahabal
Copy link
Member Author

Failing checks:

  • Linters - flagging usage of args, ignoring
  • Semantic commits - flagging usage of "patch" type, ignoring
  • Code coverage - Since HR & Payroll modules have decent coverage, removing them will reduce core's coverage which was expected. Ignoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant