wbhuman_resources 1.56.0__tar.gz → 1.56.2__tar.gz

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.
Files changed (110) hide show
  1. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/PKG-INFO +1 -1
  2. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/employee.py +20 -5
  3. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tasks.py +0 -24
  4. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/.gitignore +0 -0
  5. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/pyproject.toml +0 -0
  6. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/__init__.py +0 -0
  7. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/admin/__init__.py +0 -0
  8. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/admin/absence.py +0 -0
  9. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/admin/calendars.py +0 -0
  10. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/admin/employee.py +0 -0
  11. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/admin/kpi.py +0 -0
  12. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/admin/review.py +0 -0
  13. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/apps.py +0 -0
  14. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/dynamic_preferences_registry.py +0 -0
  15. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/factories/__init__.py +0 -0
  16. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/factories/absence.py +0 -0
  17. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/factories/calendars.py +0 -0
  18. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/factories/employee.py +0 -0
  19. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/factories/kpi.py +0 -0
  20. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/__init__.py +0 -0
  21. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/absence.py +0 -0
  22. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/absence_graphs.py +0 -0
  23. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/calendars.py +0 -0
  24. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/employee.py +0 -0
  25. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/kpi.py +0 -0
  26. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/review.py +0 -0
  27. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/filters/signals.py +0 -0
  28. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/de/LC_MESSAGES/django.mo +0 -0
  29. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/de/LC_MESSAGES/django.po +0 -0
  30. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/de/LC_MESSAGES/django.po.translated +0 -0
  31. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/en/LC_MESSAGES/django.mo +0 -0
  32. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/en/LC_MESSAGES/django.po +0 -0
  33. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/fr/LC_MESSAGES/django.mo +0 -0
  34. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/locale/fr/LC_MESSAGES/django.po +0 -0
  35. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/management/__init__.py +0 -0
  36. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0001_initial_squashed_squashed_0015_alter_absencerequest_calendaritem_ptr_and_more.py +0 -0
  37. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0016_alter_employeehumanresource_options.py +0 -0
  38. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0017_absencerequest_crossborder_country_and_more.py +0 -0
  39. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0018_remove_position_group_position_groups.py +0 -0
  40. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0019_alter_absencerequest_options_alter_kpi_options_and_more.py +0 -0
  41. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0020_alter_employeeyearbalance_year_alter_review_year.py +0 -0
  42. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0021_alter_position_color.py +0 -0
  43. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/0022_remove_review_editable_mode.py +0 -0
  44. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/migrations/__init__.py +0 -0
  45. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/__init__.py +0 -0
  46. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/absence.py +0 -0
  47. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/calendars.py +0 -0
  48. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/kpi.py +0 -0
  49. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/preferences.py +0 -0
  50. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/models/review.py +0 -0
  51. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/permissions/__init__.py +0 -0
  52. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/permissions/backend.py +0 -0
  53. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/serializers/__init__.py +0 -0
  54. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/serializers/absence.py +0 -0
  55. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/serializers/calendars.py +0 -0
  56. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/serializers/employee.py +0 -0
  57. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/serializers/kpi.py +0 -0
  58. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/serializers/review.py +0 -0
  59. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/templates/review/review_report.html +0 -0
  60. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/__init__.py +0 -0
  61. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/conftest.py +0 -0
  62. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/models/__init__.py +0 -0
  63. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/models/test_absences.py +0 -0
  64. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/models/test_calendars.py +0 -0
  65. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/models/test_employees.py +0 -0
  66. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/models/test_review.py +0 -0
  67. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/models/test_utils.py +0 -0
  68. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/signals.py +0 -0
  69. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/test_permission.py +0 -0
  70. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/tests/test_tasks.py +0 -0
  71. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/urls.py +0 -0
  72. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/utils.py +0 -0
  73. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/__init__.py +0 -0
  74. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/absence.py +0 -0
  75. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/absence_charts.py +0 -0
  76. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/buttons/__init__.py +0 -0
  77. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/buttons/absence.py +0 -0
  78. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/buttons/employee.py +0 -0
  79. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/buttons/kpis.py +0 -0
  80. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/buttons/review.py +0 -0
  81. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/calendars.py +0 -0
  82. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/display/__init__.py +0 -0
  83. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/display/absence.py +0 -0
  84. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/display/calendars.py +0 -0
  85. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/display/employee.py +0 -0
  86. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/display/kpis.py +0 -0
  87. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/display/review.py +0 -0
  88. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/employee.py +0 -0
  89. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/endpoints/__init__.py +0 -0
  90. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/endpoints/absence.py +0 -0
  91. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/endpoints/calendars.py +0 -0
  92. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/endpoints/employee.py +0 -0
  93. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/endpoints/kpis.py +0 -0
  94. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/endpoints/review.py +0 -0
  95. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/kpi.py +0 -0
  96. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/__init__.py +0 -0
  97. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/absence.py +0 -0
  98. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/administration.py +0 -0
  99. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/calendars.py +0 -0
  100. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/employee.py +0 -0
  101. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/kpis.py +0 -0
  102. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/menu/review.py +0 -0
  103. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/mixins.py +0 -0
  104. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/review.py +0 -0
  105. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/titles/__init__.py +0 -0
  106. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/titles/absence.py +0 -0
  107. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/titles/employee.py +0 -0
  108. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/titles/kpis.py +0 -0
  109. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/titles/review.py +0 -0
  110. {wbhuman_resources-1.56.0 → wbhuman_resources-1.56.2}/wbhuman_resources/viewsets/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbhuman_resources
