OVT Overtime code total_hour = 0 over_time = 0 try: for rec in payslip.worked_days_line_ids: if rec.name == 'Overtime Hours': over_time += rec.number_of_hours if rec.name == 'Normal Working Days paid at 100%': total_hour += rec.number_of_hours overtime_timesheet = ((contract.wage / total_hour) * over_time) except: overtime_timesheet = 0 result = overtime_timesheet overtime = (Wage(in contract) / Total Hour in normal working hour) * Total Overtime Hours