wbhuman_resources 1.56.4__py2.py3-none-any.whl → 1.56.6__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.
@@ -1217,10 +1217,20 @@ def daily_birthday(sender, instance: Person, val_date: date, **kwargs) -> tuple[
1217
1217
  """
1218
1218
  Cron task supposed to be ran every day. Check and notify employee about a colleague's birthday.
1219
1219
  """
1220
- birthday_firstnames = list(
1221
- EmployeeHumanResource.active_internal_employees.filter(
1222
- Q(profile__birthday__day=val_date.day) & Q(profile__birthday__month=val_date.month)
1220
+
1221
+ # If daily brief is a monday, we get the birthday that happen during the weekend as well
1222
+ if val_date.weekday() == 0:
1223
+ sunday = val_date - timedelta(days=1)
1224
+ saturday = val_date - timedelta(days=2)
1225
+ conditions = (
1226
+ (Q(profile__birthday__day=val_date.day) & Q(profile__birthday__month=val_date.month))
1227
+ | (Q(profile__birthday__day=sunday.day) & Q(profile__birthday__month=sunday.month))
1228
+ | (Q(profile__birthday__day=saturday.day) & Q(profile__birthday__month=saturday.month))
1223
1229
  )
1230
+ else:
1231
+ conditions = Q(profile__birthday__day=val_date.day) & Q(profile__birthday__month=val_date.month)
1232
+ birthday_firstnames = list(
1233
+ EmployeeHumanResource.active_internal_employees.filter(conditions)
1224
1234
  .exclude(profile=instance)
1225
1235
  .values_list("profile__first_name", flat=True)
1226
1236
  )
@@ -167,9 +167,9 @@ class EmployeeModelSerializer(wb_serializers.ModelSerializer):
167
167
  _position_manager = PersonRepresentationSerializer(
168
168
  source="position_manager", filter_params={"is_internal_profile": True}
169
169
  )
170
- top_position_repr = wb_serializers.CharField(read_only=True, default="")
171
- primary_email = wb_serializers.CharField(default="", label=_("Primary Email"), allow_null=True, read_only=True)
172
- primary_address = wb_serializers.CharField(default="", label=_("Primary Address"), allow_null=True, read_only=True)
170
+ top_position_repr = wb_serializers.CharField(read_only=True)
171
+ primary_email = wb_serializers.CharField(label=_("Primary Email"), allow_null=True, read_only=True)
172
+ primary_address = wb_serializers.CharField(label=_("Primary Address"), allow_null=True, read_only=True)
173
173
  primary_telephone = wb_serializers.TelephoneField(label=_("Primary Telephone"), allow_null=True, read_only=True)
174
174
 
175
175
  @wb_serializers.register_resource()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbhuman_resources
3
- Version: 1.56.4
3
+ Version: 1.56.6
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
@@ -44,7 +44,7 @@ wbhuman_resources/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
44
44
  wbhuman_resources/models/__init__.py,sha256=PW4LDmMpJqcynmnbdy_VSwbhxyDU9ZCR2LIXk6LkHlg,631
45
45
  wbhuman_resources/models/absence.py,sha256=WDepyQjrySU860ESSZRP4Z13UlenMZD5JTsDS8Bm7xY,35892
46
46
  wbhuman_resources/models/calendars.py,sha256=TjUaabVldDY4baZN9tGVJA609LUAZV2pCowTCEa4VYA,14621
47
- wbhuman_resources/models/employee.py,sha256=KJvCjCMWRQQsnkqizKMwBMWmN2QT33JRX-8h_0OnrS4,49723
47
+ wbhuman_resources/models/employee.py,sha256=tfaHSccffScvRONhFtN4Rgj2QqLUUwm8oySRfWhBq-M,50290
48
48
  wbhuman_resources/models/kpi.py,sha256=BrYKb56MKm5Ya0sIav3-jmw0qk4zKNoSRr0bYfNM9mk,7270
49
49
  wbhuman_resources/models/preferences.py,sha256=iQhcu-jrEkk8DgM5hgakg5mdkbtlO11KeJC0QpTBcKI,1432
50
50
  wbhuman_resources/models/review.py,sha256=QXXckJclht6iAw75_QL6bva4urHeSeUgbu4D_lsmiaw,39414
@@ -53,7 +53,7 @@ wbhuman_resources/permissions/backend.py,sha256=lPIcCLkYG7gqtx7EgGquQrt_yhscZWj2
53
53
  wbhuman_resources/serializers/__init__.py,sha256=r-XHaWLkgo0mxxns3cpT_fo9ASWagMW9O26tqmsXtHg,1620
54
54
  wbhuman_resources/serializers/absence.py,sha256=_8lluuykmZEeEVio54YsbOD2kRf5miq0OHj4rLilipU,11984
55
55
  wbhuman_resources/serializers/calendars.py,sha256=bvnGbZZtr4QckwAkajuS_b69zJOF6msYjh0mu7d4Crs,2384
56
- wbhuman_resources/serializers/employee.py,sha256=8J6rXMm5mzcYO-Z6fTnMwj-i4P2zL4mZTaG5MHsS3GI,10137
56
+ wbhuman_resources/serializers/employee.py,sha256=-ll-UAIVMGtaWtdtEc8q_qlzToa9W6Yd8HOZ0KcltmY,10101
57
57
  wbhuman_resources/serializers/kpi.py,sha256=JjpazovWjY8MUjD_1NUudQot_BYwzetKzbiEvMPQOug,2636
58
58
  wbhuman_resources/serializers/review.py,sha256=BvYYBnLJox3k7SgLSvRvkqng7w64AFW4jesgefSIJPI,16163
59
59
  wbhuman_resources/templates/review/review_report.html,sha256=gQzrmtAwrjpAAVXtxYpiZnF5Bj1qH9HtN6kdzvrcQPA,13507
@@ -106,6 +106,6 @@ wbhuman_resources/viewsets/titles/absence.py,sha256=4F4ENgmZBGKiDuC8DmgrklNXEsRo
106
106
  wbhuman_resources/viewsets/titles/employee.py,sha256=VP_AC3E-3fpbO8-RUvi2haXcoJr9LVLYtJifGawVRGo,565
107
107
  wbhuman_resources/viewsets/titles/kpis.py,sha256=OSH_vIsIjfThWn17X_K7ykBKAFqNvz8M4PyFCF8BRQo,491
108
108
  wbhuman_resources/viewsets/titles/review.py,sha256=fL_PqTNAIK7alk_-7RaklkiR9guh54u8oS0m5AWOSSc,2458
109
- wbhuman_resources-1.56.4.dist-info/METADATA,sha256=hTAxED7YJafuSDpNn2zNCasPsLnFMgAOfNLA_bUoN20,272
110
- wbhuman_resources-1.56.4.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
111
- wbhuman_resources-1.56.4.dist-info/RECORD,,
109
+ wbhuman_resources-1.56.6.dist-info/METADATA,sha256=8CxDCkNz_WIZIP9QLQO90n1L97EtMIBx0JNrIDqt_d4,272
110
+ wbhuman_resources-1.56.6.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
111
+ wbhuman_resources-1.56.6.dist-info/RECORD,,