Merge pull request #1797 from expsa/zen_is_absent

fix two Missed Punch
This commit is contained in:
mazenmuhamad 2024-11-21 09:37:01 +02:00 committed by GitHub
commit f2b3fe36b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 73 additions and 38 deletions

View File

@ -13,6 +13,7 @@
'security/attendance_security.xml',
'security/ir.model.access.csv',
'data/ir_cron.xml',
'data/mail_template.xml',
'views/hr_attendance_report.xml',
'views/hr_attendance_transactions.xml',
'views/hr_lateness_reasons.xml',

View File

@ -21,43 +21,41 @@
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
</record>
<record id="attendance_notification_email_template" model="mail.template">
<field name="name">Attendance Notification Email Template</field>
<field name="subject">Attendance Report</field>
<field name="email_from">${object.employee_id.work_email}</field>
<field name="model_id" ref="attendances.model_hr_attendance_transaction"/>
<field name="email_to">${object.email}</field>
<field name="lang">${object.lang}</field>
<field name="auto_delete" eval="False"/>
<field name="body_html">
<![CDATA[
<p>Dear ${object.employee_id.name},</p>
<p>We would like to inform you of the following attendance details:</p>
<table border="1" style="width:100%; border-collapse: collapse;">
<tr>
<th>Date</th>
<th>Day</th>
<th>Lateness</th>
<th>Early Exit</th>
<th>Note</th>
</tr>
<tr>
<td>${object.date.strftime('%Y-%m-%d')}</td>
<td>${object.date.strftime('%A')}</td>
<td>
<t t-esc="('00:00:00' if not object.lateness else '{:02}:{:02}:{:02}'.format(int(object.lateness // 60), int(object.lateness % 60), 0))"/>
</td>
<td>
<t t-esc="('00:00:00' if not object.early_exit else '{:02}:{:02}:{:02}'.format(int(object.early_exit // 60), int(object.early_exit % 60), 0))"/>
</td>
<td>
${'Missed Punch' if (not object.sign_in or not object.sign_out) else ('Absent' if object.is_absent else 'Present')}
</td>
</tr>
</table>
<p>Please adhere to work timings. Thank you for your understanding.</p>
]]>
</field>
</record>
<!-- <record id="attendance_notification_email_template" model="mail.template">-->
<!-- <field name="name">Attendance Notification Email Template</field>-->
<!-- <field name="subject">Attendance Report</field>-->
<!-- <field name="email_from">${object.employee_id.work_email}</field>-->
<!-- <field name="model_id" ref="attendances.model_hr_attendance_transaction"/>-->
<!-- <field name="email_to">${object.email}</field>-->
<!-- <field name="lang">${object.lang}</field>-->
<!-- <field name="auto_delete" eval="False"/>-->
<!-- <field name="body_html">-->
<!-- <![CDATA[-->
<!-- <p>Dear ${object.employee_id.name},</p>-->
<!-- <p>We would like to inform you of the following attendance details:</p>-->
<!-- <table border="1" style="width:100%; border-collapse: collapse;">-->
<!-- <tr>-->
<!-- <th>Date</th>-->
<!-- <th>Day</th>-->
<!-- <th>Lateness</th>-->
<!-- <th>Early Exit</th>-->
<!-- <th>Note</th>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td>${object.date.strftime('%Y-%m-%d')}</td>-->
<!-- <td>${object.date.strftime('%A')}</td>-->
<!-- <td>${'00:00:00' if not object.lateness else object.lateness.strftime('%H:%M:%S')}</td>-->
<!-- <td>${'00:00:00' if not object.early_exit else object.early_exit.strftime('%H:%M:%S')}</td>-->
<!-- <td>-->
<!-- ${'Missed Punch' if (not object.sign_in or not object.sign_out) else ('Absent' if object.is_absent else 'Present')}-->
<!-- </td>-->
<!-- </tr>-->
<!-- </table>-->
<!-- <p>Please adhere to work timings. Thank you for your understanding.</p>-->
<!-- ]]>-->
<!-- </field>-->
<!-- </record>-->
</data>
</odoo>

View File

@ -0,0 +1,36 @@
<odoo>
<record id="attendance_notification_email_template" model="mail.template">
<field name="name">Attendance Notification Email Template</field>
<field name="subject">Attendance Report</field>
<field name="email_from">${object.employee_id.work_email}</field>
<field name="model_id" ref="attendances.model_hr_attendance_transaction"/>
<field name="email_to">${object.email}</field>
<field name="lang">${object.lang}</field>
<field name="auto_delete" eval="False"/>
<field name="body_html">
<![CDATA[
<p>Dear ${object.employee_id.name},</p>
<p>We would like to inform you of the following attendance details:</p>
<table border="1" style="width:100%; border-collapse: collapse;">
<tr>
<th>Date</th>
<th>Daya</th>
<th>Lateness</th>
<th>Early Exit</th>
<th>Note</th>
</tr>
<tr>
<td>${object.date.strftime('%Y-%m-%d')}</td>
<td>${object.date.strftime('%A')}</td>
<td>${'00:00:00' if not object.lateness else object.lateness.strftime('%H:%M:%S')}</td>
<td>${'00:00:00' if not object.early_exit else object.early_exit.strftime('%H:%M:%S')}</td>
<td>
${'Missed Punch' if (not object.sign_in or not object.sign_out) else ('Absent' if object.is_absent else 'Present')}
</td>
</tr>
</table>
<p>Please adhere to work timings. Thank you for your understanding.</p>
]]>
</field>
</record>
</odoo>