Merge pull request #2685 from expsa/bakry_hr3

fix
This commit is contained in:
bakry 2025-03-17 12:57:41 +03:00 committed by GitHub
commit ee19e9f7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -425,7 +425,8 @@ class HrTermination(models.Model):
# itemss.net -= abs(itemss.total_loans)
# for item in self:
# Make the maximum paid duration is 30
_, number_of_days = calendar.monthrange(self.last_work_date.year, self.last_work_date.month)
if self.last_work_date:
_, number_of_days = calendar.monthrange(self.last_work_date.year, self.last_work_date.month)
if self.paid_duration > 0:
if number_of_days == 31:
duration_percentage = 31 / self.paid_duration