168 lines
9.3 KiB
XML
168 lines
9.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo noupdate="1">
|
|
|
|
<!-- Employee Individual Report Email -->
|
|
<record id="mail_template_clock_employee_report" model="mail.template">
|
|
<field name="name">Fusion Clock: Employee Report</field>
|
|
<field name="model_id" ref="fusion_clock.model_fusion_clock_report"/>
|
|
<field name="subject">Your Attendance Report - {{ object.date_start }} to {{ object.date_end }}</field>
|
|
<field name="email_from">{{ (object.company_id.email or user.email_formatted) }}</field>
|
|
<field name="email_to">{{ object.employee_id.work_email or '' }}</field>
|
|
<field name="body_html"><![CDATA[
|
|
<div style="margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;">
|
|
<table width="600" style="margin:0 auto;background:#ffffff;border:1px solid #e0e0e0;border-radius:8px;">
|
|
<tr>
|
|
<td style="padding:24px 32px;background:#1a1d23;border-radius:8px 8px 0 0;">
|
|
<h2 style="color:#10B981;margin:0;">Fusion Clock</h2>
|
|
<p style="color:#9ca3af;margin:4px 0 0;">Attendance Report</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:24px 32px;">
|
|
<p>Hello <strong>{{ object.employee_id.name }}</strong>,</p>
|
|
<p>Your attendance report for the period <strong>{{ object.date_start }}</strong> to <strong>{{ object.date_end }}</strong> is ready.</p>
|
|
|
|
<table width="100%" style="margin:16px 0;border-collapse:collapse;">
|
|
<tr style="background:#f8f9fa;">
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Days Worked</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ object.days_worked }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Total Hours</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ '%.1f' % object.total_hours }}h</td>
|
|
</tr>
|
|
<tr style="background:#f8f9fa;">
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Net Hours</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ '%.1f' % object.net_hours }}h</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Total Breaks</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ '%.0f' % object.total_breaks }} min</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>The full PDF report is attached. You can also download it from your portal at any time.</p>
|
|
<p style="color:#6b7280;font-size:12px;">This is an automated message from Fusion Clock.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
]]></field>
|
|
<field name="report_template_ids" eval="[(4, ref('fusion_clock.action_report_clock_employee'))]"/>
|
|
<field name="auto_delete" eval="False"/>
|
|
</record>
|
|
|
|
<!-- Batch Report Email (to managers) -->
|
|
<record id="mail_template_clock_batch_report" model="mail.template">
|
|
<field name="name">Fusion Clock: Batch Report</field>
|
|
<field name="model_id" ref="fusion_clock.model_fusion_clock_report"/>
|
|
<field name="subject">Employee Attendance Batch Report - {{ object.date_start }} to {{ object.date_end }}</field>
|
|
<field name="email_from">{{ (object.company_id.email or user.email_formatted) }}</field>
|
|
<field name="email_to">{{ (object.company_id.sudo().env['ir.config_parameter'].get_param('fusion_clock.report_recipient_emails') or '') }}</field>
|
|
<field name="body_html"><![CDATA[
|
|
<div style="margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;">
|
|
<table width="600" style="margin:0 auto;background:#ffffff;border:1px solid #e0e0e0;border-radius:8px;">
|
|
<tr>
|
|
<td style="padding:24px 32px;background:#1a1d23;border-radius:8px 8px 0 0;">
|
|
<h2 style="color:#10B981;margin:0;">Fusion Clock</h2>
|
|
<p style="color:#9ca3af;margin:4px 0 0;">Batch Attendance Report</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:24px 32px;">
|
|
<p>The attendance batch report for <strong>{{ object.date_start }}</strong> to <strong>{{ object.date_end }}</strong> is attached.</p>
|
|
<p>This report includes all employees' attendance summaries with daily breakdowns, total hours, and penalty information.</p>
|
|
<p style="color:#6b7280;font-size:12px;">This is an automated message from Fusion Clock.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
]]></field>
|
|
<field name="report_template_ids" eval="[(4, ref('fusion_clock.action_report_clock_batch'))]"/>
|
|
<field name="auto_delete" eval="False"/>
|
|
</record>
|
|
|
|
<!-- Weekly Summary Email -->
|
|
<record id="mail_template_weekly_summary" model="mail.template">
|
|
<field name="name">Fusion Clock: Weekly Summary</field>
|
|
<field name="model_id" ref="hr.model_hr_employee"/>
|
|
<field name="subject">Your Weekly Attendance Summary</field>
|
|
<field name="email_from">{{ (object.company_id.email or user.email_formatted) }}</field>
|
|
<field name="email_to">{{ object.work_email or '' }}</field>
|
|
<field name="body_html"><![CDATA[
|
|
<div style="margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;">
|
|
<table width="600" style="margin:0 auto;background:#ffffff;border:1px solid #e0e0e0;border-radius:8px;">
|
|
<tr>
|
|
<td style="padding:24px 32px;background:#1a1d23;border-radius:8px 8px 0 0;">
|
|
<h2 style="color:#10B981;margin:0;">Fusion Clock</h2>
|
|
<p style="color:#9ca3af;margin:4px 0 0;">Weekly Summary</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:24px 32px;">
|
|
<p>Hello <strong>{{ object.name }}</strong>,</p>
|
|
<p>Here is your attendance summary for the past week:</p>
|
|
|
|
<table width="100%" style="margin:16px 0;border-collapse:collapse;">
|
|
<tr style="background:#f8f9fa;">
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Total Hours</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ ctx.get('total_hours', 0) }}h</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Overtime</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ ctx.get('overtime_hours', 0) }}h</td>
|
|
</tr>
|
|
<tr style="background:#f8f9fa;">
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Penalties</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ ctx.get('penalty_count', 0) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>Absences</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ ctx.get('absence_count', 0) }}</td>
|
|
</tr>
|
|
<tr style="background:#f8f9fa;">
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;"><strong>On-Time Streak</strong></td>
|
|
<td style="padding:8px 12px;border:1px solid #e0e0e0;">{{ ctx.get('streak', 0) }} days</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>Log in to <a href="/my/clock">your portal</a> to view details.</p>
|
|
<p style="color:#6b7280;font-size:12px;">This is an automated message from Fusion Clock.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
]]></field>
|
|
<field name="auto_delete" eval="False"/>
|
|
</record>
|
|
|
|
<!-- Correction Request Notification -->
|
|
<record id="mail_template_correction_request" model="mail.template">
|
|
<field name="name">Fusion Clock: Correction Request</field>
|
|
<field name="model_id" ref="fusion_clock.model_fusion_clock_correction"/>
|
|
<field name="subject">Timesheet Correction Request: {{ object.employee_id.name }}</field>
|
|
<field name="email_from">{{ (object.company_id.email or user.email_formatted) }}</field>
|
|
<field name="body_html"><![CDATA[
|
|
<div style="margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;">
|
|
<table width="600" style="margin:0 auto;background:#ffffff;border:1px solid #e0e0e0;border-radius:8px;">
|
|
<tr>
|
|
<td style="padding:24px 32px;background:#1a1d23;border-radius:8px 8px 0 0;">
|
|
<h2 style="color:#10B981;margin:0;">Fusion Clock</h2>
|
|
<p style="color:#9ca3af;margin:4px 0 0;">Correction Request</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:24px 32px;">
|
|
<p><strong>{{ object.employee_id.name }}</strong> has submitted a timesheet correction request.</p>
|
|
<p><strong>Reason:</strong> {{ object.reason }}</p>
|
|
<p>Please review and approve/reject from the Fusion Clock backend.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
]]></field>
|
|
<field name="auto_delete" eval="False"/>
|
|
</record>
|
|
|
|
</odoo>
|