emp reporttt

This commit is contained in:
blackbelts 2025-05-28 14:43:58 +03:00
parent ffbd5f8b2b
commit 55b4855d11
2 changed files with 54 additions and 20 deletions

View File

@ -357,25 +357,25 @@
<!-- </div>-->
<!-- </div>-->
<!-- <div class="d-flex justify-content-center" style="gap: 50px; text-align: center;">-->
<!-- <div>-->
<!-- <h4 style="font-weight: bold;">من تاريخ</h4>-->
<!-- <t t-esc="date_start"/>-->
<!-- </div>-->
<!-- <div>-->
<!-- <h4 style="font-weight: bold;">إلى</h4>-->
<!-- <t t-esc="date_end"/>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="d-flex justify-content-center" style="gap: 50px; text-align: center;">-->
<!-- <div>-->
<!-- <h4 style="font-weight: bold;">من تاريخ</h4>-->
<!-- <t t-esc="date_start"/>-->
<!-- </div>-->
<!-- <div>-->
<!-- <h4 style="font-weight: bold;">إلى</h4>-->
<!-- <t t-esc="date_end"/>-->
<!-- </div>-->
<!-- </div>-->
<div style="text-align: center; font-weight: bold; font-size: 16px;">
من تاريخ : <span style="font-weight: normal;"><t t-esc="date_start"/></span>
&#160;&#160;&#160;&#160;&#160; <!-- adds space between the two -->
&#160;&#160;&#160;&#160;&#160; <!-- adds space between the two -->
إلى : <span style="font-weight: normal;"><t t-esc="date_end"/></span>
</div>
<table class="table table-condensed" style="width:100%">
<thead style="width:100%;">
<tr style="width:100%;text-align:center; background-color: green; ">
<tr style="width:100%;text-align:center; background-color: #b9d7d4 ">
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الرقم الوظيفي</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">اسم الموظف</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">الدوام</th>
@ -473,21 +473,40 @@
</t>
</template>
<!-- <record id="general_attendance_action_report" model="ir.actions.report">-->
<!-- <field name="model">employee.attendance.report</field>-->
<!-- <field name="name">Attendance Report</field>-->
<!-- <field name="report_type">qweb-pdf</field>-->
<!-- <field name="report_name">attendances.general_attendances_report_temp</field>-->
<!-- </record>-->
<record id="general_attendance_action_reportt" model="ir.actions.report">
<!-- <record id="general_attendance_action_reportt" model="ir.actions.report">-->
<!-- <field name="model">employee.attendance.report</field>-->
<!-- <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_attendance_landscapee"/>-->
<!-- </record>-->
<record id="action_totals_only_attendance_report" model="ir.actions.report">
<field name="model">employee.attendance.report</field>
<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_attendance_landscapee"/>
<!-- <field name="context">{'totals_only': True}</field>-->
</record>
<record id="action_general_attendance_report" model="ir.actions.report">
<field name="model">employee.attendance.report</field>
<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="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

@ -51,10 +51,25 @@ class AttendancesReport(models.TransientModel):
},
}
# report_action = 'attendances.action_totals_only_attendance_report' if self.totals_only else 'attendances.action_general_attendance_report'
# return self.env.ref(report_action).report_action(self)
# def print_report(self):
# if not self.employee_ids:
# raise ValidationError(_("Please select Employees Name"))
# return self.env.ref("attendances.general_attendance_action_reportt").report_action(self, data=self._payload())
def print_report(self):
if not self.employee_ids:
raise ValidationError(_("Please select Employees Name"))
return self.env.ref("attendances.general_attendance_action_reportt").report_action(self, data=self._payload())
report_ref = (
"attendances.action_totals_only_attendance_report"
if self.print_totals_only
else "attendances.action_general_attendance_report"
)
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)