Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions addons_bp/bp_emp_attendance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# © 2023 bloopark systems (<http://bloopark.de>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from . import wizard
from . import report
35 changes: 35 additions & 0 deletions addons_bp/bp_emp_attendance/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# © 2023 bloopark systems (<http://bloopark.de>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Employee Attendance & Extra Hours",
"sequence": 20,
"version": "1.0.0",
"category": "Human Resources/Attendances",
"author": "bloopark systems GmbH & Co. KG",
"website": "http://www.bloopark.de",
"license": "LGPL-3",
"depends": [
"hr_attendance",
"hr_holidays_attendance",
],
"installable": True,
"auto_install": False,
"application": False,
"data": [
# security files
"security/ir.model.access.csv",
"security/attendance_security.xml",
# Wizard files
"wizard/hr_attendance_extra_hours_wizard.xml",
# Views files
"views/hr_attendance_view.xml",
"views/hr_employee.xml",
"views/hr_leave_views.xml",
"views/hr_attendance_overtime_views.xml",
# Data files
"data/attendance_data.xml",
# Report files
"report/hr_custom_report_attendance_views.xml",
],
"demo": [],
}
203 changes: 203 additions & 0 deletions addons_bp/bp_emp_attendance/data/attendance_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="ir_cron_day_attendance" model="ir.cron" forcecreate="True">
<field name="name">Attendance: notify employee/manager missing day</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="state">code</field>
<field name="code">model.cron_missing_attendance()</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="nextcall"
eval="(DateTime.now().replace(hour=21, minute=59, second=0)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>

<record id="email_template_manager_daily_attendance" model="mail.template">
<field name="name">Manager attendance: Daily attendance check</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="subject">Reminder to log employee manager timesheet</field>
<field name="email_from">{{ (object.user_id.company_id.partner_id.email_formatted or user.email_formatted) }}</field>
<field name="email_to">{{ object.parent_id.work_email }}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 24px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<!-- HEADER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: white; padding: 0; border-collapse:separate;">
<tr>
<td valign="middle">
<span style="font-size: 10px;">Manager timesheet reminder</span>
</td>
<td valign="middle" align="right">
<img t-attf-src="/logo.png?company={{ object.company_id.id }}" style="padding: 0px; margin: 0px; height: 48px;" t-att-alt="object.company_id.name"/>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:4px 0px 32px 0px;"/>
</td>
</tr>
</table>
</td>
</tr>
<!-- CONTENT -->
<tr>
<td style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr>
<td valign="top" style="font-size: 13px;">
<div>
Hi
<span/>
<t t-out="object.parent_id.name"/>,
<br/>
<br/>
I'd like to inform you that"
<span>
<i t-out="object.name or ''"/>
</span>
",
<br/>
who's working in(
<i>
<t t-out="object.department_id.name or ''"/>
</i>
) department, didn't log her/his attendance for today.
<br/>
<br/>
Thanks.
</div>
</td>
</tr>
</table>
</td>
</tr>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px; padding: 0 8px 0 8px; font-size:11px;">
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 4px 0px;"/>
<b t-out="object.company_id.name or ''"/>
<br/>
<div style="color: #999999;">
<t t-out="object.company_id.phone or object.company_id.mobile or ''"></t>
<t t-if="object.company_id.email">
|
<a t-attf-href="'mailto:%s' % {{ object.company_id.email }}" style="text-decoration:none; color: #999999;" t-out="object.company_id.email or ''">info@yourcompany.com</a>
</t>
<t t-if="object.company_id.website">
|
<a t-attf-href="'%s' % {{ object.company_id.website }}" style="text-decoration:none; color: #999999;" t-out="object.company_id.website or ''">http://www.example.com</a>
</t>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</field>
<field name="auto_delete" eval="True"/>
</record>

<record id="email_template_employee_daily_attendance" model="mail.template">
<field name="name">Employee attendance: Daily attendance check</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="subject">Reminder to log employee timesheet</field>
<field name="email_from">{{ (object.user_id.company_id.partner_id.email_formatted or user.email_formatted) }}</field>
<field name="email_to">{{ object.work_email }}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 24px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<!-- HEADER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: white; padding: 0; border-collapse:separate;">
<tr>
<td valign="middle">
<span style="font-size: 10px;">Employee timesheet reminder</span>
</td>
<td valign="middle" align="right">
<img t-attf-src="/logo.png?company={{ object.company_id.id }}" style="padding: 0px; margin: 0px; height: 48px;" t-att-alt="object.company_id.name"/>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:4px 0px 32px 0px;"/>
</td>
</tr>
</table>
</td>
</tr>
<!-- CONTENT -->
<tr>
<td style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr>
<td valign="top" style="font-size: 13px;">
<div>
Hi
<span/>
<t t-out="object.name"/>,
<br/>
<br/>
I'd like to inform you that, you didn't log your attendance for today.
<br/>
Please contact
<i t-out="object.parent_id.name or 'your direct manager'"/>!
<br/>
<br/>
Thanks.
</div>
</td>
</tr>
</table>
</td>
</tr>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px; padding: 0 8px 0 8px; font-size:11px;">
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 4px 0px;"/>
<b t-out="object.company_id.name or ''"/>
<br/>
<div style="color: #999999;">
<t t-out="object.company_id.phone or object.company_id.mobile or ''"></t>
<t t-if="object.company_id.email">
|
<a t-attf-href="'mailto:%s' % {{ object.company_id.email }}" style="text-decoration:none; color: #999999;" t-out="object.company_id.email or ''">info@yourcompany.com</a>
</t>
<t t-if="object.company_id.website">
|
<a t-attf-href="'%s' % {{ object.company_id.website }}" style="text-decoration:none; color: #999999;" t-out="object.company_id.website or ''">http://www.example.com</a>
</t>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</field>
<field name="auto_delete" eval="True"/>
</record>

<record id="update_previous_attendance_action" model="ir.actions.server">
<field name="name">Update Previous Attendance</field>
<field name="model_id" ref="model_hr_employee"/>
<field name="binding_model_id" ref="model_hr_employee"/>
<field name="state">code</field>
<field name="code">action = records._update_previous_attendance_action()</field>
</record>

</data>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# © 2023 bloopark systems (<http://bloopark.de>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import SUPERUSER_ID, api


def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
overtimes = env["hr.attendance.overtime"].search([])
overtimes._compute_overtime_data()
overtimes.action_update_day_overtime()
7 changes: 7 additions & 0 deletions addons_bp/bp_emp_attendance/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# © 2023 bloopark systems (<http://bloopark.de>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import employee_attendance
from . import hr_employee
from . import attendance_overtime
from . import hr_leave
Loading
Loading