[IMP] Remove inter module dependency (#274)

This commit introduces significant changes to the architecture of the Horilla HRMS system by decoupling interdependent modules. The following modifications were made:

1. **Module Independence**: Each module has been refactored to eliminate reliance on other modules, promoting a more modular and maintainable codebase.
2. **Refactored Imports and Dependencies**: Adjusted import statements and dependency injections to support independent module operation.
3. **Compatibility and Functionality**: Ensured that all modules are compatible with existing systems and maintain their intended functionality both independently and when integrated with other modules.

These changes enhance the modularity, maintainability, and scalability of the Horilla HRMS, allowing developers to work on individual modules without affecting the entire system. Future development and deployment will be more efficient and less prone to issues arising from tightly coupled code.

**NOTE**
For existing Horilla users, if you face any issues during the migrations, please run the following command and try again the migrations.

- `python3 manage.py makemigrations`
- `python3 manage.py migrate base`
- `python3 manage.py migrate`





* [IMP] ASSET: Asset module dependency removal from other Horilla apps

* [IMP] ATTENDANCE: Attendance module dependency removal from other Horilla apps

* [IMP] BASE: Base module dependency removal from other Horilla apps

* [IMP] EMPLOYEE: Employee module dependency removal from other Horilla apps

* [IMP] HELPDESK: Helpdesk module dependency removal from other Horilla apps

* [IMP] HORILLA AUDIT: Horilla Audit module dependency removal from other Horilla apps

* [IMP] HORILLA CRUMBS: Horilla Crumbs module dependency removal from other Horilla apps

* [IMP] HORILLA AUTOMATIONS: Horilla Automations module dependency removal from other Horilla apps

* [IMP] HORILLA VIEWS: Horilla Views module dependency removal from other Horilla apps

* [IMP] LEAVE: Leave module dependency removal from other Horilla apps

* [IMP] OFFBOARDING: Offboarding module dependency removal from other Horilla apps

* [IMP] ONBOARDING: Onboarding module dependency removal from other Horilla apps

* [IMP] PMS: PMS module dependency removal from other Horilla apps

* [IMP] PAYROLL: Payroll module dependency removal from other Horilla apps

* [IMP] RECRUITMENT: Recruitment module dependency removal from other Horilla apps

* [IMP] HORILLA: Dependency removal updates

* [IMP] TEMPLATES: Dependency removal updates

* [IMP] STATIC: Dependency removal updates

* [IMP] HORILLA DOCUMENTS: Horilla Documents module dependency removal from other Horilla apps

* [ADD] HORILLA: methods.py

* [UPDT] HORILLA: Settings.py

* [FIX] EMPLOYEE: About tab issue

* Update horilla_settings.py

* Remove dummy db init password
This commit is contained in:
Horilla
2024-08-05 14:22:44 +05:30
committed by GitHub
parent 746272d801
commit 2fee7c18bb
308 changed files with 12414 additions and 9577 deletions

View File

@@ -4,18 +4,16 @@ context_processor.py
This module is used to register context processor`
"""
from django.apps import apps
from django.http import HttpResponse
from django.urls import path
from attendance.models import AttendanceGeneralSetting
from base.models import Company, TrackLateComeEarlyOut
from base.urls import urlpatterns
from employee.models import EmployeeGeneralSetting
from horilla import horilla_apps
from horilla.decorators import hx_request_required, login_required, permission_required
from offboarding.models import OffboardingGeneralSetting
from payroll.models.models import PayrollGeneralSetting
from recruitment.models import RecruitmentGeneralSetting
from horilla.methods import get_horilla_model_class
class AllCompany:
@@ -132,8 +130,13 @@ def resignation_request_enabled(request):
"""
Check weather resignation_request enabled of not in offboarding
"""
first = OffboardingGeneralSetting.objects.first()
enabled_resignation_request = False
first = None
if apps.is_installed("offboarding"):
OffboardingGeneralSetting = get_horilla_model_class(
app_label="offboarding", model="offboardinggeneralsetting"
)
first = OffboardingGeneralSetting.objects.first()
if first:
enabled_resignation_request = first.resignation_request
return {"enabled_resignation_request": enabled_resignation_request}
@@ -143,8 +146,13 @@ def timerunner_enabled(request):
"""
Check weather resignation_request enabled of not in offboarding
"""
first = AttendanceGeneralSetting.objects.first()
first = None
enabled_timerunner = True
if apps.is_installed("attendance"):
AttendanceGeneralSetting = get_horilla_model_class(
app_label="attendance", model="attendancegeneralsetting"
)
first = AttendanceGeneralSetting.objects.first()
if first:
enabled_timerunner = first.time_runner
return {"enabled_timerunner": enabled_timerunner}
@@ -154,8 +162,13 @@ def intial_notice_period(request):
"""
Check weather resignation_request enabled of not in offboarding
"""
first = PayrollGeneralSetting.objects.first()
initial = 30
first = None
if apps.is_installed("payroll"):
PayrollGeneralSetting = get_horilla_model_class(
app_label="payroll", model="payrollgeneralsetting"
)
first = PayrollGeneralSetting.objects.first()
if first:
initial = first.notice_period
return {"get_initial_notice_period": initial}
@@ -165,8 +178,15 @@ def check_candidate_self_tracking(request):
"""
This method is used to get the candidate self tracking is enabled or not
"""
first = RecruitmentGeneralSetting.objects.first()
candidate_self_tracking = False
if apps.is_installed("recruitment"):
RecruitmentGeneralSetting = get_horilla_model_class(
app_label="recruitment", model="recruitmentgeneralsetting"
)
first = RecruitmentGeneralSetting.objects.first()
else:
first = None
if first:
candidate_self_tracking = first.candidate_self_tracking
return {"check_candidate_self_tracking": candidate_self_tracking}
@@ -176,8 +196,14 @@ def check_candidate_self_tracking_rating(request):
"""
This method is used to check enabled/disabled of rating option
"""
first = RecruitmentGeneralSetting.objects.first()
rating_option = False
if apps.is_installed("recruitment"):
RecruitmentGeneralSetting = get_horilla_model_class(
app_label="recruitment", model="recruitmentgeneralsetting"
)
first = RecruitmentGeneralSetting.objects.first()
else:
first = None
if first:
rating_option = first.show_overall_rating
return {"check_candidate_self_tracking_rating": rating_option}