Skip to content

Commit 96e2f05

Browse files
[ADD] hr-workweek: added new modules
1 parent 6507568 commit 96e2f05

File tree

94 files changed

+6209
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+6209
-0
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# HR Workweek
2+
3+
This repository is designed to manage and track employee workweeks in Odoo. It integrates with the Timesheets module to create workweeks for each employee, allowing for a clear record of worked hours based on the employee's assigned calendar. Additionally, it enables employees to compensate for overtime hours.
4+
5+
## Features
6+
7+
- Automatic creation of workweeks for employees based on their assigned calendar.
8+
- Option for employees to compensate overtime hours by choosing between time off or financial compensation.
9+
- Weekly generated emails: one of them is sent to each employee with their own analytics for the week (hours worked, hours to work and total difference), and the other one is sent only to previously selected users, displaying analytics for all employees sorted by their calendars, excluding any calendars set in the settings.
10+
11+
## Usage
12+
13+
1. Each workweek will be created and displayed in the Timesheets module and in each employee's form.
14+
2. Employees can request a compensation, and their compensation manager will decide whether it is approved or not.
15+
3. Compensation managers can be directly set in the employee's form.
16+
4. There are settings available for the weekly reports, including summary notification recipients and excluded calendars.
17+
18+
## Available addons
19+
20+
| addon | version | summary |
21+
| ------------- |:-------------:| :-----|
22+
| hr_workweek |15.0.1.0.1 | Manage employee workweeks and compensations. |
23+
| hr_workweek_reports |15.0.1.0.1 | Receive weekly emails with analytics. |

hr_workweek/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import wizard

hr_workweek/__manifest__.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "HR Workweek",
3+
"summary": "Per-employee workweek entries with compensation"
4+
" capabilities for due and overtime hours",
5+
"author": "Domatix",
6+
"website": "https://www.domatix.com",
7+
"category": "Human Resources",
8+
"version": "15.0.1.0.0",
9+
"depends": [
10+
"hr_timesheet",
11+
"hr_employee_calendar_planning",
12+
"hr_holidays_public",
13+
],
14+
"data": [
15+
"security/ir.model.access.csv",
16+
"wizard/hr_workweek_wizard_views.xml",
17+
"views/hr_employee_views.xml",
18+
"views/hr_workweek_views.xml",
19+
"views/res_config_settings.xml",
20+
"views/hr_compensation_views.xml",
21+
"data/ir_sequence_data.xml",
22+
"data/workweek_data.xml",
23+
"data/ir_cron.xml",
24+
],
25+
"application": True,
26+
"installable": True,
27+
"license": "AGPL-3",
28+
}
210 Bytes
Binary file not shown.

hr_workweek/data/ir_cron.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<data noupdate="1">
4+
<record id="ir_cron_create_workweek" model="ir.cron">
5+
<field name="name">Employees workweek creation</field>
6+
<field eval="True" name="active" />
7+
<field name="user_id" ref="base.user_root" />
8+
<field name="interval_number">1</field>
9+
<field name="interval_type">weeks</field>
10+
<field name="numbercall">-1</field>
11+
<field eval="False" name="doall" />
12+
<field ref="model_hr_employee" name="model_id" />
13+
<field name="state">code</field>
14+
<field name="code">model.create_current_workweek()</field>
15+
</record>
16+
</data>
17+
</odoo>

hr_workweek/data/ir_sequence_data.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<data noupdate="1">
4+
5+
<!-- Sequences for hr.workweek -->
6+
<record id="seq_hr_workweek" model="ir.sequence">
7+
<field name="name">Workweek Sequence</field>
8+
<field name="code">hr.workweek</field>
9+
<field name="prefix">W/%(woy)s/%(range_year)s/</field>
10+
<field name="padding">3</field>
11+
<field name="use_date_range" eval="True" />
12+
<field name="company_id" eval="False" />
13+
</record>
14+
15+
</data>
16+
</odoo>

hr_workweek/data/workweek_data.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<odoo>
2+
<data>
3+
<record id="assignment_email_template" model="mail.template">
4+
<field name="name">Compensation assignment</field>
5+
<field name="model_id" ref="model_hr_compensation" />
6+
<field
7+
name="email_from"
8+
>{{object.employee_id.user_id.company_id.partner_id.email}}</field>
9+
<field
10+
name="subject"
11+
>{{object.employee_id.user_id.company_id.name} Compensation assignment (Ref ${object.name or 'n/a' }})</field>
12+
<field
13+
name="partner_to"
14+
>{{object.responsible_id.user_id.partner_id.id}}</field>
15+
<field name="email_cc">{{object.employee_id.work_email}}</field>
16+
<field name="auto_delete" eval="False" />
17+
<field name="lang">{{object.employee_id.user_id.partner_id.lang}}</field>
18+
<field name="body_html" type="html">
19+
<p>Hello <t t-out="object.responsible_id.name" />,</p>
20+
<p><t t-out="object.employee_id.name" />'s compensation <t
21+
t-out="object.name"
22+
/> has been assigned to you.</p>
23+
</field>
24+
</record>
25+
</data>
26+
</odoo>

0 commit comments

Comments
 (0)