@ -0,0 +1,57 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Employee Orientation & Training |
|||
================= |
|||
This module developed to manage employee orientation & training programs. |
|||
|
|||
Configuration |
|||
============= |
|||
No additional configuration required |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
GNU Affero General Public License v3.0 (AGPL v3) |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developers: |
|||
Anusha @cybrosys, |
|||
(V11) Niyas @cybrosys, |
|||
(V12) Kavya Raveendran, |
|||
(V13) Nimisha Murali, |
|||
(V14) Muhammed P, |
|||
(V15) Gion, |
|||
(V16) Sabeel B, |
|||
(V17) Jumana Haseen, |
|||
(V18) Rosmy John, |
|||
Contact : odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if |
|||
your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
|||
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import models |
|||
from . import wizard |
|||
@ -0,0 +1,54 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
{ |
|||
'name': "Employee Orientation & Training", |
|||
'version': '18.0.1.0.0', |
|||
'category': "Human Resources", |
|||
'summary': """Employee Orientation/Training Program Employee orientation by |
|||
which an employee acquires the necessary skills,knowledge, behaviors.""", |
|||
'description': 'Complete Employee Orientation/Training Program acquire ' |
|||
'the necessary skills,knowledge, behaviors, and contacts to' |
|||
' effectively transition into a new organization.', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['base', 'hr'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'data/employee_training_data.xml', |
|||
'data/orientation_request_data.xml', |
|||
'data/employee_orientation_data.xml', |
|||
'views/checklist_line_views.xml', |
|||
'views/employee_orientation_views.xml', |
|||
'views/employee_training_views.xml', |
|||
'views/orientation_checklist_views.xml', |
|||
'views/orientation_request_views.xml', |
|||
'report/print_pack_certificates_templates.xml', |
|||
'report/print_pack_certificates_report.xml', |
|||
'wizard/orientation_force_complete_views.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Sequences for employee.orientation --> |
|||
<record id="seq_orientation_checklist" model="ir.sequence"> |
|||
<field name="name">Employee Orientation</field> |
|||
<field name="code">employee.orientation</field> |
|||
<field name="prefix">OR</field> |
|||
<field name="padding">3</field> |
|||
<field name="company_id" eval="False"/> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
@ -0,0 +1,79 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Employee training mail format--> |
|||
<record id="orientation_training_mailer" model="mail.template"> |
|||
<field name="name">Employee Training program</field> |
|||
<field name="email_from">{{(object.user_id.email or |
|||
object.company_id.email)}} |
|||
</field> |
|||
<field name="email_to">{{(object.program_convener_id.login)}} |
|||
</field> |
|||
<field name="subject">Employee Training Request</field> |
|||
<field name="model_id" ref="employee_orientation.model_employee_training"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="body_html" type="html"> |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, |
|||
Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); |
|||
background-color: #FFF; "> |
|||
<p> |
|||
Hello |
|||
<t t-out="object.program_convener_id.name"/>, |
|||
</p> |
|||
<p> |
|||
You are requested to conduct |
|||
<t t-out="object.program_name"/> |
|||
Training program for |
|||
<t t-out="object.program_department_id.name"/> |
|||
department |
|||
<t t-if=" object.date_from and object.date_to"> |
|||
from |
|||
<t t-out="object.date_from"/> |
|||
to |
|||
<t t-out="object.date_to"/> |
|||
</t> |
|||
. |
|||
</p> |
|||
<br/> |
|||
<p> |
|||
Thank you! |
|||
</p> |
|||
<br/> |
|||
<div style="width: 375px; margin: 0px; padding: 0px; |
|||
background-color: #8E0000; border-top-left-radius: 5px 5px; |
|||
border-top-right-radius: 5px 5px; |
|||
background-repeat: repeat no-repeat;"> |
|||
<h3 style="margin: 0px; padding: 2px 14px; |
|||
font-size: 12px; color: #DDD;"> |
|||
<strong style="text-transform:uppercase;"> |
|||
<t t-out="object.company_id.name"/> |
|||
</strong> |
|||
</h3> |
|||
</div> |
|||
<div style="width: 347px; margin: 0px; padding: 5px 14px; |
|||
line-height: 16px; background-color: #F2F2F2;"> |
|||
<span style="color: #222; margin-bottom: 5px; display: block; "> |
|||
</span> |
|||
<t t-if=" object.company_id.phone"> |
|||
<div style="margin-top: 0px; margin-right: 0px; |
|||
margin-bottom: 0px; margin-left: 0px; |
|||
padding-top: 0px; padding-right: 0px; |
|||
padding-bottom: 0px; padding-left: 0px; "> |
|||
Phone: |
|||
<t t-out="object.company_id.phone"/> |
|||
</div> |
|||
</t> |
|||
<t t-if=" object.company_id.website"> |
|||
<div> |
|||
Web : |
|||
<a href="'%s' % object.company_id.website"> |
|||
<t t-out="object.company_id.website"/> |
|||
</a> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
@ -0,0 +1,83 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Employee orientation request mail format --> |
|||
<record id="orientation_request_view" model="mail.template"> |
|||
<field name="name">Employee Orientation Request</field> |
|||
<field name="email_from">{{(object.user_id.login or |
|||
object.company_id.email)}} |
|||
</field> |
|||
<field name="email_to">{{(object.partner_id.work_email)}}</field> |
|||
<field name="subject">Employee Orientation Request</field> |
|||
<field name="model_id" |
|||
ref="employee_orientation.model_orientation_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="body_html" type="html"> |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, |
|||
Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); |
|||
background-color: #FFF; "> |
|||
<p style="margin: 0px; padding: 0px; font-size: 13px;"> |
|||
Hello |
|||
<t t-out="object.partner_id.name"/>, |
|||
</p> |
|||
<p> |
|||
You are requested to conduct orientation program listed |
|||
below. |
|||
</p> |
|||
<p> |
|||
Check Line: |
|||
<t t-out="object.request_name"/> |
|||
</p> |
|||
<p> |
|||
Employee: |
|||
<t t-out="object.employee_id.name"/> |
|||
</p> |
|||
<t t-if=" object.request_expected_date"> |
|||
<p> |
|||
Expected Date: |
|||
<t t-out="object.request_expected_date"/> |
|||
</p> |
|||
</t> |
|||
<br/> |
|||
<p> |
|||
Thank you! |
|||
</p> |
|||
<br/> |
|||
<div style="width: 375px; margin: 0px; padding: 0px; |
|||
background-color: #8E0000; border-top-left-radius: 5px 5px; |
|||
border-top-right-radius: 5px 5px; |
|||
background-repeat: repeat no-repeat;"> |
|||
<h3 style="margin: 0px; padding: 2px 14px; |
|||
font-size: 12px; color: #DDD;"> |
|||
<strong style="text-transform:uppercase;"> |
|||
<t t-out="object.company_id.name"/> |
|||
</strong> |
|||
</h3> |
|||
</div> |
|||
<div style="width: 347px; margin: 0px; padding: 5px 14px; |
|||
line-height: 16px; background-color: #F2F2F2;"> |
|||
<span style="color: #222; margin-bottom: 5px; display: block; "> |
|||
</span> |
|||
<t t-if="object.company_id.phone"> |
|||
<div style="margin-top: 0px; margin-right: 0px; |
|||
margin-bottom: 0px; margin-left: 0px; |
|||
padding-top: 0px; padding-right: 0px; |
|||
padding-bottom: 0px; padding-left: 0px; "> |
|||
Phone: |
|||
<t t-out="object.company_id.phone"/> |
|||
</div> |
|||
</t> |
|||
<t t-if=" object.company_id.website"> |
|||
<div> |
|||
Web : |
|||
<a href="'%s' % object.company_id.website"> |
|||
<t t-out="object.company_id.website"/> |
|||
</a> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
@ -0,0 +1,6 @@ |
|||
## Module <employee_orientation> |
|||
|
|||
#### 17.05.2025 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
- Initial Commit for Employee Orientation & Training |
|||
@ -0,0 +1,28 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import checklist_line |
|||
from . import orientation_checklist |
|||
from . import employee_orientation |
|||
from . import orientation_request |
|||
from . import employee_training |
|||
from . import employee_orientation_report |
|||
from . import hr_employee |
|||
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import models, fields |
|||
|
|||
|
|||
class ChecklistLine(models.Model): |
|||
"""This class creates a model 'checklist.line' and adds required fields """ |
|||
_name = 'checklist.line' |
|||
_description = 'Checklist Line' |
|||
_rec_name = 'line_name' |
|||
|
|||
line_name = fields.Char(string='Name', required=True, |
|||
help="Checklist name.") |
|||
responsible_user_id = fields.Many2one('res.users', |
|||
string='Responsible User', |
|||
required=True, |
|||
help="Give the responsible user.") |
|||
@ -0,0 +1,123 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models, _ |
|||
|
|||
|
|||
class Orientation(models.Model): |
|||
"""This class creates a model 'employee.orientation' and adds fields,and |
|||
also inherits 'mail.thread'""" |
|||
_name = 'employee.orientation' |
|||
_description = "Employee Orientation" |
|||
_inherit = 'mail.thread' |
|||
|
|||
name = fields.Char(string='Employee Orientation', readonly=True, |
|||
default=lambda self: _('New'), |
|||
help="Sequence for employee orientation.") |
|||
employee_id = fields.Many2one('hr.employee', string='Employee', |
|||
required=True, |
|||
help="Name of the employee.") |
|||
department_id = fields.Many2one('hr.department', string='Department', |
|||
related='employee_id.department_id', |
|||
required=True, |
|||
help="Name of the department.") |
|||
date = fields.Datetime(string="Date", help="Current date for employee " |
|||
"orientation.") |
|||
responsible_user_id = fields.Many2one('res.users', |
|||
string='Responsible User', |
|||
help="Give the responsible user.") |
|||
employee_company_id = fields.Many2one('res.company', string='Company', |
|||
required=True, |
|||
default=lambda |
|||
self: self.env.user.company_id, |
|||
help="Mention the company.") |
|||
parent_id = fields.Many2one('hr.employee', string='Manager', |
|||
related='employee_id.parent_id', |
|||
help="Related manager.") |
|||
job_id = fields.Many2one('hr.job', string='Job Title', |
|||
related='employee_id.job_id', |
|||
domain="[('department_id', '=', department_id)]", |
|||
help="Mention the job title.") |
|||
orientation_id = fields.Many2one('orientation.checklist', |
|||
string='Orientation Checklist', |
|||
domain="[('checklist_department_id','='," |
|||
" department_id)]", |
|||
required=True, |
|||
help="Mention the Orientation Checklist.") |
|||
note = fields.Text('Description', help="Give the description if any.") |
|||
orientation_request_ids = fields.One2many('orientation.request', |
|||
'request_orientation_id', |
|||
string='Orientation Request', |
|||
help="Orientation requests " |
|||
"of the employee.") |
|||
state = fields.Selection([ |
|||
('draft', 'Draft'), |
|||
('confirm', 'Confirmed'), |
|||
('cancel', 'Canceled'), |
|||
('complete', 'Completed'), |
|||
], string='Status', readonly=True, copy=False, index=True, |
|||
default='draft', |
|||
help="Status of the employee orientation.") |
|||
|
|||
def action_confirm_orientation(self): |
|||
"""Function execute on confirming orientation, state changes to |
|||
confirm""" |
|||
self.write({'state': 'confirm'}) |
|||
for values in self.orientation_id.checklist_line_ids: |
|||
self.env['orientation.request'].create({ |
|||
'request_name': values.line_name, |
|||
'request_orientation_id': self.id, |
|||
'partner_id': values.responsible_user_id.id, |
|||
'request_date': self.date, |
|||
'employee_id': self.employee_id.id, |
|||
}) |
|||
|
|||
def action_cancel_orientation(self): |
|||
"""Function on cancel orientation button,state changes to cancel""" |
|||
for request in self.orientation_request_ids: |
|||
request.state = 'cancel' |
|||
self.write({'state': 'cancel'}) |
|||
|
|||
def action_complete_orientation(self): |
|||
"""Function on complete orientation button,state changes to complete""" |
|||
force_complete = False |
|||
for request in self.orientation_request_ids: |
|||
if request.state == 'new': |
|||
force_complete = True |
|||
if force_complete: |
|||
return { |
|||
'name': 'Complete Orientation', |
|||
'view_type': 'form', |
|||
'view_mode': 'form', |
|||
'res_model': 'orientation.force.complete', |
|||
'type': 'ir.actions.act_window', |
|||
'context': {'default_orientation_id': self.id}, |
|||
'target': 'new', |
|||
} |
|||
self.write({'state': 'complete'}) |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
"""Function to create sequence for orientation""" |
|||
vals['name'] = self.env['ir.sequence'].next_by_code( |
|||
'employee.orientation') |
|||
result = super(Orientation, self).create(vals) |
|||
return result |
|||
@ -0,0 +1,53 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, models |
|||
|
|||
|
|||
class PackingReportValues(models.AbstractModel): |
|||
"""Model for report of employee orientation""" |
|||
_name = 'report.employee_orientation.print_pack_template' |
|||
_description = 'Employee Orientation Print report' |
|||
|
|||
@api.model |
|||
def _get_report_values(self, docids, data=None): |
|||
"""Function execute on report values""" |
|||
lst = [] |
|||
empl_obj = self.env['hr.employee'].search( |
|||
[('department_id', '=', data['dept_id'])]) |
|||
docs = self.env['hr.employee'].browse(docids) |
|||
for line in empl_obj: |
|||
lst.append({ |
|||
'doc_ids': docs.ids, |
|||
'doc_model': 'hr.employee', |
|||
'name': line.name, |
|||
'department_id': line.department_id.name, |
|||
'program_name': data['program_name'], |
|||
'company_name': data['company_name'], |
|||
'date_to': data['date_to'], |
|||
'program_convener': data['program_convener'], |
|||
'duration': data['duration'], |
|||
'hours': data['hours'], |
|||
'minutes': data['minutes'], |
|||
}) |
|||
return { |
|||
'data': lst, |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C)2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from dateutil.relativedelta import relativedelta |
|||
from datetime import datetime |
|||
from odoo import api, fields, models, _ |
|||
|
|||
|
|||
class EmployeeTraining(models.Model): |
|||
"""This class creates a model employee training and adds fields""" |
|||
_name = 'employee.training' |
|||
_rec_name = 'program_name' |
|||
_description = "Employee Training" |
|||
_inherit = 'mail.thread' |
|||
|
|||
program_name = fields.Char(string='Training Program', required=True, |
|||
help="Program name in training.") |
|||
program_department_id = fields.Many2one('hr.department', |
|||
string='Department', required=True, |
|||
help="Department on training.") |
|||
program_convener_id = fields.Many2one('res.users', |
|||
string='Responsible User', |
|||
required=True, help="Responsible " |
|||
"person.") |
|||
training_ids = fields.One2many('hr.employee', |
|||
string='Employee Details', |
|||
compute="_compute_employee_details", |
|||
help="Employee details on training.") |
|||
note_id = fields.Text('Description', help="Give the description" |
|||
" if any.") |
|||
date_from = fields.Datetime(string="Date From", help="Give the from date.") |
|||
date_to = fields.Datetime(string="Date To", help="Mention the to date.") |
|||
user_id = fields.Many2one('res.users', string='users', |
|||
default=lambda self: self.env.user, |
|||
help="Mention the user.") |
|||
company_id = fields.Many2one('res.company', string='Company', |
|||
required=True, |
|||
default=lambda self: self.env.user.company_id, |
|||
help="Mention the company.") |
|||
state = fields.Selection([ |
|||
('new', 'New'), |
|||
('confirm', 'Confirmed'), |
|||
('cancel', 'Canceled'), |
|||
('complete', 'Completed'), |
|||
('print', 'Print'), |
|||
], string='Status', readonly=True, copy=False, index=True, |
|||
default='new', help="Status of training.") |
|||
|
|||
@api.depends('program_department_id') |
|||
def _compute_employee_details(self): |
|||
"""Function to search for employee details""" |
|||
datas = self.env['hr.employee'].search( |
|||
[('department_id', '=', self.program_department_id.id)]) |
|||
self.training_ids = datas |
|||
|
|||
def print_event(self): |
|||
"""Reports to print the event""" |
|||
self.ensure_one() |
|||
started_date = datetime.strftime(self.create_date, "%Y-%m-%d ") |
|||
duration = (self.write_date - self.create_date).days |
|||
pause = relativedelta(hours=0) |
|||
difference = relativedelta(self.write_date, self.create_date) - pause |
|||
hours = difference.hours |
|||
minutes = difference.minutes |
|||
data = { |
|||
'dept_id': self.program_department_id.id, |
|||
'program_name': self.program_name, |
|||
'company_name': self.company_id.name, |
|||
'date_to': started_date, |
|||
'duration': duration, |
|||
'hours': hours, |
|||
'minutes': minutes, |
|||
'program_convener': self.program_convener_id.name, |
|||
} |
|||
return self.env.ref( |
|||
'employee_orientation.print_pack_certificates').report_action(self, |
|||
data=data) |
|||
|
|||
def action_complete_event(self): |
|||
"""Function executes if the event is completed and state changed to |
|||
complete""" |
|||
self.write({'state': 'complete'}) |
|||
|
|||
def action_confirm_event(self): |
|||
"""Function executes if the event is confirmed and state changed to |
|||
confirm""" |
|||
self.write({'state': 'confirm'}) |
|||
|
|||
def action_cancel_event(self): |
|||
"""Function executes if the event is cancelled and state changed to |
|||
cancel""" |
|||
self.write({'state': 'cancel'}) |
|||
|
|||
def action_confirm_send_mail(self): |
|||
"""Function execute to confirm send mail and update values |
|||
""" |
|||
self.ensure_one() |
|||
ir_model_data = self.env['ir.model.data'] |
|||
try: |
|||
template_id = ir_model_data._xmlid_lookup( |
|||
'employee_orientation.orientation_training_mailer')[2] |
|||
except ValueError: |
|||
template_id = False |
|||
try: |
|||
compose_form_id = ir_model_data._xmlid_lookup( |
|||
'mail.email_compose_message_wizard_form')[2] |
|||
except ValueError: |
|||
compose_form_id = False |
|||
ctx = dict(self.env.context or {}) |
|||
ctx.update({ |
|||
'default_model': 'employee.training', |
|||
'default_res_id': self.ids[0], |
|||
'default_use_template': bool(template_id), |
|||
'default_template_id': template_id, |
|||
'default_composition_mode': 'comment', |
|||
}) |
|||
return { |
|||
'name': _('Compose Email'), |
|||
'type': 'ir.actions.act_window', |
|||
'view_type': 'form', |
|||
'view_mode': 'form', |
|||
'res_model': 'mail.compose.message', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
|
|||
@ -0,0 +1,30 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class HrEmployee(models.Model): |
|||
"This class inherits 'hr.employee'" |
|||
_inherit = 'hr.employee' |
|||
|
|||
certificates = fields.Boolean(default=True, string="Certificates", |
|||
help="Field to give certificates or not.") |
|||
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import models, fields |
|||
|
|||
|
|||
class OrientationChecklist(models.Model): |
|||
"""This class creates a model 'orientation.checklist' and added fields""" |
|||
_name = 'orientation.checklist' |
|||
_description = "Checklist" |
|||
_rec_name = 'checklist_name' |
|||
_inherit = 'mail.thread' |
|||
|
|||
checklist_name = fields.Char(string='Name', required=True, |
|||
help="Give the checklist name.") |
|||
checklist_department_id = fields.Many2one('hr.department', |
|||
string='Department', |
|||
required=True, |
|||
help="Give the corresponding" |
|||
"department.") |
|||
active = fields.Boolean(string='Active', default=True, |
|||
help="Set active to false to hide the Orientation " |
|||
"Checklist without removing it.") |
|||
checklist_line_ids = fields.Many2many('checklist.line', |
|||
'checklist_line_rel', |
|||
help="Specify all the checklists.") |
|||
@ -0,0 +1,113 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions @cybrosys(odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import models, fields, _ |
|||
|
|||
|
|||
class OrientationChecklistRequest(models.Model): |
|||
"""This class creates a model 'orientation.request' and adds |
|||
required fields""" |
|||
_name = 'orientation.request' |
|||
_description = "Employee Orientation Request" |
|||
_rec_name = 'request_name' |
|||
_inherit = 'mail.thread' |
|||
|
|||
request_name = fields.Char(string='Name', help="Name the sequence") |
|||
request_orientation_id = fields.Many2one('employee.orientation', |
|||
string='Employee Orientation', |
|||
help="Give the employee " |
|||
"orientation.") |
|||
employee_company_id = fields.Many2one('res.company', |
|||
string='Employees Company', |
|||
required=True, |
|||
default=lambda |
|||
self: self.env.user.company_id, |
|||
help="Give the company.") |
|||
partner_id = fields.Many2one('res.users', |
|||
string='Responsible User', |
|||
help="Specify the responsible user.") |
|||
request_date = fields.Date(string="Date", help="Mention the request date.") |
|||
employee_id = fields.Many2one('hr.employee', string='Employee', |
|||
help="Give the employee name.") |
|||
request_expected_date = fields.Date(string="Expected Date", help="Request" |
|||
"expected " |
|||
"date.") |
|||
attachment_ids = fields.Many2many('ir.attachment', |
|||
'orientation_rel_1', |
|||
string="Attachment", help="Attachments " |
|||
"related.") |
|||
note = fields.Text('Description', help="Give notes if any.") |
|||
user_id = fields.Many2one('res.users', string='users', |
|||
default=lambda self: self.env.user, |
|||
help="Give the user.") |
|||
company_id = fields.Many2one('res.company', |
|||
string='Company', required=True, |
|||
default=lambda self: self.env.user.company_id, |
|||
help="Give the related company.") |
|||
state = fields.Selection([ |
|||
('new', 'New'), |
|||
('cancel', 'Cancel'), |
|||
('complete', 'Completed'), |
|||
], string='Status', readonly=True, copy=False, index=True, |
|||
default='new', help="Status of the " |
|||
"request.") |
|||
|
|||
def action_confirm_send_mail(self): |
|||
"""Function executes on confirming mail""" |
|||
self.ensure_one() |
|||
ir_model_data = self.env['ir.model.data'] |
|||
try: |
|||
template_id = ir_model_data._xmlid_lookup( |
|||
'employee_orientation.orientation_request_view')[1] |
|||
except ValueError: |
|||
template_id = False |
|||
try: |
|||
compose_form_id = ir_model_data._xmlid_lookup('mail.email_compose_message_wizard_form')[1] |
|||
except ValueError: |
|||
compose_form_id = False |
|||
ctx = dict(self.env.context or {}) |
|||
ctx.update({ |
|||
'default_model': 'orientation.request', |
|||
'default_res_ids': self.ids, |
|||
'default_template_id': template_id, |
|||
'default_composition_mode': 'comment', |
|||
'default_email_layout_xmlid': "mail.mail_notification_layout_with_responsible_signature", |
|||
'force_email': True, |
|||
}) |
|||
return { |
|||
'name': _('Compose Email'), |
|||
'type': 'ir.actions.act_window', |
|||
'view_type': 'form', |
|||
'view_mode': 'form', |
|||
'res_model': 'mail.compose.message', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
|
|||
def action_confirm_request(self): |
|||
"""Function on confirm button of request""" |
|||
self.write({'state': "complete"}) |
|||
|
|||
def action_cancel_request(self): |
|||
"""Function on cancel button""" |
|||
self.write({'state': "cancel"}) |
|||
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Report template --> |
|||
<record id="print_pack_certificates" model="ir.actions.report"> |
|||
<field name="name">Certificates</field> |
|||
<field name="model">employee.training</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">employee_orientation.print_pack_template</field> |
|||
<field name="report_file">employee_orientation.print_pack_template</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
@ -0,0 +1,88 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Template to print certificates --> |
|||
<template id="certificate_layout"> |
|||
<t t-if="not o" t-set="o" t-value="doc"/> |
|||
<t t-if="not company"> |
|||
<t t-if="company_id"> |
|||
<t t-set="company" t-value="company_id"/> |
|||
</t> |
|||
<t t-elif="o and 'company_id' in o and o.company_id.sudo()"> |
|||
<t t-set="company" t-value="o.company_id.sudo()"/> |
|||
</t> |
|||
<t t-else="else"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
</t> |
|||
<div class="header"> |
|||
<div class="row"> |
|||
<div class="col-3"> |
|||
<span t-esc="company.name"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="article" t-att-data-oe-model="o" t-att-data-oe-id="o"> |
|||
<t t-out="0"/> |
|||
</div> |
|||
</template> |
|||
<template id="print_pack_template"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="employee_orientation.certificate_layout"> |
|||
<div class="page"> |
|||
<t t-foreach="data" t-as="o"> |
|||
<h2 align="center" |
|||
style="margin-top:200px; padding-top:50px;"> |
|||
Certificate of Participation |
|||
</h2> |
|||
<table border="0" align="center" |
|||
style="border: none; border-collapse: collapse; page-break-after:always !important;"> |
|||
<tr> |
|||
<td> |
|||
<br/> |
|||
<br/> |
|||
<p> |
|||
This certificate is awarded to |
|||
<span> |
|||
<strong> |
|||
<t t-esc="o['name']"/> |
|||
</strong> |
|||
</span> |
|||
for certifying his/her participation in |
|||
the training program " |
|||
<strong> |
|||
<t t-esc="o['program_name']"/> |
|||
</strong> |
|||
" conducted by |
|||
<strong> |
|||
<t t-esc="o['program_convener']"/> |
|||
</strong> |
|||
from |
|||
<strong> |
|||
<t t-esc="o['date_to']"/> |
|||
</strong> |
|||
,with duration of |
|||
<strong> |
|||
<t t-esc="o['duration']"/> |
|||
</strong> |
|||
days, |
|||
<strong> |
|||
<t t-esc="o['hours']"/> |
|||
</strong> |
|||
Hours, |
|||
<strong> |
|||
<t t-esc="o['minutes']"/> |
|||
</strong> |
|||
Minutes, at |
|||
<strong> |
|||
<t t-esc="o['company_name']"/> |
|||
</strong> |
|||
</p> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
|||
|
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 628 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 495 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 624 B |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 214 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 310 B |
|
After Width: | Height: | Size: 929 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 576 B |
|
After Width: | Height: | Size: 733 B |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 911 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 600 B |
|
After Width: | Height: | Size: 673 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 878 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 653 B |
|
After Width: | Height: | Size: 800 B |
|
After Width: | Height: | Size: 905 B |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 427 B |
|
After Width: | Height: | Size: 627 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 988 B |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 767 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 760 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 697 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 76 KiB |