3
- Version: 1.56.0
3
+ Version: 1.56.2
4
4
  Summary: A workbench module for managing human resources.
5
5
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
6
6
  Requires-Dist: wbcore
@@ -50,6 +50,7 @@ from wbcore.contrib.notifications.utils import create_notification_type
50
50
  from wbcore.models import WBModel
51
51
  from wbcore.models.fields import YearField
52
52
  from wbcore.utils.models import ComplexToStringMixin
53
+ from wbcrm.signals import add_employee_activity_to_daily_brief
53
54
 
54
55
  from .absence import AbsenceRequest, AbsenceRequestPeriods
55
56
  from .calendars import DayOff, DayOffCalendar, DefaultDailyPeriod
@@ -235,11 +236,6 @@ class EmployeeHumanResource(ComplexToStringMixin, WBModel):
235
236
  title="Vacation Notification",
236
237
  help_text="Notifies you when there are Vacation days that you still have to take",
237
238
  ),
238
- create_notification_type(
239
- code="wbhuman_resources.employeehumanresource.birthday",
240
- title="Birthday Notification",
241
- help_text="Notifies you when today one of your colleagues is celebrating their birthday",
242
- ),
243
239
  ]
244
240
 
245
241
  def unassign_position_groups(self):
@@ -1213,3 +1209,22 @@ def deactivate_profile_as_task(requester_id: int, employee_id: int, substitute_i
1213
1209
  body=gettext("The following actions have been done: \n{messages}").format(messages=messages),
1214
1210
  user=requester,
1215
1211
  )
1212
+
1213
+
1214
+ @receiver(add_employee_activity_to_daily_brief, sender="directory.Person")
1215
+ def daily_birthday(sender, instance: Person, val_date: date, **kwargs) -> tuple[str, str] | None:
1216
+ """
1217
+ Cron task supposed to be ran every day. Check and notify employee about a colleague's birthday.
1218
+ """
1219
+ birthday_firstnames = list(
1220
+ EmployeeHumanResource.active_internal_employees.filter(
1221
+ Q(profile__birthday__day=val_date.day) & Q(profile__birthday__month=val_date.month)
1222
+ )
1223
+ .exclude(profile=instance)
1224
+ .values_list("profile__first_name", flat=True)
1225
+ )
1226
+ if birthday_firstnames:
1227
+ birthday_firstnames_humanized = f"{', '.join(birthday_firstnames[:-1])} and {birthday_firstnames[-1]}"
1228
+ return "Today Birthdays", _("Today is {}'s birthday, Which them a happy birthday!").format(
1229
+ birthday_firstnames_humanized
1230
+ )
@@ -29,30 +29,6 @@ def create_future_public_holiday(today: date | None = None, forecast_year: int =
29
29
  calendar.create_public_holidays(year)
30
30
 
31
31
 
32
- @shared_task
33
- def daily_birthday(today=None):
34
- """
35
- Cron task supposed to be ran every day. Check and notify employee about a colleague's birthday.
36
- """
37
- day = "today"
38
- if not today:
39
- # Notify employee the day before
40
- today = datetime.today() + timedelta(days=1)
41
- day = "tomorrow"
42
- for birthday_employee in EmployeeHumanResource.active_internal_employees.filter(
43
- Q(profile__birthday__day=today.day) & Q(profile__birthday__month=today.month)
44
- ).all():
45
- for employee in EmployeeHumanResource.active_internal_employees.exclude(id=birthday_employee.id):
46
- send_notification(
47
- code="wbhuman_resources.employeehumanresource.birthday",
48
- title=_("{} {}'s birthday is {}!").format(
49
- birthday_employee.profile.first_name, birthday_employee.profile.last_name, day
50
- ),
51
- body=_("Wish her/him a happy birthday!"),
52
- user=employee.profile.user_account,
53
- )
54
-
55
-
56
32
  @shared_task
57
33
  def assign_balance(today=None):
58
34
  """