commit
493847f148
|
|
@ -408,6 +408,7 @@ class HrOfficialMission(models.Model):
|
||||||
else:
|
else:
|
||||||
line.hours = (line.hour_to - line.hour_from)
|
line.hours = (line.hour_to - line.hour_from)
|
||||||
line.total_hours = line.hours * line.days
|
line.total_hours = line.hours * line.days
|
||||||
|
print("11111111111")
|
||||||
if item.mission_type.related_with_financial is True:
|
if item.mission_type.related_with_financial is True:
|
||||||
if item.mission_type.type_of_payment == 'fixed':
|
if item.mission_type.type_of_payment == 'fixed':
|
||||||
if item.mission_type.hour_price:
|
if item.mission_type.hour_price:
|
||||||
|
|
@ -1365,7 +1366,17 @@ class HrOfficialMissionEmployee(models.Model):
|
||||||
weekend_names = [d.name.lower() for d in weekend_days]
|
weekend_names = [d.name.lower() for d in weekend_days]
|
||||||
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
||||||
|
|
||||||
item.days = len(date_range)
|
|
||||||
|
if not item.official_mission_id.table_ids:
|
||||||
|
|
||||||
|
item.days = len(date_range)
|
||||||
|
else:
|
||||||
|
|
||||||
|
unique_dates = set(item.official_mission_id.table_ids.mapped('date'))
|
||||||
|
item.days = len(unique_dates)
|
||||||
|
print(item.days)
|
||||||
|
print(item.days)
|
||||||
|
# item.days = len(date_range)
|
||||||
else:
|
else:
|
||||||
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
||||||
else:
|
else:
|
||||||
|
|
@ -1386,7 +1397,18 @@ class HrOfficialMissionEmployee(models.Model):
|
||||||
weekend_names = [d.name.lower() for d in weekend_days]
|
weekend_names = [d.name.lower() for d in weekend_days]
|
||||||
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
||||||
|
|
||||||
item.days = len(date_range)
|
print("pppppppp00")
|
||||||
|
print(date_range)
|
||||||
|
if not item.official_mission_id.table_ids:
|
||||||
|
print("55555555556")
|
||||||
|
item.days = len(date_range)
|
||||||
|
else:
|
||||||
|
print("kkkffld")
|
||||||
|
unique_dates = set(item.official_mission_id.table_ids.mapped('date'))
|
||||||
|
item.days = len(unique_dates)
|
||||||
|
print(item.days)
|
||||||
|
print(item.days)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
||||||
|
|
||||||
|
|
@ -1405,6 +1427,8 @@ class HrOfficialMissionEmployee(models.Model):
|
||||||
else:
|
else:
|
||||||
item.hours = (item.hour_to - item.hour_from)
|
item.hours = (item.hour_to - item.hour_from)
|
||||||
item.total_hours = item.hours * item.days
|
item.total_hours = item.hours * item.days
|
||||||
|
print("22222222222")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
item.hour_from = item.official_mission_id.hour_from
|
item.hour_from = item.official_mission_id.hour_from
|
||||||
item.hour_to = item.official_mission_id.hour_to
|
item.hour_to = item.official_mission_id.hour_to
|
||||||
|
|
@ -1416,6 +1440,7 @@ class HrOfficialMissionEmployee(models.Model):
|
||||||
item.hours = (item.hour_to - item.hour_from)
|
item.hours = (item.hour_to - item.hour_from)
|
||||||
item.total_hours = item.hours * item.days
|
item.total_hours = item.hours * item.days
|
||||||
|
|
||||||
|
|
||||||
# compute day_price , hour_price and amount
|
# compute day_price , hour_price and amount
|
||||||
|
|
||||||
@api.onchange('hour_from', 'hour_to', 'hours', 'date_from', 'date_to', 'days', 'employee_id', 'day_price',
|
@api.onchange('hour_from', 'hour_to', 'hours', 'date_from', 'date_to', 'days', 'employee_id', 'day_price',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue