Merge pull request #3343 from expsa/hr_rep_mod

land ,port
This commit is contained in:
eslamtalaat744 2025-05-29 09:40:29 +03:00 committed by GitHub
commit a9bdbe1620
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 8 deletions

View File

@ -17,6 +17,23 @@
</record>
<record id="paperformat_euro_lowmarginn" model="report.paperformat">
<field name="name">A4 low margin</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">5</field>
<field name="margin_bottom">5</field>
<field name="margin_left">5</field>
<field name="margin_right">5</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">0</field>
<field name="dpi">80</field>
</record>
<template id="employee_attendance_report_template">
<div class="page" style="font-size:17pt">
<center>
@ -490,7 +507,7 @@
<field name="report_type">qweb-pdf</field>
<field name="report_name">attendances.general_attendances_report_temp</field>
<field name="paperformat_id" ref="attendances.paperformat_attendance_landscapee"/>
<!-- <field name="context">{'totals_only': True}</field>-->
</record>
@ -499,14 +516,13 @@
<field name="name">Attendance Report</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">attendances.general_attendances_report_temp</field>
<field name="paperformat_id" ref="attendances.paperformat_euro_lowmarginn"/>
<!-- <field name="context">{'totals_only': False}</field>-->
</record>
<record id="general_attendance_action_xls" model="ir.actions.report">
<field name="model">employee.attendance.report</field>
<field name="name">Print to XLSX</field>

View File

@ -63,11 +63,14 @@ class AttendancesReport(models.TransientModel):
if not self.employee_ids:
raise ValidationError(_("Please select Employees Name"))
report_ref = (
"attendances.action_totals_only_attendance_report"
if self.print_totals_only
else "attendances.action_general_attendance_report"
)
if self.print_totals_only:
report_ref = (
"attendances.action_totals_only_attendance_report"
)
else:
report_ref = (
"attendances.action_general_attendance_report"
)
return self.env.ref(report_ref).report_action(self, data=self._payload())