@ -0,0 +1,48 @@ |
|||
.. 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 Promotion |
|||
=================== |
|||
This module helps us to give promotion to the employees according to their promotion type |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configurations needed |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
Affero General Public License v3.0 (AGPL v3) |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developers: (V18) Rosmy John, |
|||
(V17) Junaidul Ansar M, |
|||
(V16) Dhanya Babu, |
|||
* 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,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions (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 |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions (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 Promotion", |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Human Resources', |
|||
'summary': ' This module helps to manage the proper employee promotion ' |
|||
'process.', |
|||
'description': 'With the help of this module you can set promotion for' |
|||
'employee. Also, the promotion is visible on each employee ' |
|||
'form.', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['mail', 'hr_contract'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'views/employee_promotion_views.xml', |
|||
'views/promotion_type_views.xml', |
|||
'views/hr_employee_views.xml', |
|||
'report/employee_promotion_report.xml', |
|||
'report/employee_promotion_templates.xml' |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,6 @@ |
|||
## Module <employee_promotion_in_odoo> |
|||
|
|||
#### 11.12.2024 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
- Initial Commit For Employee Promotion |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions (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 employee_promotion |
|||
from . import hr_employee |
|||
from . import promotion_type |
@ -0,0 +1,101 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions (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 |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class EmployeePromotion(models.Model): |
|||
"""This model is necessary for add employee promotion details in employee |
|||
module """ |
|||
_name = 'employee.promotion' |
|||
_description = 'Employee Promotion' |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
_rec_name = 'promotion_name' |
|||
|
|||
promotion_name = fields.Text(required=True, string='Promotion Name', |
|||
help='Promotion name') |
|||
employee_id = fields.Many2one('hr.employee', string='Employee', |
|||
required=True, help='Name of employee') |
|||
contract_id = fields.Many2one('hr.contract', string='Contract', |
|||
help='Contract of employee', |
|||
domain="[('employee_id', '=', employee_id)]") |
|||
job_title_id = fields.Many2one('hr.job', |
|||
string='Old Designation', |
|||
help='Previous job of employee ') |
|||
job_salary = fields.Float(string='Previous Salary', |
|||
required=True, help='Previous job salary') |
|||
promotion_date = fields.Date(string='Promotion Date', |
|||
default=fields.Date.today(), |
|||
help='Date of promotion date') |
|||
promotion_type_id = fields.Many2one('promotion.type', |
|||
string='Promotion Type', |
|||
required=True, |
|||
help='Promotion type of promotion') |
|||
new_designation_id = fields.Many2one('hr.job', |
|||
string='New Designation', |
|||
required=True, |
|||
help='New designation of employee') |
|||
new_salary = fields.Float(string='New Salary', required=True, |
|||
help='New salary') |
|||
description = fields.Text(string='Description', help='Description of the' |
|||
' promotion') |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
"""It checks if the new salary is greater than the old salary, |
|||
raising a UserError if it is not the case.""" |
|||
res = super(EmployeePromotion, self).create(vals) |
|||
employee = self.env['hr.employee'].browse(res.employee_id.id) |
|||
employee.write({ |
|||
'promotion_ids': [(4, res.id)], |
|||
'job_id': res.new_designation_id.id |
|||
}) |
|||
if res.job_salary >= res.new_salary: |
|||
raise UserError("New Salary will be Higher than Old ") |
|||
return res |
|||
|
|||
@api.onchange('employee_id') |
|||
def _onchange_employee_id(self): |
|||
"""This method is called when the employee_id field is changed. |
|||
It searches for an open HR contract history |
|||
record for the selected employee and sets the contract_id and |
|||
job_salary fields based on the |
|||
corresponding values in the contract. |
|||
If no open contract is found, the fields are left blank.""" |
|||
self.job_title_id = self.employee_id.job_id.id |
|||
contract = self.env['hr.contract.history'].search( |
|||
[('employee_id', '=', self.employee_id.id), |
|||
('state', '=', 'open')]) |
|||
if contract: |
|||
for contract_history in contract: |
|||
self.contract_id = contract_history.name |
|||
self.job_salary = contract_history.wage |
|||
|
|||
def write(self, vals): |
|||
""" Override the default write method to check if the new salary is |
|||
greater than the current job salary. |
|||
If the new salary is greater, |
|||
raise a UserError with a warning message.""" |
|||
res = super(EmployeePromotion, self).write(vals) |
|||
if self.job_salary >= self.new_salary: |
|||
raise UserError("New Salary will be Higher than Old ") |
|||
return res |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions (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): |
|||
"""Inheriting employee to add employee promotion form as many 2many field""" |
|||
_inherit = 'hr.employee' |
|||
|
|||
promotion_ids = fields.Many2many('employee.promotion', |
|||
string='Promotions', |
|||
help='The promotions that an' |
|||
' employee has received') |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions (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 PromotionType(models.Model): |
|||
"""This model is used for the Promotion Type of Employee""" |
|||
_name = 'promotion.type' |
|||
_description = 'Promotion Type' |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
_rec_name = 'promotion_type' |
|||
|
|||
promotion_type = fields.Text(string='Promotion Type', help='Promotion type') |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- This record defines an action report for generating a PDF |
|||
report of employee promotions. It is bound to the 'employee.promotion' model --> |
|||
<record id="employee_promotion_action_report" model="ir.actions.report"> |
|||
<field name="name">Promotion Report</field> |
|||
<field name="model">employee.promotion</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">employee_promotion_in_odoo.employee_promotions_report_action</field> |
|||
<field name="report_file">employee_promotion_in_odoo.employee_promotions_report_action</field> |
|||
<field name="binding_model_id" ref="model_employee_promotion"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,72 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- This is a QWeb template used to display the details of an employee |
|||
promotion in a table format. --> |
|||
<template id="employee_promotions_report_action"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="doc"> |
|||
<div t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<div class="oe-structure"/> |
|||
<br/> |
|||
<div class="text-center"> |
|||
<h4> |
|||
Employee Promotion Name: |
|||
<t t-esc="doc.promotion_name"/> |
|||
</h4> |
|||
</div> |
|||
<br/> |
|||
<table class="table table-bordered"> |
|||
<tr> |
|||
<th>Employee</th> |
|||
<td> |
|||
<t t-esc="doc.employee_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Previous Designation</th> |
|||
<td> |
|||
<t t-esc="doc.job_title_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Previous Salary</th> |
|||
<td> |
|||
<t t-esc="doc.job_salary"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>New Designation</th> |
|||
<td> |
|||
<t t-esc="doc.new_designation_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>New Salary</th> |
|||
<td> |
|||
<t t-esc="doc.new_salary"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Contract</th> |
|||
<t t-if="doc.contract_id"> |
|||
<td> |
|||
<t t-esc="doc.contract_id.name"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
<tr> |
|||
<th>Description</th> |
|||
<t t-if="doc.description"> |
|||
<td> |
|||
<t t-esc="doc.description"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</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: 247 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: 130 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 171 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 175 KiB |
After Width: | Height: | Size: 27 KiB |