date req
This commit is contained in:
parent
273d28d4be
commit
f88c2e7603
|
|
@ -278,6 +278,7 @@ class HrOfficialMission(models.Model):
|
|||
end_mission_date = datetime.strptime(str(item.date_to), "%Y-%m-%d")
|
||||
|
||||
if not item.table_ids:
|
||||
print("khgggggg")
|
||||
if end_mission_date >= start_mission_date:
|
||||
if not item.table_ids:
|
||||
days = (end_mission_date - start_mission_date).days
|
||||
|
|
@ -310,6 +311,7 @@ class HrOfficialMission(models.Model):
|
|||
raise exceptions.Warning(
|
||||
_('mission duration must be less than "%s" maximum days in mission type "%s" ') % (
|
||||
item.mission_type.maximum_days, item.mission_type.name))
|
||||
|
||||
else:
|
||||
unique_dates = set(item.table_ids.mapped('date'))
|
||||
item.date_duration = len(unique_dates)
|
||||
|
|
@ -365,10 +367,13 @@ class HrOfficialMission(models.Model):
|
|||
d.strftime('%A').lower() not in weekend_names]
|
||||
|
||||
if not item.table_ids:
|
||||
print("55555555556")
|
||||
line.days = len(date_range)
|
||||
else:
|
||||
unique_dates = set(item.table_ids.mapped('date'))
|
||||
line.days = len(unique_dates)
|
||||
print("555ooooo")
|
||||
print(line.days)
|
||||
if item.mission_type.related_with_financial is True:
|
||||
if item.mission_type.type_of_payment == 'fixed':
|
||||
if item.mission_type.day_price:
|
||||
|
|
@ -422,7 +427,8 @@ class HrOfficialMission(models.Model):
|
|||
def re_compute(self):
|
||||
self.employee_ids.compute_Training_cost_emp()
|
||||
self.employee_ids.compute_day_price()
|
||||
self.employee_ids.compute_number_of_days()
|
||||
if not self.table_ids:
|
||||
self.employee_ids.compute_number_of_days()
|
||||
self.employee_ids.compute_number_of_hours()
|
||||
return True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue