Merge pull request #3345 from expsa/hr_rep_mod

land ,port
This commit is contained in:
eslamtalaat744 2025-05-29 10:03:34 +03:00 committed by GitHub
commit e57104b8d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 9 deletions

View File

@ -63,16 +63,15 @@ class AttendancesReport(models.TransientModel):
if not self.employee_ids:
raise ValidationError(_("Please select Employees Name"))
if self.print_totals_only:
report_ref = (
"attendances.action_totals_only_attendance_report"
)
else:
report_ref = (
"attendances.action_general_attendance_report"
)
if self.print_totals_only == True:
return self.env.ref(report_ref).report_action(self, data=self._payload())
return self.env.ref("attendances.action_totals_only_attendance_report").report_action(self, data=self._payload())
else:
return self.env.ref("attendances.action_general_attendance_report").report_action(self, data=self._payload())
# return self.env.ref(report_ref).report_action(self, data=self._payload())
def print_excel_report(self):
return self.env.ref("attendances.general_attendance_action_xls").report_action(self, data=self._payload(), config=False)