@@ -503,24 +503,22 @@ class YuthonVacationReports(models.Model):
|
||||
'overtime_ids.public_holidays',
|
||||
'overtime_ids.update_type',
|
||||
'overtime_ids.is_void'
|
||||
'overtime_ids.workflow_record_id'
|
||||
)
|
||||
def _compute_working_overtime(self):
|
||||
for record in self:
|
||||
total_add = 0.0
|
||||
total_reduce = 0.0
|
||||
done_working_overtime = 0.0
|
||||
total_add1 = 0.0
|
||||
for line in record.overtime_ids:
|
||||
if not line.is_void:
|
||||
line_total = (line.workday or 0) + (line.legal_day or 0) + (line.public_holidays or 0)
|
||||
if line.update_type == 'add':
|
||||
if line.update_type == 'add' and line.workflow_record_id:
|
||||
total_add += line_total
|
||||
else:
|
||||
total_add += line_total
|
||||
total_reduce += line_total
|
||||
elif line.update_type == 'reduce':
|
||||
total_add -= line_total
|
||||
done_working_overtime += line_total
|
||||
record.working_overtime = max(total_add / 8, 0)
|
||||
record.done_working_overtime = done_working_overtime / 8
|
||||
record.cop_leave = total_reduce / 8
|
||||
record.done_working_overtime = total_add1 / 8
|
||||
record.cop_leave = total_add1 / 8
|
||||
|
||||
@api.depends('meal_fee_ids.update_lines', 'meal_fee_ids.update_type', 'meal_fee_ids.is_void')
|
||||
def _compute_meal_fee(self):
|
||||
|
||||
Reference in New Issue
Block a user