Skip to content

version-14: Refactoring for perfs and maintainability#169

Open
beingeek wants to merge 53 commits intoversion-14from
version-14-develop
Open

version-14: Refactoring for perfs and maintainability#169
beingeek wants to merge 53 commits intoversion-14from
version-14-develop

Conversation

@beingeek
Copy link
Copy Markdown
Collaborator

@beingeek beingeek commented Jan 13, 2025

Gitlab issue: https://git.phamos.eu/phamos/hr-department/-/work_items/12
Mattermost Thread: https://chat.phamos.eu/team-philipp/pl/4y6smeomt7ryxfjjep1mkpqbba

This PR implements extensive refactoring and cleanup in the HR-Addon’s workday processing functionality for version-14. Inconsistent Implementation of Workday Record Handling, listed below are the PR's to refactor in order to reduce redundancy, code cleanup, improving consistency and performance.

The main objectives of this PR include:

Key Changes:

  • Workday & HR Settings Refactoring

    • Adjusted the HR-Addon settings logic to integrate more smoothly with the workday module.
    • Moved several utility functions into the core workday processing file to reduce code duplication.
  • Field & Schema Cleanup

    • Removed deprecated or unused fields (e.g. in workday.json) to simplify the schema.
    • Raw SQL calls have been replaced with frappe.query_builder and frappe.get_cached_value, leading to more efficient and maintainable queries.
  • Eliminated redundant columns and associated calculations in the Weekly Working Hours module.

  • Enhanced Error Handling & Feedback

    • Updated error messages to include clickable links that direct users to the conflicting workday record—this change makes debugging and record resolution more efficient.
    • New notification features have been added to alert users if workday generation fails, including clearer error messages that help pinpoint conflicts.
    • Cleanup tasks include removing whitespace, commented-out code, and typos to enhance code readability.
    • Additional steps have been introduced to normalize workday data, ensuring consistency across the application.

Related Pull Requests

Robera16 and others added 30 commits December 25, 2024 15:05
…kday.py

refactor/2-move-utils.py-to-workday.py
…gs.py-to-workday.py

Refactor/3 move-hr_addon_settings.py-to-workday.py
…inder-to-hr_addon_settings.py

refactor/4-move-anniversary-reminder-to-hr_addon_settings.py
…-to-hr_addon_settings.py

refactor/5-move-export_calendar-to-hr_addon_settings.py
…to-weekly_working_hours.py

refactor/6-move-custom_scripts-to-weekly_working_hours.py
…ekly_working_hours

refactor/7-move-list_view-to-weekly_working_hours
…eld_for_employee.py-patch-to-fixture

refactor/8-change-add_custom_field_for_employee.py-patch-to-fixture
…-controller

Refactor/12 refactoring workday controller
…lder-over-frappe.db.sql

refactor/9-use-frappe.query_builder-over-frappe.db.sql
@beingeek beingeek changed the title Refactoring Refactoring for perfs and maintainability Jan 24, 2025
@beingeek beingeek changed the title Refactoring for perfs and maintainability version-14: Refactoring for perfs and maintainability Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants