Skip to content

Commit

Permalink
*: Fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella authored and xaviedoanhduy committed Oct 3, 2024
1 parent e216522 commit 53fa8b5
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hr_holidays_public/views/hr_holidays_public_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<field name="name">hr.holidays.public.form</field>
<field name="model">hr.holidays.public</field>
<field name="arch" type="xml">
<form string="Public Holidays">
<form>
<group name="group_main">
<group name="group_main_left">
<field name="year" options="{'type': 'number'}" />
Expand Down
107 changes: 107 additions & 0 deletions hr_holidays_summary_email/data/mail_template_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" ?>
<odoo noupdate="1">
<record id="hr_holidays_summary_mail_template_daily" model="mail.template">
<field name="name">Leaves Summary: Daily</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="subject">Daily Leaves Summary</field>
<field name="email_to">${object.work_email | safe}</field>
<field
name="email_from"
>${object.company_id.partner_id.email_formatted | safe}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p>Dear ${object.name},</p>
<br />
<p>This is today's leave summary:</p>
<br />
<table
style="border-spacing: 0; border-collapse: collapse; width: 100%; text-align: center;"
>
<tr>
<th
style="padding: 5px; border: 1px solid black;"
>Employee</th>
<th
style="padding: 5px; border: 1px solid black;"
>Time Off</th>
<th style="padding: 5px; border: 1px solid black;">From</th>
<th style="padding: 5px; border: 1px solid black;">To</th>
</tr>
% set timeoffs = ctx.get('time_offs', False)
% for data in timeoffs
% set d_from = data.format_hr_leave_summary_date()
% set d_to = data.format_hr_leave_summary_date(False)
<tr>
<td
style="padding: 5px; border: 1px solid black;"
>${data.employee_id.name}</td>
<td
style="padding: 5px; border: 1px solid black;"
>${data.name or ''}</td>
<td
style="padding: 5px; border: 1px solid black;"
>${d_from}</td>
<td
style="padding: 5px; border: 1px solid black;"
>${d_to}</td>
</tr>
% endfor
</table>
</div>
</field>
<field name="lang">${object.lang}</field>
<field name="auto_delete" eval="True" />
</record>
<record id="hr_holidays_summary_mail_template_weekly" model="mail.template">
<field name="name">Leaves Summary: Weekly</field>
<field name="model_id" ref="hr.model_hr_employee" />
<field name="subject">Weekly Leaves Summary</field>
<field name="email_to">${object.work_email | safe}</field>
<field
name="email_from"
>${object.company_id.partner_id.email_formatted | safe}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p>Dear ${object.name},</p>
<br />
<p>This is the leaves summary for this week:</p>
<br />
<table
style="border-spacing: 0; border-collapse: collapse; width: 100%; text-align: center;"
>
<tr>
<th
style="padding: 5px; border: 1px solid black;"
>Employee</th>
<th
style="padding: 5px; border: 1px solid black;"
>Time Off</th>
<th style="padding: 5px; border: 1px solid black;">From</th>
<th style="padding: 5px; border: 1px solid black;">To</th>
</tr>
% set timeoffs = ctx.get('time_offs', False)
% for data in timeoffs
% set d_from = data.format_hr_leave_summary_date()
% set d_to = data.format_hr_leave_summary_date(False)
<tr>
<td
style="padding: 5px; border: 1px solid black;"
>${data.employee_id.name}</td>
<td
style="padding: 5px; border: 1px solid black;"
>${data.name or ''}</td>
<td
style="padding: 5px; border: 1px solid black;"
>${d_from}</td>
<td
style="padding: 5px; border: 1px solid black;"
>${d_to}</td>
</tr>
% endfor
</table>
</div>
</field>
<field name="lang">${object.lang}</field>
<field name="auto_delete" eval="True" />
</record>
</odoo>

0 comments on commit 53fa8b5

Please sign in to comment.