wbhuman_resources 1.59.4__py2.py3-none-any.whl → 1.59.5__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.
@@ -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 wbcore.workers import Queue
53
54
 
54
55
  from wbhuman_resources.signals import add_employee_activity_to_daily_brief
55
56
 
@@ -1184,7 +1185,7 @@ def position_groups_to_employee(
1184
1185
  user.groups.remove(group)
1185
1186
 
1186
1187
 
1187
- @shared_task
1188
+ @shared_task(queue=Queue.DEFAULT.value)
1188
1189
  def deactivate_profile_as_task(requester_id: int, employee_id: int, substitute_id: Optional[int] = None):
1189
1190
  """
1190
1191
  Call the deactivation method as a async task
@@ -43,6 +43,7 @@ from wbcore.models import WBModel
43
43
  from wbcore.models.fields import YearField
44
44
  from wbcore.models.orderable import OrderableModel
45
45
  from wbcore.utils.models import CloneMixin, ComplexToStringMixin
46
+ from wbcore.workers import Queue
46
47
  from weasyprint import HTML
47
48
 
48
49
  from wbhuman_resources.models.employee import get_main_company
@@ -757,7 +758,7 @@ def pre_save_review(sender, instance, **kwargs):
757
758
  instance.validation()
758
759
 
759
760
 
760
- @shared_task
761
+ @shared_task(queue=Queue.DEFAULT.value)
761
762
  def finalize_review(review_id):
762
763
  review = Review.objects.get(id=review_id)
763
764
  ReviewAnswer.objects.filter(
@@ -768,7 +769,7 @@ def finalize_review(review_id):
768
769
  ).update(answer_number=1)
769
770
 
770
771
 
771
- @shared_task
772
+ @shared_task(queue=Queue.DEFAULT.value)
772
773
  def submit_reviews_from_group(group_id, user_id):
773
774
  user = get_user_model().objects.get(id=user_id)
774
775
 
@@ -783,7 +784,7 @@ def submit_reviews_from_group(group_id, user_id):
783
784
  review.save()
784
785
 
785
786
 
786
- @shared_task
787
+ @shared_task(queue=Queue.DEFAULT.value)
787
788
  def create_review_from_template(
788
789
  template_id, from_date, to_date, review_deadline, auto_apply_deadline, employees, include_kpi
789
790
  ):
@@ -884,7 +885,7 @@ What do you think of this result?
884
885
  ReviewQuestion.objects.create(**kwargs)
885
886
 
886
887
 
887
- @shared_task
888
+ @shared_task(queue=Queue.DEFAULT.value)
888
889
  def submit_review(review_id):
889
890
  review = Review.objects.get(id=review_id)
890
891
  questions = ReviewQuestion.objects.filter(review=review)
@@ -956,7 +957,7 @@ def submit_review(review_id):
956
957
  )
957
958
 
958
959
 
959
- @shared_task
960
+ @shared_task(queue=Queue.DEFAULT.value)
960
961
  def send_review_report_via_mail(user_id, review_id):
961
962
  user = get_user_model().objects.get(id=user_id)
962
963
  review = Review.objects.get(id=review_id)
@@ -15,6 +15,7 @@ from wbcore.contrib.directory.models import Person
15
15
  from wbcore.contrib.notifications.dispatch import send_notification
16
16
  from wbcore.utils.date import current_month_date_end
17
17
  from wbcore.utils.html import convert_html2text
18
+ from wbcore.workers import Queue
18
19
 
19
20
  from wbhuman_resources.models import KPI, DayOffCalendar, EmployeeHumanResource, Review
20
21
 
@@ -22,7 +23,7 @@ from .models.preferences import get_previous_year_balance_expiration_date
22
23
  from .signals import add_employee_activity_to_daily_brief
23
24
 
24
25
 
25
- @shared_task
26
+ @shared_task(queue=Queue.BACKGROUND.value)
26
27
  def create_future_public_holiday(today: date | None = None, forecast_year: int = 5):
27
28
  if not today:
28
29
  today = date.today()
@@ -31,7 +32,7 @@ def create_future_public_holiday(today: date | None = None, forecast_year: int =
31
32
  calendar.create_public_holidays(year)
32
33
 
33
34
 
34
- @shared_task
35
+ @shared_task(queue=Queue.BACKGROUND.value)
35
36
  def assign_balance(today=None):
36
37
  """
37
38
  Yearly periodic cron tasks that increase for an employee
@@ -46,7 +47,7 @@ def assign_balance(today=None):
46
47
  employee.assign_vacation_allowance_from_range(start_period.date(), end_period.date())
47
48
 
48
49
 
49
- @shared_task
50
+ @shared_task(queue=Queue.BACKGROUND.value)
50
51
  def check_and_warn_user_with_previous_year_available_balance(year=None):
51
52
  """
52
53
  When this task run, it will send a reminder Notification to user with still available balance for the previous year
@@ -69,7 +70,7 @@ def check_and_warn_user_with_previous_year_available_balance(year=None):
69
70
  )
70
71
 
71
72
 
72
- @shared_task
73
+ @shared_task(queue=Queue.BACKGROUND.value)
73
74
  def send_mail_to_accounting():
74
75
  global_preferences = global_preferences_registry.manager()
75
76
  accounting_company_emails = list(
@@ -111,7 +112,7 @@ def send_mail_to_accounting():
111
112
  msg.send()
112
113
 
113
114
 
114
- @shared_task
115
+ @shared_task(queue=Queue.BACKGROUND.value)
115
116
  def daily_automatic_application_deadline():
116
117
  for review in Review.objects.filter(
117
118
  Q(status=Review.Status.FILL_IN_REVIEW) & Q(review_deadline__lte=datetime.now().date())
@@ -150,7 +151,7 @@ def daily_automatic_application_deadline():
150
151
  )
151
152
 
152
153
 
153
- @shared_task
154
+ @shared_task(queue=Queue.BACKGROUND.value)
154
155
  def periodic_updating_kpi_task(kpi_id: list | None = None, start=None, end=None):
155
156
  intervals = {elt.name: KPI.Interval.get_frequence_correspondance(elt.name) for elt in KPI.Interval}
156
157
  for key, value in intervals.items():
@@ -168,7 +169,7 @@ def periodic_updating_kpi_task(kpi_id: list | None = None, start=None, end=None)
168
169
  kpi.generate_evaluation(date_evaluation.date())
169
170
 
170
171
 
171
- @shared_task
172
+ @shared_task(queue=Queue.BACKGROUND.value)
172
173
  def daily_brief(today: date | None = None, **kwargs):
173
174
  """Creates a summary of the daily brief for all internal employees
174
175
  Args:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbhuman_resources
3
- Version: 1.59.4
3
+ Version: 1.59.5
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
@@ -2,7 +2,7 @@ wbhuman_resources/__init__.py,sha256=J-j-u0itpEFT6irdmWmixQqYMadNl1X91TxUmoiLHMI
2
2
  wbhuman_resources/apps.py,sha256=UPXBSjg_i7Zo00IPxMuxV7iYEsY1GWIu217R_ZqEWR8,675
3
3
  wbhuman_resources/dynamic_preferences_registry.py,sha256=Piydi7FVWyzuQK6BDGEVmoP2CyCwqOEJdxgiErsNo4w,4107
4
4
  wbhuman_resources/signals.py,sha256=TASaTxZasod_LPyqDtsn4RLfc9YFnDWSA0v78lIViqM,204
5
- wbhuman_resources/tasks.py,sha256=hE3i9OgoqzI_sjqiiOEyX5yGFvX4nJT9WyWHLYg0teU,7920
5
+ wbhuman_resources/tasks.py,sha256=gWmP5khJFe_FpnvtVSk2tUJ14-GkySw-mz4rP5255f4,8163
6
6
  wbhuman_resources/urls.py,sha256=FfpMuxZejfMt3xVu18WOa2aXC4ht2-MIESRmC_GUuIU,7980
7
7
  wbhuman_resources/utils.py,sha256=EZNxathbV_Azj1XX489X78WDbiNwj6F5FUqBqMrV2sg,1487
8
8
  wbhuman_resources/admin/__init__.py,sha256=hXIquTlOG4HFeeMetc6T1LwNJmFc9HBbtpCAQsgV8oM,113
@@ -44,10 +44,10 @@ 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=tfaHSccffScvRONhFtN4Rgj2QqLUUwm8oySRfWhBq-M,50290
47
+ wbhuman_resources/models/employee.py,sha256=9O39lFx1D-9YGSHCUph3ixqccQQaTsVwjWxfLnMhFwE,50350
48
48
  wbhuman_resources/models/kpi.py,sha256=BrYKb56MKm5Ya0sIav3-jmw0qk4zKNoSRr0bYfNM9mk,7270
49
49
  wbhuman_resources/models/preferences.py,sha256=iQhcu-jrEkk8DgM5hgakg5mdkbtlO11KeJC0QpTBcKI,1432
50
- wbhuman_resources/models/review.py,sha256=QXXckJclht6iAw75_QL6bva4urHeSeUgbu4D_lsmiaw,39414
50
+ wbhuman_resources/models/review.py,sha256=YeQjxIs6uYxemErt1wUM4F4MwrK1SK55PLe3Tm7R-Kw,39582
51
51
  wbhuman_resources/permissions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  wbhuman_resources/permissions/backend.py,sha256=lPIcCLkYG7gqtx7EgGquQrt_yhscZWj2ZGBqOWm8Cww,872
53
53
  wbhuman_resources/serializers/__init__.py,sha256=r-XHaWLkgo0mxxns3cpT_fo9ASWagMW9O26tqmsXtHg,1620
@@ -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.59.4.dist-info/METADATA,sha256=2ZvyGKbaLgU-lseJAxxDHHwgG-9jEmFA-AXkOkyIAXQ,272
110
- wbhuman_resources-1.59.4.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
111
- wbhuman_resources-1.59.4.dist-info/RECORD,,
109
+ wbhuman_resources-1.59.5.dist-info/METADATA,sha256=3vclvM0pniuwIlPhBSYsFA-wh4pT_zXnUW1MBRx-6I0,272
110
+ wbhuman_resources-1.59.5.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
111
+ wbhuman_resources-1.59.5.dist-info/RECORD,,