wbhuman_resources 1.58.4__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wbhuman_resources/__init__.py +1 -0
- wbhuman_resources/admin/__init__.py +5 -0
- wbhuman_resources/admin/absence.py +113 -0
- wbhuman_resources/admin/calendars.py +37 -0
- wbhuman_resources/admin/employee.py +109 -0
- wbhuman_resources/admin/kpi.py +21 -0
- wbhuman_resources/admin/review.py +157 -0
- wbhuman_resources/apps.py +23 -0
- wbhuman_resources/dynamic_preferences_registry.py +119 -0
- wbhuman_resources/factories/__init__.py +38 -0
- wbhuman_resources/factories/absence.py +109 -0
- wbhuman_resources/factories/calendars.py +60 -0
- wbhuman_resources/factories/employee.py +80 -0
- wbhuman_resources/factories/kpi.py +155 -0
- wbhuman_resources/filters/__init__.py +20 -0
- wbhuman_resources/filters/absence.py +109 -0
- wbhuman_resources/filters/absence_graphs.py +85 -0
- wbhuman_resources/filters/calendars.py +28 -0
- wbhuman_resources/filters/employee.py +81 -0
- wbhuman_resources/filters/kpi.py +35 -0
- wbhuman_resources/filters/review.py +134 -0
- wbhuman_resources/filters/signals.py +27 -0
- wbhuman_resources/locale/de/LC_MESSAGES/django.mo +0 -0
- wbhuman_resources/locale/de/LC_MESSAGES/django.po +2207 -0
- wbhuman_resources/locale/de/LC_MESSAGES/django.po.translated +2456 -0
- wbhuman_resources/locale/en/LC_MESSAGES/django.mo +0 -0
- wbhuman_resources/locale/en/LC_MESSAGES/django.po +2091 -0
- wbhuman_resources/locale/fr/LC_MESSAGES/django.mo +0 -0
- wbhuman_resources/locale/fr/LC_MESSAGES/django.po +2093 -0
- wbhuman_resources/management/__init__.py +23 -0
- wbhuman_resources/migrations/0001_initial_squashed_squashed_0015_alter_absencerequest_calendaritem_ptr_and_more.py +949 -0
- wbhuman_resources/migrations/0016_alter_employeehumanresource_options.py +20 -0
- wbhuman_resources/migrations/0017_absencerequest_crossborder_country_and_more.py +55 -0
- wbhuman_resources/migrations/0018_remove_position_group_position_groups.py +32 -0
- wbhuman_resources/migrations/0019_alter_absencerequest_options_alter_kpi_options_and_more.py +44 -0
- wbhuman_resources/migrations/0020_alter_employeeyearbalance_year_alter_review_year.py +27 -0
- wbhuman_resources/migrations/0021_alter_position_color.py +18 -0
- wbhuman_resources/migrations/0022_remove_review_editable_mode.py +64 -0
- wbhuman_resources/migrations/__init__.py +0 -0
- wbhuman_resources/models/__init__.py +23 -0
- wbhuman_resources/models/absence.py +903 -0
- wbhuman_resources/models/calendars.py +370 -0
- wbhuman_resources/models/employee.py +1241 -0
- wbhuman_resources/models/kpi.py +199 -0
- wbhuman_resources/models/preferences.py +40 -0
- wbhuman_resources/models/review.py +982 -0
- wbhuman_resources/permissions/__init__.py +0 -0
- wbhuman_resources/permissions/backend.py +26 -0
- wbhuman_resources/serializers/__init__.py +49 -0
- wbhuman_resources/serializers/absence.py +308 -0
- wbhuman_resources/serializers/calendars.py +73 -0
- wbhuman_resources/serializers/employee.py +267 -0
- wbhuman_resources/serializers/kpi.py +80 -0
- wbhuman_resources/serializers/review.py +415 -0
- wbhuman_resources/signals.py +4 -0
- wbhuman_resources/tasks.py +195 -0
- wbhuman_resources/templates/review/review_report.html +322 -0
- wbhuman_resources/tests/__init__.py +1 -0
- wbhuman_resources/tests/conftest.py +96 -0
- wbhuman_resources/tests/models/__init__.py +0 -0
- wbhuman_resources/tests/models/test_absences.py +478 -0
- wbhuman_resources/tests/models/test_calendars.py +209 -0
- wbhuman_resources/tests/models/test_employees.py +502 -0
- wbhuman_resources/tests/models/test_review.py +103 -0
- wbhuman_resources/tests/models/test_utils.py +110 -0
- wbhuman_resources/tests/signals.py +108 -0
- wbhuman_resources/tests/test_permission.py +64 -0
- wbhuman_resources/tests/test_tasks.py +74 -0
- wbhuman_resources/urls.py +221 -0
- wbhuman_resources/utils.py +43 -0
- wbhuman_resources/viewsets/__init__.py +61 -0
- wbhuman_resources/viewsets/absence.py +312 -0
- wbhuman_resources/viewsets/absence_charts.py +328 -0
- wbhuman_resources/viewsets/buttons/__init__.py +7 -0
- wbhuman_resources/viewsets/buttons/absence.py +32 -0
- wbhuman_resources/viewsets/buttons/employee.py +44 -0
- wbhuman_resources/viewsets/buttons/kpis.py +16 -0
- wbhuman_resources/viewsets/buttons/review.py +195 -0
- wbhuman_resources/viewsets/calendars.py +103 -0
- wbhuman_resources/viewsets/display/__init__.py +39 -0
- wbhuman_resources/viewsets/display/absence.py +334 -0
- wbhuman_resources/viewsets/display/calendars.py +83 -0
- wbhuman_resources/viewsets/display/employee.py +254 -0
- wbhuman_resources/viewsets/display/kpis.py +92 -0
- wbhuman_resources/viewsets/display/review.py +429 -0
- wbhuman_resources/viewsets/employee.py +210 -0
- wbhuman_resources/viewsets/endpoints/__init__.py +42 -0
- wbhuman_resources/viewsets/endpoints/absence.py +57 -0
- wbhuman_resources/viewsets/endpoints/calendars.py +18 -0
- wbhuman_resources/viewsets/endpoints/employee.py +51 -0
- wbhuman_resources/viewsets/endpoints/kpis.py +53 -0
- wbhuman_resources/viewsets/endpoints/review.py +191 -0
- wbhuman_resources/viewsets/kpi.py +280 -0
- wbhuman_resources/viewsets/menu/__init__.py +22 -0
- wbhuman_resources/viewsets/menu/absence.py +50 -0
- wbhuman_resources/viewsets/menu/administration.py +15 -0
- wbhuman_resources/viewsets/menu/calendars.py +33 -0
- wbhuman_resources/viewsets/menu/employee.py +44 -0
- wbhuman_resources/viewsets/menu/kpis.py +18 -0
- wbhuman_resources/viewsets/menu/review.py +97 -0
- wbhuman_resources/viewsets/mixins.py +14 -0
- wbhuman_resources/viewsets/review.py +837 -0
- wbhuman_resources/viewsets/titles/__init__.py +18 -0
- wbhuman_resources/viewsets/titles/absence.py +30 -0
- wbhuman_resources/viewsets/titles/employee.py +18 -0
- wbhuman_resources/viewsets/titles/kpis.py +15 -0
- wbhuman_resources/viewsets/titles/review.py +62 -0
- wbhuman_resources/viewsets/utils.py +28 -0
- wbhuman_resources-1.58.4.dist-info/METADATA +8 -0
- wbhuman_resources-1.58.4.dist-info/RECORD +111 -0
- wbhuman_resources-1.58.4.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from django.utils.translation import gettext_lazy
|
|
2
|
+
from wbcore.contrib.icons import WBIcon
|
|
3
|
+
from wbcore.enums import RequestType
|
|
4
|
+
from wbcore.metadata.configs import buttons as bt
|
|
5
|
+
from wbcore.metadata.configs.buttons.view_config import ButtonViewConfig
|
|
6
|
+
from wbcore.metadata.configs.display.instance_display.shortcuts import (
|
|
7
|
+
create_simple_display,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from wbhuman_resources.serializers import DeactivateEmployeeSerializer
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class EmployeeButtonConfig(ButtonViewConfig):
|
|
14
|
+
def get_custom_instance_buttons(self):
|
|
15
|
+
return {
|
|
16
|
+
bt.ActionButton(
|
|
17
|
+
method=RequestType.PATCH,
|
|
18
|
+
identifiers=("wbhuman_resources:employee",),
|
|
19
|
+
key="deactivate",
|
|
20
|
+
action_label=gettext_lazy("Deactivating Employee"),
|
|
21
|
+
label=gettext_lazy("Deactivate Employee"),
|
|
22
|
+
icon=WBIcon.DISABLED.icon,
|
|
23
|
+
title=gettext_lazy("Deactivate Employee"),
|
|
24
|
+
serializer=DeactivateEmployeeSerializer,
|
|
25
|
+
description_fields=gettext_lazy(
|
|
26
|
+
"""
|
|
27
|
+
<p>You are about to deactivate the employee <b>{{computed_str}}</b>. This will disable this employee's and user's accounts. If you want to transfer relationships to a substitute, please select it in the list bellow:</p>
|
|
28
|
+
"""
|
|
29
|
+
),
|
|
30
|
+
instance_display=create_simple_display([["substitute"]]),
|
|
31
|
+
),
|
|
32
|
+
bt.WidgetButton(key="balance_and_usage", label="Balance & Usage", icon=WBIcon.DATA_GRID.icon),
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
def get_custom_list_instance_buttons(self):
|
|
36
|
+
return self.get_custom_instance_buttons()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class YearBalanceEmployeeHumanResourceButtonConfig(ButtonViewConfig):
|
|
40
|
+
def get_custom_list_instance_buttons(self):
|
|
41
|
+
return super().get_custom_list_instance_buttons()
|
|
42
|
+
|
|
43
|
+
def get_custom_instance_buttons(self):
|
|
44
|
+
return super().get_custom_instance_buttons()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from django.utils.translation import gettext as _
|
|
2
|
+
from wbcore.contrib.icons import WBIcon
|
|
3
|
+
from wbcore.metadata.configs import buttons as bt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class KPIButtonConfig(bt.ButtonViewConfig):
|
|
7
|
+
def get_custom_instance_buttons(self):
|
|
8
|
+
buttons = []
|
|
9
|
+
if self.view.kwargs.get("pk", None):
|
|
10
|
+
buttons += [
|
|
11
|
+
bt.WidgetButton(
|
|
12
|
+
key="evaluationgraph", label=_("Evaluation Graph"), icon=WBIcon.CHART_BARS_HORIZONTAL.icon
|
|
13
|
+
),
|
|
14
|
+
bt.WidgetButton(key="kpievaluationpandas", label=_("Latest Evaluations"), icon=WBIcon.DATA_GRID.icon),
|
|
15
|
+
]
|
|
16
|
+
return {*buttons}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
from django.db.models import Q
|
|
2
|
+
from django.utils.translation import gettext as _
|
|
3
|
+
from django.utils.translation import gettext_lazy, pgettext
|
|
4
|
+
from rest_framework.reverse import reverse
|
|
5
|
+
from wbcore import serializers as wb_serializers
|
|
6
|
+
from wbcore.contrib.directory.models import Person
|
|
7
|
+
from wbcore.contrib.directory.serializers import PersonRepresentationSerializer
|
|
8
|
+
from wbcore.contrib.icons import WBIcon
|
|
9
|
+
from wbcore.enums import RequestType
|
|
10
|
+
from wbcore.metadata.configs import buttons as bt
|
|
11
|
+
from wbcore.metadata.configs.display.instance_display.shortcuts import (
|
|
12
|
+
create_simple_display,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
from wbhuman_resources.models import Review
|
|
16
|
+
from wbhuman_resources.serializers import ReviewModelSerializer
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ReviewButtonConfig(bt.ButtonViewConfig):
|
|
20
|
+
def get_custom_buttons(self):
|
|
21
|
+
if not self.view.kwargs.get("pk", None):
|
|
22
|
+
return {
|
|
23
|
+
bt.WidgetButton(
|
|
24
|
+
endpoint=reverse("wbhuman_resources:reviewprogress-list", args=[], request=self.request),
|
|
25
|
+
label=_("Progress"),
|
|
26
|
+
icon=WBIcon.CHART_BARS_HORIZONTAL.icon,
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
return {}
|
|
30
|
+
|
|
31
|
+
def get_custom_list_instance_buttons(self):
|
|
32
|
+
return self.get_custom_instance_buttons()
|
|
33
|
+
|
|
34
|
+
def get_custom_instance_buttons(self):
|
|
35
|
+
buttons = [
|
|
36
|
+
bt.WidgetButton(key="progress", label=_("Progress"), icon=WBIcon.CHART_BARS_HORIZONTAL.icon),
|
|
37
|
+
bt.ActionButton(
|
|
38
|
+
method=RequestType.PATCH,
|
|
39
|
+
identifiers=("wbhuman_resources:review",),
|
|
40
|
+
key="completelyfilledreviewee",
|
|
41
|
+
action_label=_("Sending Review"),
|
|
42
|
+
title=_("Finish and Send Review"),
|
|
43
|
+
label=_("Finish and Send Review"),
|
|
44
|
+
icon=WBIcon.CONFIRM.icon,
|
|
45
|
+
description_fields=_(
|
|
46
|
+
"<p>Have you finished filling in the review? </p> <p><span style='color:red'>This action is not reversible</span></p>"
|
|
47
|
+
),
|
|
48
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
49
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
50
|
+
),
|
|
51
|
+
bt.ActionButton(
|
|
52
|
+
method=RequestType.PATCH,
|
|
53
|
+
identifiers=("wbhuman_resources:review",),
|
|
54
|
+
key="completelyfilledreviewer",
|
|
55
|
+
action_label=_("Sending Review"),
|
|
56
|
+
title=_("Finish and Send Review"),
|
|
57
|
+
label=_("Finish and Send Review"),
|
|
58
|
+
icon=WBIcon.CONFIRM.icon,
|
|
59
|
+
description_fields=_(
|
|
60
|
+
"<p>Have you finished filling in the review? </p> <p><span style='color:red'>This action is not reversible</span></p>"
|
|
61
|
+
),
|
|
62
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
63
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
64
|
+
),
|
|
65
|
+
bt.ActionButton(
|
|
66
|
+
method=RequestType.PATCH,
|
|
67
|
+
identifiers=("wbhuman_resources:review",),
|
|
68
|
+
key="signaturereviewee",
|
|
69
|
+
action_label=_("Signing"),
|
|
70
|
+
title=_("Sign"),
|
|
71
|
+
label=_("Sign"),
|
|
72
|
+
icon=WBIcon.CONFIRM.icon,
|
|
73
|
+
description_fields=_(
|
|
74
|
+
"<p>Do you want to sign the review? </p> <p><span style='color:red'>This action is not reversible</span></p>"
|
|
75
|
+
),
|
|
76
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
77
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
78
|
+
instance_display=create_simple_display([["feedback_reviewee"]]),
|
|
79
|
+
),
|
|
80
|
+
bt.ActionButton(
|
|
81
|
+
method=RequestType.PATCH,
|
|
82
|
+
identifiers=("wbhuman_resources:review",),
|
|
83
|
+
key="signaturereviewer",
|
|
84
|
+
action_label=_("Signing"),
|
|
85
|
+
title=_("Sign"),
|
|
86
|
+
label=_("Sign"),
|
|
87
|
+
icon=WBIcon.CONFIRM.icon,
|
|
88
|
+
description_fields=_(
|
|
89
|
+
"<p>Do you want to sign the review? </p> <p><span style='color:red'>This action is not reversible</span></p>"
|
|
90
|
+
),
|
|
91
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
92
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
93
|
+
instance_display=create_simple_display([["feedback_reviewer"]]),
|
|
94
|
+
),
|
|
95
|
+
bt.ActionButton(
|
|
96
|
+
method=RequestType.PATCH,
|
|
97
|
+
identifiers=("wbhuman_resources:review",),
|
|
98
|
+
key="generate_pdf",
|
|
99
|
+
action_label=_("Sending Report"),
|
|
100
|
+
title=_("Generate and Send Report"),
|
|
101
|
+
label=_("Generate and Send Report"),
|
|
102
|
+
icon=WBIcon.SEND.icon,
|
|
103
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
104
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
105
|
+
),
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
if self.view.kwargs.get("pk", None):
|
|
109
|
+
review = self.view.get_object()
|
|
110
|
+
|
|
111
|
+
if review.is_template and review.review_group and review.moderator == self.view.request.user.profile:
|
|
112
|
+
|
|
113
|
+
class GenerateReviewModelSerializer(ReviewModelSerializer):
|
|
114
|
+
employees = wb_serializers.PrimaryKeyRelatedField(
|
|
115
|
+
queryset=Person.objects.all(),
|
|
116
|
+
label=gettext_lazy("Employees"),
|
|
117
|
+
many=True,
|
|
118
|
+
default=[_employee for _employee in review.review_group.employees.all()],
|
|
119
|
+
)
|
|
120
|
+
_employees = PersonRepresentationSerializer(many=True, source="employees")
|
|
121
|
+
include_kpi = wb_serializers.BooleanField(default=False, label=gettext_lazy("Include KPI"))
|
|
122
|
+
|
|
123
|
+
class Meta:
|
|
124
|
+
model = Review
|
|
125
|
+
fields = (
|
|
126
|
+
"from_date",
|
|
127
|
+
"to_date",
|
|
128
|
+
"review_deadline",
|
|
129
|
+
"auto_apply_deadline",
|
|
130
|
+
"employees",
|
|
131
|
+
"_employees",
|
|
132
|
+
"include_kpi",
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
buttons.append(
|
|
136
|
+
bt.ActionButton(
|
|
137
|
+
method=RequestType.PATCH,
|
|
138
|
+
identifiers=("wbhuman_resources:review",),
|
|
139
|
+
key="generate",
|
|
140
|
+
action_label=_("Generating Review"),
|
|
141
|
+
title=_("Generate Review from Template"),
|
|
142
|
+
label=_("Generate Review"),
|
|
143
|
+
icon=WBIcon.DATA_GRID.icon,
|
|
144
|
+
description_fields=_(
|
|
145
|
+
"<p>Generate report from : <p> <b><span>{{computed_str}} </span></b> </p>"
|
|
146
|
+
),
|
|
147
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
148
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
149
|
+
serializer=GenerateReviewModelSerializer,
|
|
150
|
+
instance_display=create_simple_display(
|
|
151
|
+
[
|
|
152
|
+
["from_date", "from_date"],
|
|
153
|
+
["to_date", "to_date"],
|
|
154
|
+
["review_deadline", "review_deadline"],
|
|
155
|
+
["auto_apply_deadline", "include_kpi"],
|
|
156
|
+
["employees", "employees"],
|
|
157
|
+
]
|
|
158
|
+
),
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
return {*buttons}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class ReviewGroupButtonConfig(bt.ButtonViewConfig):
|
|
165
|
+
def get_custom_instance_buttons(self):
|
|
166
|
+
class ReviewCounterSerializer(wb_serializers.Serializer):
|
|
167
|
+
counter = wb_serializers.IntegerField(
|
|
168
|
+
read_only=True,
|
|
169
|
+
label=gettext_lazy("Number of reviews found"),
|
|
170
|
+
default=Review.objects.filter(
|
|
171
|
+
Q(review_group=self.view.get_object())
|
|
172
|
+
& Q(status=Review.Status.PREPARATION_OF_REVIEW)
|
|
173
|
+
& Q(moderator=self.view.request.user.profile)
|
|
174
|
+
& Q(is_template=False)
|
|
175
|
+
).count(),
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
bt.ActionButton(
|
|
180
|
+
method=RequestType.PATCH,
|
|
181
|
+
identifiers=("wbhuman_resources:reviewgroup",),
|
|
182
|
+
key="submitreviews",
|
|
183
|
+
action_label=_("Submitting Reviews from Stage 1 to Stage 2"),
|
|
184
|
+
title=_("Submit Reviews from Stage 1 to Stage 2"),
|
|
185
|
+
label=_("Submit Reviews"),
|
|
186
|
+
icon=WBIcon.SEND.icon,
|
|
187
|
+
description_fields=_(
|
|
188
|
+
"<p>Submit Reviews</p> <p>Group : <b>{{name}}</b><p> From : <b>Stage 1: Preparation of review</b></p> <p> To : <b>Stage 2: Fill in review</b></p> <p style='background-color:skyblue;border-radius:2px;padding:5px;'> <b><span style=color:black> You are going to submit the reviews that are in stage 1 to stage 2 </span></b> </p>"
|
|
189
|
+
),
|
|
190
|
+
confirm_config=bt.ButtonConfig(label=_("Confirm")),
|
|
191
|
+
cancel_config=bt.ButtonConfig(label=pgettext("Non-Transition button", "Cancel")),
|
|
192
|
+
serializer=ReviewCounterSerializer,
|
|
193
|
+
instance_display=create_simple_display([["counter"]]),
|
|
194
|
+
),
|
|
195
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from wbcore import viewsets
|
|
2
|
+
|
|
3
|
+
from wbhuman_resources.filters import DayOffFilter
|
|
4
|
+
from wbhuman_resources.models import (
|
|
5
|
+
DayOff,
|
|
6
|
+
DayOffCalendar,
|
|
7
|
+
DefaultDailyPeriod,
|
|
8
|
+
EmployeeWeeklyOffPeriods,
|
|
9
|
+
)
|
|
10
|
+
from wbhuman_resources.serializers import (
|
|
11
|
+
DayOffCalendarModelSerializer,
|
|
12
|
+
DayOffCalendarRepresentationSerializer,
|
|
13
|
+
DayOffModelSerializer,
|
|
14
|
+
DayOffRepresentationSerializer,
|
|
15
|
+
DefaultDailyPeriodModelSerializer,
|
|
16
|
+
DefaultDailyPeriodRepresentationSerializer,
|
|
17
|
+
EmployeeWeeklyOffPeriodsRepresentationSerializer,
|
|
18
|
+
)
|
|
19
|
+
from wbhuman_resources.viewsets.display import (
|
|
20
|
+
DayOffCalendarDisplayConfig,
|
|
21
|
+
DayOffDayOffCalendarDisplayConfig,
|
|
22
|
+
DayOffDisplayConfig,
|
|
23
|
+
DefaultDailyPeriodDayOffCalendarDisplayConfig,
|
|
24
|
+
)
|
|
25
|
+
from wbhuman_resources.viewsets.endpoints import (
|
|
26
|
+
DayOffDayOffCalendarEndpointConfig,
|
|
27
|
+
DefaultDailyPeriodDayOffCalendar,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DefaultDailyPeriodRepresentationViewSet(viewsets.RepresentationViewSet):
|
|
32
|
+
queryset = DefaultDailyPeriod.objects.all()
|
|
33
|
+
serializer_class = DefaultDailyPeriodRepresentationSerializer
|
|
34
|
+
|
|
35
|
+
search_fields = ("title",)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class EmployeeWeeklyOffPeriodsRepresentationViewSet(viewsets.RepresentationViewSet):
|
|
39
|
+
queryset = EmployeeWeeklyOffPeriods.objects.all()
|
|
40
|
+
serializer_class = EmployeeWeeklyOffPeriodsRepresentationSerializer
|
|
41
|
+
|
|
42
|
+
search_fields = ("computed_str",)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class DayOffRepresentationViewSet(viewsets.RepresentationViewSet):
|
|
46
|
+
queryset = DayOff.objects.all()
|
|
47
|
+
serializer_class = DayOffRepresentationSerializer
|
|
48
|
+
|
|
49
|
+
search_fields = ("title",)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class DayOffCalendarRepresentationViewSet(viewsets.RepresentationViewSet):
|
|
53
|
+
queryset = DayOffCalendar.objects.all()
|
|
54
|
+
serializer_class = DayOffCalendarRepresentationSerializer
|
|
55
|
+
|
|
56
|
+
search_fields = ("title",)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class DayOffModelViewSet(viewsets.ModelViewSet):
|
|
60
|
+
queryset = DayOff.objects.select_related("calendar")
|
|
61
|
+
serializer_class = DayOffModelSerializer
|
|
62
|
+
|
|
63
|
+
ordering_fields = ["title", "date"]
|
|
64
|
+
ordering = ["date"]
|
|
65
|
+
search_fields = ["title"]
|
|
66
|
+
|
|
67
|
+
filterset_class = DayOffFilter
|
|
68
|
+
|
|
69
|
+
display_config_class = DayOffDisplayConfig
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class DayOffCalendarModelViewSet(viewsets.ModelViewSet):
|
|
73
|
+
queryset = DayOffCalendar.objects.all()
|
|
74
|
+
serializer_class = DayOffCalendarModelSerializer
|
|
75
|
+
|
|
76
|
+
search_fields = ("title",)
|
|
77
|
+
filterset_fields = {"title": ["exact", "iexact"]}
|
|
78
|
+
|
|
79
|
+
display_config_class = DayOffCalendarDisplayConfig
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Subviewsets
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class DayOffDayOffCalendarModelViewSet(DayOffModelViewSet):
|
|
86
|
+
display_config_class = DayOffDayOffCalendarDisplayConfig
|
|
87
|
+
endpoint_config_class = DayOffDayOffCalendarEndpointConfig
|
|
88
|
+
|
|
89
|
+
def get_queryset(self):
|
|
90
|
+
return super().get_queryset().filter(calendar=self.kwargs["calendar_id"])
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class DefaultDailyPeriodDayOffCalendarModelViewSet(viewsets.ModelViewSet):
|
|
94
|
+
queryset = DefaultDailyPeriod.objects.all()
|
|
95
|
+
serializer_class = DefaultDailyPeriodModelSerializer
|
|
96
|
+
|
|
97
|
+
ordering = ["lower_time"]
|
|
98
|
+
|
|
99
|
+
display_config_class = DefaultDailyPeriodDayOffCalendarDisplayConfig
|
|
100
|
+
endpoint_config_class = DefaultDailyPeriodDayOffCalendar
|
|
101
|
+
|
|
102
|
+
def get_queryset(self):
|
|
103
|
+
return super().get_queryset().filter(calendar=self.kwargs["calendar_id"])
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from .absence import (
|
|
2
|
+
AbsenceRequestCrossBorderCountryDisplayConfig,
|
|
3
|
+
AbsenceRequestDisplayConfig,
|
|
4
|
+
AbsenceRequestEmployeeHumanResourceDisplayConfig,
|
|
5
|
+
AbsenceRequestPeriodsAbsenceRequestDisplayConfig,
|
|
6
|
+
AbsenceRequestTypeDisplayConfig,
|
|
7
|
+
AbsenceTablePandasDisplayConfig,
|
|
8
|
+
AbsenceTypeCountEmployeeDisplayConfig,
|
|
9
|
+
)
|
|
10
|
+
from .calendars import (
|
|
11
|
+
DayOffCalendarDisplayConfig,
|
|
12
|
+
DayOffDayOffCalendarDisplayConfig,
|
|
13
|
+
DayOffDisplayConfig,
|
|
14
|
+
DefaultDailyPeriodDayOffCalendarDisplayConfig,
|
|
15
|
+
)
|
|
16
|
+
from .employee import (
|
|
17
|
+
EmployeeBalanceDisplayConfig,
|
|
18
|
+
EmployeeDisplayConfig,
|
|
19
|
+
PositionDisplayConfig,
|
|
20
|
+
WeeklyOffPeriodEmployeeHumanResourceDisplayConfig,
|
|
21
|
+
YearBalanceEmployeeHumanResourceDisplayConfig,
|
|
22
|
+
)
|
|
23
|
+
from .kpis import (
|
|
24
|
+
KPIDisplayConfig,
|
|
25
|
+
KPIEvaluationDisplayConfig,
|
|
26
|
+
KPIEvaluationPandasDisplayConfig,
|
|
27
|
+
)
|
|
28
|
+
from .review import (
|
|
29
|
+
ReviewAnswerReviewPandasDisplayConfig,
|
|
30
|
+
ReviewAnswerDisplayConfig,
|
|
31
|
+
ReviewDisplayConfig,
|
|
32
|
+
ReviewGroupDisplayConfig,
|
|
33
|
+
ReviewProgressPandasDisplayConfig,
|
|
34
|
+
ReviewProgressReviewPandasDisplayConfig,
|
|
35
|
+
ReviewQuestionCategoryDisplayConfig,
|
|
36
|
+
ReviewQuestionDisplayConfig,
|
|
37
|
+
ReviewTemplateDisplayConfig,
|
|
38
|
+
ReviewQuestionReviewDisplayConfig,
|
|
39
|
+
)
|