diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0420d9dd --- /dev/null +++ b/.gitignore @@ -0,0 +1,57 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib64/ +parts/ +sdist/ +var/ +*.pyc +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ diff --git a/attendance_regularization/README.md b/attendance_regularization/README.md new file mode 100755 index 00000000..b01bd717 --- /dev/null +++ b/attendance_regularization/README.md @@ -0,0 +1,36 @@ +Open HRMS Attendance Regularization +========================= + +Manage Attendances for Onsight Jobs. + + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Sayooj A O @ Cybrosys + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + diff --git a/attendance_regularization/__init__.py b/attendance_regularization/__init__.py new file mode 100755 index 00000000..9a7e03ed --- /dev/null +++ b/attendance_regularization/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/attendance_regularization/__manifest__.py b/attendance_regularization/__manifest__.py new file mode 100755 index 00000000..151d3234 --- /dev/null +++ b/attendance_regularization/__manifest__.py @@ -0,0 +1,23 @@ +{ + 'name': "Open HRMS Attendance Regularization", + 'version': '12.0.1.0.0', + 'summary': """Assigning Attendance for the Employees with Onsight Jobs""", + 'description': """Assigning Attendance for the Employees with Onsight Jobs through the requests by Employees """, + 'category': 'Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr','hr_attendance','project','contacts','oh_employee_creation_from_user'], + 'data': [ + 'security/ir.model.access.csv', + 'security/security.xml', + 'views/category.xml', + 'views/regularization_views.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': "AGPL-3", + 'installable': True, + 'application': True, +} diff --git a/attendance_regularization/doc/RELEASE_NOTES.md b/attendance_regularization/doc/RELEASE_NOTES.md new file mode 100755 index 00000000..d5d88c4d --- /dev/null +++ b/attendance_regularization/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 18.09.2018 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Open HRMS Project diff --git a/attendance_regularization/models/__init__.py b/attendance_regularization/models/__init__.py new file mode 100755 index 00000000..a7c19728 --- /dev/null +++ b/attendance_regularization/models/__init__.py @@ -0,0 +1 @@ +from . import regularization diff --git a/attendance_regularization/models/regularization.py b/attendance_regularization/models/regularization.py new file mode 100755 index 00000000..927433aa --- /dev/null +++ b/attendance_regularization/models/regularization.py @@ -0,0 +1,61 @@ +from odoo import fields, api, models + + +class Regular(models.Model): + + _name = 'attendance.regular' + _rec_name = 'employee' + _description = 'Approval Request' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + def _get_employee_id(self): + employee_rec = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) + return employee_rec.id + + reg_category = fields.Many2one('reg.categories', string='Regularization Category', required=True) + from_date = fields.Datetime(string='From Date', required=True) + to_date = fields.Datetime(string='To Date', required=True) + reg_reason = fields.Text(string='Reason', required=True) + employee = fields.Many2one('hr.employee', string="Employee", default=_get_employee_id, readonly=True, required=True) + state_select = fields.Selection([('draft', 'Draft'), ('requested', 'Requested'), ('reject', 'Rejected'), + ('approved', 'Approved') + ], default='draft', track_visibility='onchange', string='State') + + @api.multi + def submit_reg(self): + self.ensure_one() + self.sudo().write({ + 'state_select': 'requested' + }) + return + + @api.multi + def regular_approval(self): + self.write({ + 'state_select': 'approved' + }) + vals = { + + 'check_in': self.from_date, + 'check_out': self.to_date, + 'employee_id': self.employee.id + + } + approve = self.env['hr.attendance'].sudo().create(vals) + return + + @api.multi + def regular_rejection(self): + self.write({ + 'state_select': 'reject' + }) + return + +class Category(models.Model): + + _name = 'reg.categories' + _rec_name = 'type' + + type = fields.Char(string='Category') + + diff --git a/attendance_regularization/security/ir.model.access.csv b/attendance_regularization/security/ir.model.access.csv new file mode 100755 index 00000000..5f7a7465 --- /dev/null +++ b/attendance_regularization/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +request,request_regular,model_attendance_regular,base.group_user,1,1,1,0 +requestes,request_regulars,model_reg_categories,base.group_user,1,1,1,0 diff --git a/attendance_regularization/security/security.xml b/attendance_regularization/security/security.xml new file mode 100755 index 00000000..eba7c179 --- /dev/null +++ b/attendance_regularization/security/security.xml @@ -0,0 +1,15 @@ + + + + Attendance Visibility + + [('employee.address_home_id.id','=',user.partner_id.id)] + + + + Admin Visibility + + [] + + + \ No newline at end of file diff --git a/attendance_regularization/static/description/HRMS-BUTTON.png b/attendance_regularization/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/attendance_regularization/static/description/HRMS-BUTTON.png differ diff --git a/attendance_regularization/static/description/banner.jpg b/attendance_regularization/static/description/banner.jpg new file mode 100755 index 00000000..7caf41ef Binary files /dev/null and b/attendance_regularization/static/description/banner.jpg differ diff --git a/attendance_regularization/static/description/cybro-service.png b/attendance_regularization/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/attendance_regularization/static/description/cybro-service.png differ diff --git a/attendance_regularization/static/description/cybro_logo.png b/attendance_regularization/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/attendance_regularization/static/description/cybro_logo.png differ diff --git a/attendance_regularization/static/description/icon.png b/attendance_regularization/static/description/icon.png new file mode 100755 index 00000000..7a2fa7d5 Binary files /dev/null and b/attendance_regularization/static/description/icon.png differ diff --git a/attendance_regularization/static/description/index.html b/attendance_regularization/static/description/index.html new file mode 100755 index 00000000..7b6569d3 --- /dev/null +++ b/attendance_regularization/static/description/index.html @@ -0,0 +1,371 @@ +
+
+

+ OHRMS Attendance Regularization +

+

+ Manages Attendance For Onsight Jobs +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ This module is an application for handling the Attendances for the employees who gone for Onsight jobs + or any company purposes, the employee can send the request and the responsible person will receive the request he can either + approve or reject the request.If he approve the request the attendance to the corresponding date will add to the registry. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+
+ +
+

+ Features +

+
+
+ Managing Requests From Onsight Employees.
+ Automatic Addition Of Attendance Through Approval.
+
+
+
+
+
+
+
+

+ Screenshots +

+

+ + Select the User and set the "Attendance" field to 'Manual Attendance' +
+

+
+ +
+

+ + Fill the mandatory fields and click "Submit" to send request. +
+

+
+ +
+

+ + Now the Attendance Request is generated the manager can either 'Approve' or 'Reject' the request. +
+

+
+ +
+

+ + Click on 'Approve' to add the attendance. +
+

+
+ +
+

+ + Now we can see the attendance is added in the attendance registry +
+

+
+ +
+
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+
+
+

+ Our Services +

+
+ + + +
+
+ + + +
+

+ + Odoo Support +

+
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/attendance_regularization/static/description/oh_icon.png b/attendance_regularization/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/attendance_regularization/static/description/oh_icon.png differ diff --git a/attendance_regularization/static/description/open-hrms-attendance-regularization-1.png b/attendance_regularization/static/description/open-hrms-attendance-regularization-1.png new file mode 100755 index 00000000..3c230ae5 Binary files /dev/null and b/attendance_regularization/static/description/open-hrms-attendance-regularization-1.png differ diff --git a/attendance_regularization/static/description/open-hrms-attendance-regularization-2.png b/attendance_regularization/static/description/open-hrms-attendance-regularization-2.png new file mode 100755 index 00000000..d07431fc Binary files /dev/null and b/attendance_regularization/static/description/open-hrms-attendance-regularization-2.png differ diff --git a/attendance_regularization/static/description/open-hrms-attendance-regularization-3.png b/attendance_regularization/static/description/open-hrms-attendance-regularization-3.png new file mode 100755 index 00000000..627569c4 Binary files /dev/null and b/attendance_regularization/static/description/open-hrms-attendance-regularization-3.png differ diff --git a/attendance_regularization/static/description/open-hrms-attendance-regularization-4.png b/attendance_regularization/static/description/open-hrms-attendance-regularization-4.png new file mode 100755 index 00000000..76237482 Binary files /dev/null and b/attendance_regularization/static/description/open-hrms-attendance-regularization-4.png differ diff --git a/attendance_regularization/static/description/open-hrms-attendance-regularization-5.png b/attendance_regularization/static/description/open-hrms-attendance-regularization-5.png new file mode 100755 index 00000000..428e16fe Binary files /dev/null and b/attendance_regularization/static/description/open-hrms-attendance-regularization-5.png differ diff --git a/attendance_regularization/views/category.xml b/attendance_regularization/views/category.xml new file mode 100644 index 00000000..5ec1aeea --- /dev/null +++ b/attendance_regularization/views/category.xml @@ -0,0 +1,41 @@ + + + + + job.cate + reg.categories + + + + + + + + + job.cater + reg.categories + +
+ + + +
+
+
+ + + Regularization Category + reg.categories + form + tree,form + [] + +

Create new record +

+
+
+ + +
+
\ No newline at end of file diff --git a/attendance_regularization/views/regularization_views.xml b/attendance_regularization/views/regularization_views.xml new file mode 100755 index 00000000..b7d33846 --- /dev/null +++ b/attendance_regularization/views/regularization_views.xml @@ -0,0 +1,95 @@ + + + + + attendance.regular_tree + attendance.regular + + + + + + + + + + + + + + Attendance Regularization Request + attendance.regular + form + tree,form + [] + +

Create new Request +

+
+
+ + + + + attendance.regular_request_tree + attendance.regular + + + + + + + + + + + + + + attend.regular + attendance.regular + +
+
+
+ + + + + + + + + + + + + + +
+ + Attendance Regularization Approval + attendance.regular + form + tree,form + [('state_select','!=','approved'),('state_select','!=','reject')] + +

Create new Record +

+
+
+ +
+
\ No newline at end of file diff --git a/history_employee/README.rst b/history_employee/README.rst new file mode 100644 index 00000000..f7cb9345 --- /dev/null +++ b/history_employee/README.rst @@ -0,0 +1,42 @@ +Open HRMS Employee History v12 +============================== + +History of the employees in our company. + +Depends +======= +[hr] addon Odoo +[hr_contract] addon Odoo +[oh_employee_creation_from_user] addon OpenHRMS + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Binu M Baiju @ cybrosys, odoo@cybrosys.com + v12.0 Kavya Raveendran, odoo@cybrosys.com + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/history_employee/__init__.py b/history_employee/__init__.py new file mode 100644 index 00000000..a0fdc10f --- /dev/null +++ b/history_employee/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/history_employee/__manifest__.py b/history_employee/__manifest__.py new file mode 100644 index 00000000..d62802c5 --- /dev/null +++ b/history_employee/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Binu M Baiju() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Employee History', + 'version': '12.0.1.0.0', + 'summary': """History Of Employees In Your Company""", + 'description': 'Track the History of Employees in your Company', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['hr', 'hr_contract', 'oh_employee_creation_from_user'], + 'data': ['views/employee_history.xml', + 'views/history_views.xml', + 'security/secure.xml', + 'security/ir.model.access.csv' + ], + 'demo': [], + 'images': ['static/description/banner.gif'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/history_employee/docs/RELEASE_NOTES.md b/history_employee/docs/RELEASE_NOTES.md new file mode 100644 index 00000000..3b7b4fbf --- /dev/null +++ b/history_employee/docs/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.03.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial Commit for Open Hrms Project diff --git a/history_employee/models/__init__.py b/history_employee/models/__init__.py new file mode 100644 index 00000000..a510bbeb --- /dev/null +++ b/history_employee/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import history diff --git a/history_employee/models/history.py b/history_employee/models/history.py new file mode 100644 index 00000000..c7bd330e --- /dev/null +++ b/history_employee/models/history.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from datetime import datetime +from odoo import models, api, fields, _ +from odoo.exceptions import UserError + + +class DepartmentDetails(models.Model): + _inherit = 'hr.employee' + + @api.onchange('department_id') + def _onchange_department(self): + emp_id = self.env['hr.employee'].search([('id', '=', self._origin.id)]) + vals = { + 'emp_id': self._origin.id, + 'employee_name': emp_id.name, + 'updated_date': datetime.now(), + 'changed_field': 'Department', + 'current_value': self.department_id.name + + } + self.env['department.history'].sudo().create(vals) + + @api.onchange('job_id') + def onchange_job_id(self): + emp_id = self.env['hr.employee'].search([('id', '=', self._origin.id)]) + vals = { + 'emp_id': self._origin.id, + 'employee_name': emp_id.name, + 'updated_date': datetime.today(), + 'changed_field': 'Job Position', + 'current_value': self.job_id.name + + } + self.env['department.history'].sudo().create(vals) + + @api.onchange('timesheet_cost') + def _onchange_timesheet_cost(self): + emp_id = self.env['hr.employee'].search([('id', '=', self._origin.id)]) + vals = { + 'emp_id': self._origin.id, + 'employee_name': emp_id.name, + 'updated_date': datetime.now(), + 'current_value': self.timesheet_cost + } + self.env['timesheet.cost'].sudo().create(vals) + + @api.multi + def department_details(self): + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if res_user.has_group('hr.group_hr_manager'): + return { + 'name': _("Department History"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'department.history', + 'type': 'ir.actions.act_window', + 'target': 'new', + 'domain': [('emp_id', '=', self.id)], + } + elif self.id == self.env.user.employee_id.id: + return { + 'name': _("Department History"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'department.history', + 'type': 'ir.actions.act_window', + 'target': 'new', + } + else: + raise UserError('You cannot access this field!!!!') + + @api.multi + def time_sheet(self): + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if res_user.has_group('hr.group_hr_manager'): + return { + 'name': _("Timesheet Cost Details"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'timesheet.cost', + 'type': 'ir.actions.act_window', + 'target': 'new', + 'domain': [('emp_id', '=', self.id)] + } + elif self.id == self.env.user.employee_id.id: + return { + 'name': _("Timesheet Cost Details"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'timesheet.cost', + 'type': 'ir.actions.act_window', + 'target': 'new' + } + else: + raise UserError('You cannot access this field!!!!') + + @api.multi + def salary_history(self): + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if res_user.has_group('hr.group_hr_manager'): + return { + 'name': _("Salary History"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'salary.history', + 'type': 'ir.actions.act_window', + 'target': 'new', + 'domain': [('emp_id', '=', self.id)] + } + elif self.id == self.env.user.employee_id.id: + return { + 'name': _("Salary History"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'salary.history', + 'type': 'ir.actions.act_window', + 'target': 'new' + } + else: + raise UserError('You cannot access this field!!!!') + + @api.multi + def contract_history(self): + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if res_user.has_group('hr.group_hr_manager'): + return { + 'name': _("Contract History"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'contract.history', + 'type': 'ir.actions.act_window', + 'target': 'new', + 'domain': [('emp_id', '=', self.id)] + } + if self.id == self.env.user.employee_id.id: + return { + 'name': _("Contract History"), + 'view_mode': 'tree', + 'view_type': 'form', + 'res_model': 'contract.history', + 'type': 'ir.actions.act_window', + 'target': 'new' + } + else: + raise UserError('You cannot access this field!!!!') + + +class WageDetails(models.Model): + _inherit = 'hr.contract' + + @api.onchange('wage') + def onchange_wage(self): + vals = { + 'emp_id': self.employee_id.id, + 'employee_name': self.employee_id, + 'updated_date': datetime.today(), + 'current_value': self.wage, + + } + self.env['salary.history'].sudo().create(vals) + + @api.onchange('name') + def onchange_name(self): + vals = { + 'emp_id': self.employee_id.id, + 'employee_name': self.employee_id, + 'updated_date': datetime.today(), + 'changed_field': 'Contract Reference', + 'current_value': self.name, + + } + self.env['contract.history'].create(vals) + + @api.onchange('date_start') + def onchange_datestart(self): + vals = { + 'emp_id': self.employee_id.id, + 'employee_name': self.employee_id, + 'updated_date': datetime.today(), + 'changed_field': 'Start Date', + 'current_value': self.date_start, + + } + self.env['contract.history'].create(vals) + + @api.onchange('date_end') + def onchange_dateend(self): + vals = { + 'emp_id': self.employee_id.id, + 'employee_name': self.employee_id, + 'updated_date': datetime.today(), + 'changed_field': 'End Date', + 'current_value': self.date_end, + + } + self.env['contract.history'].create(vals) + + +class DepartmentHistory(models.Model): + _name = 'department.history' + + emp_id = fields.Char(string='Employee Id') + employee_name = fields.Char(string='Employee Name') + changed_field = fields.Char(string='Changed Field') + updated_date = fields.Date(string='Updated On') + current_value = fields.Char(string='Current Value') + + +class TimesheetCost(models.Model): + _name = 'timesheet.cost' + + emp_id = fields.Char(string='Employee Id') + employee_name = fields.Char(string='Employee Name') + updated_date = fields.Date(string='Updated On') + current_value = fields.Char(string='Current Value') + + +class SalaryHistory(models.Model): + _name = 'salary.history' + + emp_id = fields.Char(string='Employee Id') + employee_name = fields.Char(string='Employee Name') + updated_date = fields.Date(string='Updated On') + current_value = fields.Char(string='Current Value') + + +class ContractHistory(models.Model): + _name = 'contract.history' + + emp_id = fields.Char(string='Employee Id') + employee_name = fields.Char(string='Employee Name') + updated_date = fields.Date(string='Updated On') + changed_field = fields.Char(string='Changed Field') + current_value = fields.Char(string='Current Value') diff --git a/history_employee/security/ir.model.access.csv b/history_employee/security/ir.model.access.csv new file mode 100644 index 00000000..828e2678 --- /dev/null +++ b/history_employee/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +view_department_history,view.department_history.user,model_department_history,base.group_user,1,0,0,0 +view_salary_history,view.salary_history.user,model_salary_history,base.group_user,1,0,0,0 +view_timesheet_cost,view.timesheet_cost.user,model_timesheet_cost,base.group_user,1,0,0,0 +view_contract_history,view.contract_history.user,model_contract_history,base.group_user,1,0,0,0 +view_department_history_manager,view.department_history.manager,model_department_history,hr.group_hr_manager,1,1,1,1 +view_salary_history_manager,view.salary_history.manager,model_salary_history,hr.group_hr_manager,1,1,1,1 +view_contract_history_manager,view.contract_history.manager,model_contract_history,hr.group_hr_manager,1,1,1,1 \ No newline at end of file diff --git a/history_employee/security/secure.xml b/history_employee/security/secure.xml new file mode 100644 index 00000000..1a2f6ba7 --- /dev/null +++ b/history_employee/security/secure.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/history_employee/static/description/HRMS-BUTTON.png b/history_employee/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/history_employee/static/description/HRMS-BUTTON.png differ diff --git a/history_employee/static/description/banner.gif b/history_employee/static/description/banner.gif new file mode 100644 index 00000000..832565bf Binary files /dev/null and b/history_employee/static/description/banner.gif differ diff --git a/history_employee/static/description/cybro-service.png b/history_employee/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/history_employee/static/description/cybro-service.png differ diff --git a/history_employee/static/description/cybro_logo.png b/history_employee/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/history_employee/static/description/cybro_logo.png differ diff --git a/history_employee/static/description/icon.png b/history_employee/static/description/icon.png new file mode 100644 index 00000000..7ac8ae3e Binary files /dev/null and b/history_employee/static/description/icon.png differ diff --git a/history_employee/static/description/index.html b/history_employee/static/description/index.html new file mode 100644 index 00000000..32f91d42 --- /dev/null +++ b/history_employee/static/description/index.html @@ -0,0 +1,365 @@ +
+
+

+ Open HRMS Employee History +

+

+ Open HRMS Employee History +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ The module helps in getting all pertinent information about the employee in conducting the employee history verification in an organization. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+ +
+ +
+

+ Features +

+
+
+ Get The History Of Department And Job Position Held By The Employee.
+ Changes In Salary Of The Employee Can Be Traced.
+ Important Changes Done In The Contract Is Tracked.
+ Get Any Update In The Timesheet Cost For An Employee As History.
+
+ +
+
+
+ +
+
+

+ Screenshots +

+

+ + Provides a new page in the employee form "Employee History". +
+

+
+ +
+
+
+

+ + The module helps in getting all pertinent information about the employee in one single click. +
+

+
+ +
+
+
+

+ + It shows the history of department and job position along with the updated date. +
+

+
+ +
+
+
+
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+ +
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+ +
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/history_employee/static/description/oh_icon.png b/history_employee/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/history_employee/static/description/oh_icon.png differ diff --git a/history_employee/static/description/open-hrms-employee-history-1.png b/history_employee/static/description/open-hrms-employee-history-1.png new file mode 100644 index 00000000..2555cb32 Binary files /dev/null and b/history_employee/static/description/open-hrms-employee-history-1.png differ diff --git a/history_employee/static/description/open-hrms-employee-history-2.png b/history_employee/static/description/open-hrms-employee-history-2.png new file mode 100644 index 00000000..b82c6827 Binary files /dev/null and b/history_employee/static/description/open-hrms-employee-history-2.png differ diff --git a/history_employee/static/description/open-hrms-employee-history-3.png b/history_employee/static/description/open-hrms-employee-history-3.png new file mode 100644 index 00000000..40d402bd Binary files /dev/null and b/history_employee/static/description/open-hrms-employee-history-3.png differ diff --git a/history_employee/views/employee_history.xml b/history_employee/views/employee_history.xml new file mode 100644 index 00000000..4c5e484d --- /dev/null +++ b/history_employee/views/employee_history.xml @@ -0,0 +1,25 @@ + + + + + + hr.employeehistory.view + hr.employee + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/history_employee/views/history_views.xml b/history_employee/views/history_views.xml new file mode 100644 index 00000000..43d8ac98 --- /dev/null +++ b/history_employee/views/history_views.xml @@ -0,0 +1,67 @@ + + + + + departmenthistory.tree + department.history + form + tree + + + + + + + + + + + + + timesheetcost.tree + timesheet.cost + form + tree + + + + + + + + + + + + salaryhistory.tree + salary.history + form + tree + + + + + + + + + + + + + contracthistory.tree + contract.history + form + tree + + + + + + + + + + + + diff --git a/hr_custody/README.rst b/hr_custody/README.rst new file mode 100644 index 00000000..560fb4cf --- /dev/null +++ b/hr_custody/README.rst @@ -0,0 +1,47 @@ +Open HRMS Custody Management +============================ + +Functionality to give and track the assets of a company to employees. + - Creates a new menu item Custody Management under Employees + - Can create custody contract with an employee + - Can take the report of custody + +Depends +======= +[hr, mail, hr_employee_updation] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developers: Avinash Nk + Jesni Banu + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_custody/__init__.py b/hr_custody/__init__.py new file mode 100644 index 00000000..6a68978a --- /dev/null +++ b/hr_custody/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models +from . import reports diff --git a/hr_custody/__manifest__.py b/hr_custody/__manifest__.py new file mode 100644 index 00000000..c8d716b3 --- /dev/null +++ b/hr_custody/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Custody', + 'version': '12.0.1.0.0', + 'summary': """Manage the company properties when it is in the custody of an employee""", + 'description': 'Manage the company properties when it is in the custody of an employee', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['hr', 'mail', 'hr_employee_updation'], + 'data': [ + 'security/ir.model.access.csv', + 'security/custody_security.xml', + 'views/wizard_reason_view.xml', + 'views/custody_view.xml', + 'views/hr_custody_notification.xml', + 'views/hr_employee_view.xml', + 'views/notification_mail.xml', + 'reports/custody_report.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_custody/doc/RELEASE_NOTES.md b/hr_custody/doc/RELEASE_NOTES.md new file mode 100644 index 00000000..2c7d63dd --- /dev/null +++ b/hr_custody/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module hr_custody + +#### 01.03.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Open Hrms Project diff --git a/hr_custody/models/__init__.py b/hr_custody/models/__init__.py new file mode 100644 index 00000000..133b2963 --- /dev/null +++ b/hr_custody/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import custody +from . import hr_employee +from . import wizard_reason diff --git a/hr_custody/models/custody.py b/hr_custody/models/custody.py new file mode 100644 index 00000000..18601aa7 --- /dev/null +++ b/hr_custody/models/custody.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from datetime import date, datetime, timedelta +from odoo import models, fields, api, _ +from odoo.exceptions import Warning, UserError +from odoo.tools import image_resize_images + + +class HrCustody(models.Model): + """ + Hr custody contract creation model. + """ + _name = 'hr.custody' + _description = 'Hr Custody Management' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + def mail_reminder(self): + now = datetime.now() + timedelta(days=1) + date_now = now.date() + match = self.search([('state', '=', 'approved')]) + for i in match: + if i.return_date: + exp_date = fields.Date.from_string(i.return_date) + if exp_date <= date_now: + base_url = self.env['ir.config_parameter'].get_param('web.base.url') + url = base_url + _('/web#id=%s&view_type=form&model=hr.custody&menu_id=') % i.id + mail_content = _('Hi %s,
As per the %s you took %s on %s for the reason of %s. S0 here we ' + 'remind you that you have to return that on or before %s. Otherwise, you can ' + 'renew the reference number(%s) by extending the return date through following ' + 'link.
') % \ + (i.employee.name, i.name, i.custody_name.name, i.date_request, i.purpose, + date_now, i.name, url, i.name) + main_content = { + 'subject': _('REMINDER On %s') % i.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': i.employee.work_email, + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + if i.employee.user_id: + mail_id.mail_message_id.write({'needaction_partner_ids': [(4, i.employee.user_id.partner_id.id)]}) + mail_id.mail_message_id.write({'partner_ids': [(4, i.employee.user_id.partner_id.id)]}) + + @api.model + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('hr.custody') + return super(HrCustody, self).create(vals) + + @api.multi + def sent(self): + self.state = 'to_approve' + + @api.multi + def send_mail(self): + template = self.env.ref('hr_custody.custody_email_notification_template') + self.env['mail.template'].browse(template.id).send_mail(self.id) + self.mail_send = True + + @api.multi + def set_to_draft(self): + self.state = 'draft' + + @api.multi + def renew_approve(self): + for custody in self.env['hr.custody'].search([('custody_name', '=', self.custody_name.id)]): + if custody.state == "approved": + raise UserError(_("Custody is not available now")) + self.return_date = self.renew_date + self.renew_date = '' + self.state = 'approved' + + @api.multi + def renew_refuse(self): + for custody in self.env['hr.custody'].search([('custody_name', '=', self.custody_name.id)]): + if custody.state == "approved": + raise UserError(_("Custody is not available now")) + self.renew_date = '' + self.state = 'approved' + + @api.multi + def approve(self): + for custody in self.env['hr.custody'].search([('custody_name', '=', self.custody_name.id)]): + if custody.state == "approved": + raise UserError(_("Custody is not available now")) + self.state = 'approved' + + @api.multi + def set_to_return(self): + self.state = 'returned' + self.return_date = date.today() + + # return date validation + @api.constrains('return_date') + def validate_return_date(self): + if self.return_date < self.date_request: + raise Warning('Please Give Valid Return Date') + + name = fields.Char(string='Code', copy=False) + company_id = fields.Many2one('res.company', 'Company', readonly=True, + default=lambda self: self.env.user.company_id) + rejected_reason = fields.Text(string='Rejected Reason', copy=False, readonly=1) + renew_rejected_reason = fields.Text(string='Renew Rejected Reason', copy=False, readonly=1) + date_request = fields.Date(string='Requested Date', required=True, track_visibility='always', readonly=True, + states={'draft': [('readonly', False)]}, default=datetime.now().strftime('%Y-%m-%d')) + employee = fields.Many2one('hr.employee', string='Employee', required=True, readonly=True, + states={'draft': [('readonly', False)]}) + purpose = fields.Char(string='Reason', track_visibility='always', required=True, readonly=True, + states={'draft': [('readonly', False)]}) + custody_name = fields.Many2one('custody.property', string='Property', required=True, readonly=True, + states={'draft': [('readonly', False)]}) + return_date = fields.Date(string='Return Date', required=True, track_visibility='always', readonly=True, + states={'draft': [('readonly', False)]}) + renew_date = fields.Date(string='Renewal Return Date', track_visibility='always', readonly=True, copy=False) + notes = fields.Html(string='Notes') + renew_return_date = fields.Boolean(default=False, copy=False) + renew_reject = fields.Boolean(default=False, copy=False) + state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), ('approved', 'Approved'), + ('returned', 'Returned'), ('rejected', 'Refused')], string='Status', default='draft', + track_visibility='always') + mail_send = fields.Boolean(string="Mail Send") + + +class HrPropertyName(models.Model): + """ + Hr property creation model. + """ + _name = 'custody.property' + _description = 'Property Name' + + name = fields.Char(string='Property Name', required=True) + image = fields.Binary( + "Image", attachment=True, + help="This field holds the image used for this provider, limited to 1024x1024px") + image_medium = fields.Binary( + "Medium-sized image", attachment=True, + help="Medium-sized image of this provider. It is automatically " + "resized as a 128x128px image, with aspect ratio preserved. " + "Use this field in form views or some kanban views.") + image_small = fields.Binary( + "Small-sized image", attachment=True, + help="Small-sized image of this provider. It is automatically " + "resized as a 64x64px image, with aspect ratio preserved. " + "Use this field anywhere a small image is required.") + desc = fields.Html(string='Description') + company_id = fields.Many2one('res.company', 'Company', + default=lambda self: self.env.user.company_id) + + @api.model + def create(self, vals): + image_resize_images(vals) + return super(HrPropertyName, self).create(vals) + + @api.multi + def write(self, vals): + image_resize_images(vals) + return super(HrPropertyName, self).write(vals) + + +class HrReturnDate(models.TransientModel): + """Hr custody contract renewal wizard""" + _name = 'wizard.return.date' + _description = 'Hr Custody Name' + + returned_date = fields.Date(string='Renewal Date', required=1) + + # renewal date validation + @api.constrains('returned_date') + def validate_return_date(self): + context = self._context + custody_obj = self.env['hr.custody'].search([('id', '=', context.get('custody_id'))]) + if self.returned_date <= custody_obj.date_request: + raise Warning('Please Give Valid Renewal Date') + + @api.multi + def proceed(self): + context = self._context + custody_obj = self.env['hr.custody'].search([('id', '=', context.get('custody_id'))]) + custody_obj.write({'renew_return_date': True, + 'renew_date': self.returned_date, + 'state': 'to_approve'}) diff --git a/hr_custody/models/hr_employee.py b/hr_custody/models/hr_employee.py new file mode 100644 index 00000000..1881ad48 --- /dev/null +++ b/hr_custody/models/hr_employee.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields, api, _ + + +class HrCustody(models.Model): + _inherit = 'hr.employee' + + custody_count = fields.Integer(compute='_custody_count', string='# Custody') + equipment_count = fields.Integer(compute='_equipment_count', string='# Equipments') + + # count of all custody contracts + @api.multi + def _custody_count(self): + for each in self: + custody_ids = self.env['hr.custody'].search([('employee', '=', each.id)]) + each.custody_count = len(custody_ids) + + # count of all custody contracts that are in approved state + @api.multi + def _equipment_count(self): + for each in self: + equipment_obj = self.env['hr.custody'].search([('employee', '=', each.id), ('state', '=', 'approved')]) + equipment_ids = [] + for each1 in equipment_obj: + if each1.custody_name.id not in equipment_ids: + equipment_ids.append(each1.custody_name.id) + each.equipment_count = len(equipment_ids) + + # smart button action for returning the view of all custody contracts related to the current employee + @api.multi + def custody_view(self): + for each1 in self: + custody_obj = self.env['hr.custody'].search([('employee', '=', each1.id)]) + custody_ids = [] + for each in custody_obj: + custody_ids.append(each.id) + view_id = self.env.ref('hr_custody.hr_custody_form_view').id + if custody_ids: + if len(custody_ids) <= 1: + value = { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'hr.custody', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Custody'), + 'res_id': custody_ids and custody_ids[0] + } + else: + value = { + 'domain': str([('id', 'in', custody_ids)]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'hr.custody', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'name': _('Custody'), + 'res_id': custody_ids + } + + return value + + # smart button action for returning the view of all custody contracts that are in approved state, + # related to the current employee + @api.multi + def equipment_view(self): + for each1 in self: + equipment_obj = self.env['hr.custody'].search([('employee', '=', each1.id), ('state', '=', 'approved')]) + equipment_ids = [] + for each in equipment_obj: + if each.custody_name.id not in equipment_ids: + equipment_ids.append(each.custody_name.id) + view_id = self.env.ref('hr_custody.custody_custody_form_view').id + if equipment_ids: + if len(equipment_ids) <= 1: + value = { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'custody.property', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Equipments'), + 'res_id': equipment_ids and equipment_ids[0] + } + else: + value = { + 'domain': str([('id', 'in', equipment_ids)]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'custody.property', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'name': _('Equipments'), + 'res_id': equipment_ids + } + + return value diff --git a/hr_custody/models/wizard_reason.py b/hr_custody/models/wizard_reason.py new file mode 100644 index 00000000..c08b0804 --- /dev/null +++ b/hr_custody/models/wizard_reason.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields, api, _ + + +class WizardReason(models.TransientModel): + """ + Hr custody contract refuse wizard. + """ + _name = 'wizard.reason' + + @api.multi + def send_reason(self): + context = self._context + reject_obj = self.env[context.get('model_id')].search([('id', '=', context.get('reject_id'))]) + if 'renew' in context.keys(): + reject_obj.write({'state': 'approved', + 'renew_reject': True, + 'renew_rejected_reason': self.reason}) + else: + if context.get('model_id') == 'hr.holidays': + reject_obj.write({'rejected_reason': self.reason}) + reject_obj.action_refuse() + else: + reject_obj.write({'state': 'rejected', + 'rejected_reason': self.reason}) + + reason = fields.Text(string="Reason") diff --git a/hr_custody/reports/__init__.py b/hr_custody/reports/__init__.py new file mode 100644 index 00000000..46e90bac --- /dev/null +++ b/hr_custody/reports/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import custody_report diff --git a/hr_custody/reports/custody_report.py b/hr_custody/reports/custody_report.py new file mode 100644 index 00000000..117a4bac --- /dev/null +++ b/hr_custody/reports/custody_report.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Authors: Avinash Nk, Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields, tools + + +class CustodyHistory(models.Model): + _name = "report.custody" + _description = "Custody Analysis" + _auto = False + + name = fields.Char(string='Code') + date_request = fields.Date(string='Requested Date') + employee = fields.Many2one('hr.employee', string='Employee') + purpose = fields.Char(string='Reason') + custody_name = fields.Many2one('custody.property', string='Property Name') + return_date = fields.Date(string='Return Date') + renew_date = fields.Date(string='Renewal Return Date') + renew_return_date = fields.Boolean(string='Renewal Return Date') + state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), ('approved', 'Approved'), + ('returned', 'Returned'), ('rejected', 'Refused')], string='Status') + + _order = 'name desc' + + def _select(self): + select_str = """ + SELECT + (select 1 ) AS nbr, + t.id as id, + t.name as name, + t.date_request as date_request, + t.employee as employee, + t.purpose as purpose, + t.custody_name as custody_name, + t.return_date as return_date, + t.renew_date as renew_date, + t.renew_return_date as renew_return_date, + t.state as state + """ + return select_str + + def _group_by(self): + group_by_str = """ + GROUP BY + t.id, + name, + date_request, + employee, + purpose, + custody_name, + return_date, + renew_date, + renew_return_date, + state + """ + return group_by_str + + def init(self): + tools.sql.drop_view_if_exists(self._cr, 'report_custody') + self._cr.execute(""" + CREATE view report_custody as + %s + FROM hr_custody t + %s + """ % (self._select(), self._group_by())) diff --git a/hr_custody/reports/custody_report.xml b/hr_custody/reports/custody_report.xml new file mode 100644 index 00000000..7fe305fb --- /dev/null +++ b/hr_custody/reports/custody_report.xml @@ -0,0 +1,31 @@ + + + + + report.custody.pivot + report.custody + + + + + + + + + Custody Analysis + report.custody + form + pivot + {'group_by_no_leaf':1,'group_by':[]} + This report allows you to analyse all Custody Requests. + + + + + + + \ No newline at end of file diff --git a/hr_custody/security/custody_security.xml b/hr_custody/security/custody_security.xml new file mode 100644 index 00000000..311521f1 --- /dev/null +++ b/hr_custody/security/custody_security.xml @@ -0,0 +1,16 @@ + + + + Custody Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Custody Request Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + diff --git a/hr_custody/security/ir.model.access.csv b/hr_custody/security/ir.model.access.csv new file mode 100644 index 00000000..2c8043f1 --- /dev/null +++ b/hr_custody/security/ir.model.access.csv @@ -0,0 +1,13 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_hr_custody_hr","hr.custody.hr","model_hr_custody","hr.group_hr_manager",1,1,1,1 +"access_hr_custody_hr_manager","hr.custody.user","model_hr_custody","hr.group_hr_user",1,1,1,1 +"access_hr_custody_hr_employee","hr.custody.employee","model_hr_custody","base.group_user",1,1,1,0 +"access_hr_custody_hr1","hr.custody.hr1","model_custody_property","hr.group_hr_manager",1,1,1,1 +"access_hr_custody_hr_manager1","hr.custody.user1","model_custody_property","hr.group_hr_user",1,1,1,1 +"access_hr_custody_hr_employee1","hr.custody.employee1","model_custody_property","base.group_user",1,1,1,0 +"access_hr_custody_hr2","hr.custody.hr2","model_wizard_return_date","hr.group_hr_manager",1,1,1,1 +"access_hr_custody_hr3","hr.custody.hr3","model_report_custody","hr.group_hr_manager",1,1,1,1 +"access_hr_custody_hr_manager2","hr.custody.user2","model_wizard_return_date","hr.group_hr_user",1,1,1,1 +"access_hr_custody_hr_manager3","hr.custody.user3","model_report_custody","hr.group_hr_user",1,1,1,1 +"access_hr_custody_hr_employee2","hr.custody.employee2","model_wizard_return_date","base.group_user",1,1,1,0 + diff --git a/hr_custody/static/description/HRMS-BUTTON.png b/hr_custody/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/hr_custody/static/description/HRMS-BUTTON.png differ diff --git a/hr_custody/static/description/Loan-accounting.jpg b/hr_custody/static/description/Loan-accounting.jpg new file mode 100644 index 00000000..e8c0e44a Binary files /dev/null and b/hr_custody/static/description/Loan-accounting.jpg differ diff --git a/hr_custody/static/description/advance-salary.jpg b/hr_custody/static/description/advance-salary.jpg new file mode 100644 index 00000000..dc4ceea3 Binary files /dev/null and b/hr_custody/static/description/advance-salary.jpg differ diff --git a/hr_custody/static/description/advance-salery-accounting.png b/hr_custody/static/description/advance-salery-accounting.png new file mode 100644 index 00000000..e71b7629 Binary files /dev/null and b/hr_custody/static/description/advance-salery-accounting.png differ diff --git a/hr_custody/static/description/announcement.jpg b/hr_custody/static/description/announcement.jpg new file mode 100644 index 00000000..7c9a0be1 Binary files /dev/null and b/hr_custody/static/description/announcement.jpg differ diff --git a/hr_custody/static/description/attendance-regularization.jpg b/hr_custody/static/description/attendance-regularization.jpg new file mode 100644 index 00000000..41e42467 Binary files /dev/null and b/hr_custody/static/description/attendance-regularization.jpg differ diff --git a/hr_custody/static/description/banner.jpg b/hr_custody/static/description/banner.jpg new file mode 100644 index 00000000..6469f976 Binary files /dev/null and b/hr_custody/static/description/banner.jpg differ diff --git a/hr_custody/static/description/branch-transfer.jpg b/hr_custody/static/description/branch-transfer.jpg new file mode 100644 index 00000000..08f39810 Binary files /dev/null and b/hr_custody/static/description/branch-transfer.jpg differ diff --git a/hr_custody/static/description/core.gif b/hr_custody/static/description/core.gif new file mode 100644 index 00000000..3b1483e9 Binary files /dev/null and b/hr_custody/static/description/core.gif differ diff --git a/hr_custody/static/description/custody-management.jpg b/hr_custody/static/description/custody-management.jpg new file mode 100644 index 00000000..1f952a05 Binary files /dev/null and b/hr_custody/static/description/custody-management.jpg differ diff --git a/hr_custody/static/description/custody_icon.png b/hr_custody/static/description/custody_icon.png new file mode 100644 index 00000000..00d1363f Binary files /dev/null and b/hr_custody/static/description/custody_icon.png differ diff --git a/hr_custody/static/description/cybro-service.png b/hr_custody/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/hr_custody/static/description/cybro-service.png differ diff --git a/hr_custody/static/description/cybro_logo.png b/hr_custody/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/hr_custody/static/description/cybro_logo.png differ diff --git a/hr_custody/static/description/dashboard.gif b/hr_custody/static/description/dashboard.gif new file mode 100644 index 00000000..003b9d4d Binary files /dev/null and b/hr_custody/static/description/dashboard.gif differ diff --git a/hr_custody/static/description/employee-appraisal.jpg b/hr_custody/static/description/employee-appraisal.jpg new file mode 100644 index 00000000..cbd13706 Binary files /dev/null and b/hr_custody/static/description/employee-appraisal.jpg differ diff --git a/hr_custody/static/description/employee-background-verification.jpg b/hr_custody/static/description/employee-background-verification.jpg new file mode 100644 index 00000000..97b80104 Binary files /dev/null and b/hr_custody/static/description/employee-background-verification.jpg differ diff --git a/hr_custody/static/description/employee-checklist.jpg b/hr_custody/static/description/employee-checklist.jpg new file mode 100644 index 00000000..47ebda7b Binary files /dev/null and b/hr_custody/static/description/employee-checklist.jpg differ diff --git a/hr_custody/static/description/employee-creation-from-user.jpg b/hr_custody/static/description/employee-creation-from-user.jpg new file mode 100644 index 00000000..b4ffa42a Binary files /dev/null and b/hr_custody/static/description/employee-creation-from-user.jpg differ diff --git a/hr_custody/static/description/employee-disciplinary-tracking.jpg b/hr_custody/static/description/employee-disciplinary-tracking.jpg new file mode 100644 index 00000000..3d4c252c Binary files /dev/null and b/hr_custody/static/description/employee-disciplinary-tracking.jpg differ diff --git a/hr_custody/static/description/employee-document.jpg b/hr_custody/static/description/employee-document.jpg new file mode 100644 index 00000000..6d42f89f Binary files /dev/null and b/hr_custody/static/description/employee-document.jpg differ diff --git a/hr_custody/static/description/employee-gratuity-settlement-min.jpg b/hr_custody/static/description/employee-gratuity-settlement-min.jpg new file mode 100644 index 00000000..8743e456 Binary files /dev/null and b/hr_custody/static/description/employee-gratuity-settlement-min.jpg differ diff --git a/hr_custody/static/description/employee-histroy.gif b/hr_custody/static/description/employee-histroy.gif new file mode 100644 index 00000000..73b66613 Binary files /dev/null and b/hr_custody/static/description/employee-histroy.gif differ diff --git a/hr_custody/static/description/employee-info.jpg b/hr_custody/static/description/employee-info.jpg new file mode 100644 index 00000000..295c6fe9 Binary files /dev/null and b/hr_custody/static/description/employee-info.jpg differ diff --git a/hr_custody/static/description/employee-stages.jpg b/hr_custody/static/description/employee-stages.jpg new file mode 100644 index 00000000..6c3749e4 Binary files /dev/null and b/hr_custody/static/description/employee-stages.jpg differ diff --git a/hr_custody/static/description/icon.png b/hr_custody/static/description/icon.png new file mode 100644 index 00000000..8c486ecc Binary files /dev/null and b/hr_custody/static/description/icon.png differ diff --git a/hr_custody/static/description/index.html b/hr_custody/static/description/index.html new file mode 100644 index 00000000..4680a075 --- /dev/null +++ b/hr_custody/static/description/index.html @@ -0,0 +1,634 @@ +
+
+

+ Open HRMS Custody Management +

+

+ Manages Custody Handling Process +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Blues over resource tracking? No more worries. + OHRMS Custody Management system constitutes the ultimate + solution for a transparent custody of company resources. +

+
+
+
+ +
+

+ Features +

+
+
+ Managing custody handling process.
+ Option to renewal.
+ Option to take reports. + + +
+
+
+
+
+ +
+
+

+ Custody Request +

+

+ + Create a Custody Request and send for Approval. +
+

+
+ +
+

+ Property +

+

+ + Create a Property of Company. +
+

+
+ +
+
+
+
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+ + + + +
+ +

SUGGESTED PRODUCTS

+ + +
+ + + +
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/hr_custody/static/description/insurance.jpg b/hr_custody/static/description/insurance.jpg new file mode 100644 index 00000000..be476695 Binary files /dev/null and b/hr_custody/static/description/insurance.jpg differ diff --git a/hr_custody/static/description/leave-request-aliasing.jpg b/hr_custody/static/description/leave-request-aliasing.jpg new file mode 100644 index 00000000..c3e4da4b Binary files /dev/null and b/hr_custody/static/description/leave-request-aliasing.jpg differ diff --git a/hr_custody/static/description/legal.jpg b/hr_custody/static/description/legal.jpg new file mode 100644 index 00000000..bb0765d5 Binary files /dev/null and b/hr_custody/static/description/legal.jpg differ diff --git a/hr_custody/static/description/loan.jpg b/hr_custody/static/description/loan.jpg new file mode 100644 index 00000000..7fe9cc37 Binary files /dev/null and b/hr_custody/static/description/loan.jpg differ diff --git a/hr_custody/static/description/multi-company.jpg b/hr_custody/static/description/multi-company.jpg new file mode 100644 index 00000000..3a05983a Binary files /dev/null and b/hr_custody/static/description/multi-company.jpg differ diff --git a/hr_custody/static/description/oh_icon.png b/hr_custody/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_custody/static/description/oh_icon.png differ diff --git a/hr_custody/static/description/open-hrms-custody-1.png b/hr_custody/static/description/open-hrms-custody-1.png new file mode 100644 index 00000000..02e5fa2c Binary files /dev/null and b/hr_custody/static/description/open-hrms-custody-1.png differ diff --git a/hr_custody/static/description/open-hrms-custody-2.png b/hr_custody/static/description/open-hrms-custody-2.png new file mode 100644 index 00000000..e7ba360a Binary files /dev/null and b/hr_custody/static/description/open-hrms-custody-2.png differ diff --git a/hr_custody/static/description/pdf-preview.jpg b/hr_custody/static/description/pdf-preview.jpg new file mode 100644 index 00000000..5fae8bf0 Binary files /dev/null and b/hr_custody/static/description/pdf-preview.jpg differ diff --git a/hr_custody/static/description/reminder.jpg b/hr_custody/static/description/reminder.jpg new file mode 100644 index 00000000..dbdb4b3e Binary files /dev/null and b/hr_custody/static/description/reminder.jpg differ diff --git a/hr_custody/static/description/resignation-process.jpg b/hr_custody/static/description/resignation-process.jpg new file mode 100644 index 00000000..14ce4ba2 Binary files /dev/null and b/hr_custody/static/description/resignation-process.jpg differ diff --git a/hr_custody/static/description/saudi-gosi.jpg b/hr_custody/static/description/saudi-gosi.jpg new file mode 100644 index 00000000..0df5ffc1 Binary files /dev/null and b/hr_custody/static/description/saudi-gosi.jpg differ diff --git a/hr_custody/static/description/service.jpg b/hr_custody/static/description/service.jpg new file mode 100644 index 00000000..d4e302d4 Binary files /dev/null and b/hr_custody/static/description/service.jpg differ diff --git a/hr_custody/static/description/shift.jpg b/hr_custody/static/description/shift.jpg new file mode 100644 index 00000000..ebde24ad Binary files /dev/null and b/hr_custody/static/description/shift.jpg differ diff --git a/hr_custody/static/description/vacation-approval.jpg b/hr_custody/static/description/vacation-approval.jpg new file mode 100644 index 00000000..e141c393 Binary files /dev/null and b/hr_custody/static/description/vacation-approval.jpg differ diff --git a/hr_custody/static/description/vacation-management-accounting.jpg b/hr_custody/static/description/vacation-management-accounting.jpg new file mode 100644 index 00000000..32bb6027 Binary files /dev/null and b/hr_custody/static/description/vacation-management-accounting.jpg differ diff --git a/hr_custody/static/description/vacation-project.jpg b/hr_custody/static/description/vacation-project.jpg new file mode 100644 index 00000000..736f0109 Binary files /dev/null and b/hr_custody/static/description/vacation-project.jpg differ diff --git a/hr_custody/static/description/vacation.jpg b/hr_custody/static/description/vacation.jpg new file mode 100644 index 00000000..0a1dcbb1 Binary files /dev/null and b/hr_custody/static/description/vacation.jpg differ diff --git a/hr_custody/static/description/wps.jpg b/hr_custody/static/description/wps.jpg new file mode 100644 index 00000000..4fcb842d Binary files /dev/null and b/hr_custody/static/description/wps.jpg differ diff --git a/hr_custody/static/description/zk.jpg b/hr_custody/static/description/zk.jpg new file mode 100644 index 00000000..715519d1 Binary files /dev/null and b/hr_custody/static/description/zk.jpg differ diff --git a/hr_custody/views/custody_view.xml b/hr_custody/views/custody_view.xml new file mode 100644 index 00000000..e4ca1206 --- /dev/null +++ b/hr_custody/views/custody_view.xml @@ -0,0 +1,229 @@ + + + + + Custody Code + hr.custody + CR + + + + + + wizard.return.date.form + wizard.return.date + +
+ + + + + +
+
+
+
+
+ + + custody.property.form + custody.property + +
+ + +
+

+
+ + + + + + + + + + + +
+
+
+
+ + + Custody Request + wizard.return.date + form + form + + new + + + + hr.custody.form + hr.custody + +
+
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + hr.custody.tree + hr.custody + + + + + + + + + + + + + + + hr_property_tree_view.tree + custody.property + + + + + + + + + hr.custody.search + hr.custody + + + + + + + + + + + + + + + + + + + + + Custody + hr.custody + form + tree,form + + +

+ Click to Create a New Record. +

+
+
+ + + Property + custody.property + form + tree,form + +

+ Click to Create a New Record. +

+
+
+ + + + + + + + +
+
\ No newline at end of file diff --git a/hr_custody/views/hr_custody_notification.xml b/hr_custody/views/hr_custody_notification.xml new file mode 100644 index 00000000..b6746d8f --- /dev/null +++ b/hr_custody/views/hr_custody_notification.xml @@ -0,0 +1,15 @@ + + + + + HR Custody Return Notification + 1 + days + -1 + + + code + model.mail_reminder() + + + diff --git a/hr_custody/views/hr_employee_view.xml b/hr_custody/views/hr_employee_view.xml new file mode 100644 index 00000000..148f55ac --- /dev/null +++ b/hr_custody/views/hr_employee_view.xml @@ -0,0 +1,20 @@ + + + + + hr.employee.form.inherit.view + hr.employee + + +
+ + +
+
+
+
+
\ No newline at end of file diff --git a/hr_custody/views/notification_mail.xml b/hr_custody/views/notification_mail.xml new file mode 100644 index 00000000..189af3fa --- /dev/null +++ b/hr_custody/views/notification_mail.xml @@ -0,0 +1,24 @@ + + + + + Custody e-mail template + ${object.company_id and object.company_id.email or ''} + Notification to return company asset-${object.custody_name.name} + ${object.email|safe} + ${object.lang} + + + + Dear ${(object.employee.name)},

+ You are in possession of the company asset + "${(object.custody_name.name)}" + since ${(object.return_date)}.

+ Please kindly return the property as soon as possible.

+ Regards,

+ ${(object.company_id.name)}]]> +
+
+
+
\ No newline at end of file diff --git a/hr_custody/views/wizard_reason_view.xml b/hr_custody/views/wizard_reason_view.xml new file mode 100644 index 00000000..64e79a12 --- /dev/null +++ b/hr_custody/views/wizard_reason_view.xml @@ -0,0 +1,30 @@ + + + + + wizard.reason.form + wizard.reason + +
+ + + +
+
+
+
+
+ + + Update Reason + wizard.reason + form + form + + new + +
+
\ No newline at end of file diff --git a/hr_disciplinary_tracking/README.rst b/hr_disciplinary_tracking/README.rst new file mode 100755 index 00000000..4e4cafef --- /dev/null +++ b/hr_disciplinary_tracking/README.rst @@ -0,0 +1,40 @@ +OHRMS Disciplinary Action v12 +============================== + +Track the Disciplinary actions of Employees + +Depends +======= +[oh_employee_creation_from_user] addon Open HRMS +[mail] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Ajmal J K @ cybrosys + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_disciplinary_tracking/__init__.py b/hr_disciplinary_tracking/__init__.py new file mode 100755 index 00000000..a0fdc10f --- /dev/null +++ b/hr_disciplinary_tracking/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/hr_disciplinary_tracking/__manifest__.py b/hr_disciplinary_tracking/__manifest__.py new file mode 100755 index 00000000..7603fdb8 --- /dev/null +++ b/hr_disciplinary_tracking/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Ajmal JK() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Disciplinary Tracking', + 'version': '12.0.1.0.0', + 'summary': """Employee Disciplinary Tracking Management""", + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'category': 'Generic Modules/Human Resources', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'mail', 'oh_employee_creation_from_user'], + 'data': ['views/disciplinary_action.xml', + 'views/disciplinary_sequence.xml', + 'views/category_view.xml', + 'security/ir.model.access.csv', + 'security/security.xml'], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_disciplinary_tracking/docs/RELEASE_NOTES.md b/hr_disciplinary_tracking/docs/RELEASE_NOTES.md new file mode 100755 index 00000000..ba025d6d --- /dev/null +++ b/hr_disciplinary_tracking/docs/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module disciplinary_action + +#### 10.10.2018 +#### Version 12.0.1.0.0 +##### ADD +- Initial Commit diff --git a/hr_disciplinary_tracking/models/__init__.py b/hr_disciplinary_tracking/models/__init__.py new file mode 100755 index 00000000..37e42e5b --- /dev/null +++ b/hr_disciplinary_tracking/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import disciplinary_action + diff --git a/hr_disciplinary_tracking/models/disciplinary_action.py b/hr_disciplinary_tracking/models/disciplinary_action.py new file mode 100755 index 00000000..60f72323 --- /dev/null +++ b/hr_disciplinary_tracking/models/disciplinary_action.py @@ -0,0 +1,177 @@ +# -*- coding: utf-8 -*- +from odoo import fields, models, api, exceptions, _ +import datetime +from odoo.exceptions import ValidationError,UserError +date_format = "%Y-%m-%d" + + +class CategoryDiscipline(models.Model): + + + _name = 'discipline.category' + _description = 'Reason Category' + + # Discipline Categories + + code = fields.Char(string="Code",required=True) + name = fields.Char(string="Name",required=True) + description = fields.Text(string="Details") + +class CategoryAction(models.Model): + + + _name = 'action.category' + _description = 'Action Category' + + # Action Categories + + code = fields.Char(string="Code", required=True) + name = fields.Char(string="Name", required=True) + description = fields.Text(string="Details") + +class DisciplinaryAction(models.Model): + + + _name = 'disciplinary.action' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Disciplinary Action" + + state = fields.Selection([ + ('draft', 'Draft'), + ('explain', 'Waiting Explanation'), + ('submitted', 'Waiting Action'), + ('action', 'Action Validated'), + ('cancel', 'Cancelled'), + + ], default='draft',track_visibility='onchange') + + name = fields.Char(string='Reference', required=True, copy=False, readonly=True, + default=lambda self: _('New')) + + employee_name = fields.Many2one('hr.employee', string='Employee', required=True) + department_name = fields.Many2one('hr.department', string='Department', required=True) + discipline_reason = fields.Many2one('discipline.category', string='Reason', required=True) + explanation = fields.Text(string="Explanation by Employee", help='Employee have to give Explanation' + 'to manager about the violation of discipline') + action = fields.Many2one('action.category', string="Action") + read_only = fields.Boolean(compute="get_user",default=True) + warning_letter = fields.Html(string="Warning Letter") + suspension_letter = fields.Html(string="Suspension Letter") + termination_letter = fields.Html(string="Termination Letter") + warning = fields.Integer(default=False) + action_details = fields.Text(string="Action Details") + attachment_ids = fields.Many2many('ir.attachment', string="Attachments", + help="Employee can submit any documents which supports their explanation") + note = fields.Text(string="Internal Note") + joined_date = fields.Date(string="Joined Date") + + + # assigning the sequence for the record + @api.model + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('disciplinary.action') + return super(DisciplinaryAction, self).create(vals) + + # Check the user is a manager or employee + @api.depends('read_only') + def get_user(self): + + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if res_user.has_group('hr.group_hr_manager'): + self.read_only = True + else: + self.read_only = False + print(self.read_only) + + # Check the Action Selected + @api.onchange('action') + def onchange_action(self): + if self.action.name == 'Written Warning': + self.warning = 1 + elif self.action.name == 'Suspend the Employee for one Week': + self.warning = 2 + elif self.action.name == 'Terminate the Employee': + self.warning = 3 + elif self.action.name == 'No Action': + self.warning = 4 + else : + self.warning = 5 + + + + @api.onchange('employee_name') + @api.depends('employee_name') + def onchange_employee_name(self): + + department = self.env['hr.employee'].search([('name','=',self.employee_name.name)]) + self.department_name = department.department_id.id + + if self.state == 'action' : + raise ValidationError(_('You Can not edit a Validated Action !!')) + + @api.onchange('discipline_reason') + @api.depends('discipline_reason') + def onchange_reason(self): + if self.state == 'action' : + raise ValidationError(_('You Can not edit a Validated Action !!')) + + @api.multi + def assign_function(self): + + for rec in self: + rec.state = 'explain' + + @api.multi + def cancel_function(self): + for rec in self: + rec.state = 'cancel' + + @api.multi + def set_to_function(self): + for rec in self: + rec.state = 'draft' + + @api.multi + def action_function(self): + for rec in self: + if not rec.action: + raise ValidationError(_('You have to select an Action !!')) + + if self.warning == 1 : + if not rec.warning_letter or rec.warning_letter == '


' : + raise ValidationError(_('You have to fill up the Warning Letter in Action Information !!')) + + elif self.warning == 2 : + if not rec.suspension_letter or rec.suspension_letter == '


': + raise ValidationError(_('You have to fill up the Suspension Letter in Action Information !!')) + + elif self.warning == 3 : + if not rec.termination_letter or rec.termination_letter == '


': + raise ValidationError(_('You have to fill up the Termination Letter in Action Information !!')) + + elif self.warning == 4: + self.action_details = "No Action Proceed" + + + elif self.warning == 5 : + if not rec.action_details: + raise ValidationError(_('You have to fill up the Action Information !!')) + rec.state = 'action' + + @api.multi + def explanation_function(self): + for rec in self: + + if not rec.explanation: + raise ValidationError(_('You must give an explanation !!')) + if len(self.explanation.split()) <5 : + raise ValidationError(_('Your explanation must contain at least 5 words !!')) + + self.write({ + 'state' : 'submitted' + }) + + + + + diff --git a/hr_disciplinary_tracking/security/ir.model.access.csv b/hr_disciplinary_tracking/security/ir.model.access.csv new file mode 100755 index 00000000..cf8c2ee9 --- /dev/null +++ b/hr_disciplinary_tracking/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +view_disciplinary_action,view.disciplinary.action,model_disciplinary_action,hr.group_hr_manager,1,1,1,1 +view_disciplinary_action_user,view.disciplinary.action.user,model_disciplinary_action,base.group_user,1,1,0,0 +view_discipline_category,view.discipline.category,model_discipline_category,hr.group_hr_manager,1,1,1,1 +view_action_category,view.action.category,model_action_category,hr.group_hr_manager,1,1,1,1 + + + diff --git a/hr_disciplinary_tracking/security/security.xml b/hr_disciplinary_tracking/security/security.xml new file mode 100755 index 00000000..40a60172 --- /dev/null +++ b/hr_disciplinary_tracking/security/security.xml @@ -0,0 +1,15 @@ + + + + Discipline Visibility + + [('employee_name.address_home_id.id','=',user.partner_id.id),('state','!=','draft')] + + + + Administrator Visibility + + [] + + + diff --git a/hr_disciplinary_tracking/static/description/HRMS-BUTTON.png b/hr_disciplinary_tracking/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_disciplinary_tracking/static/description/HRMS-BUTTON.png differ diff --git a/hr_disciplinary_tracking/static/description/banner.jpg b/hr_disciplinary_tracking/static/description/banner.jpg new file mode 100755 index 00000000..a2994ee3 Binary files /dev/null and b/hr_disciplinary_tracking/static/description/banner.jpg differ diff --git a/hr_disciplinary_tracking/static/description/cybro-service.png b/hr_disciplinary_tracking/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_disciplinary_tracking/static/description/cybro-service.png differ diff --git a/hr_disciplinary_tracking/static/description/cybro_logo.png b/hr_disciplinary_tracking/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_disciplinary_tracking/static/description/cybro_logo.png differ diff --git a/hr_disciplinary_tracking/static/description/icon.png b/hr_disciplinary_tracking/static/description/icon.png new file mode 100755 index 00000000..a2349a1d Binary files /dev/null and b/hr_disciplinary_tracking/static/description/icon.png differ diff --git a/hr_disciplinary_tracking/static/description/index.html b/hr_disciplinary_tracking/static/description/index.html new file mode 100755 index 00000000..8d4f5b43 --- /dev/null +++ b/hr_disciplinary_tracking/static/description/index.html @@ -0,0 +1,376 @@ +
+
+

+ Employee Disciplinary Tracking +

+

+ Track the Disciplinary actions of Employees. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ This module will help to track and maintain disciplinary actions of employees. + Manager can assign disciplinary issues to the employees. + Employees can give explanations against the issues and submit to the manager. + According to the explanation of employee manager can take the final action. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+
+ +
+

+ Features +

+
+
+ Manager can assign disciplinary issues to the employees.
+ Employees give explanations and submit it to the manager.
+ Manager can take the final action against the employee according to the Explanation. +
+
+
+
+
+ +
+
+

+ Screenshots +

+

+ + Select the Employee and the Discipline Reason and click 'Proceed' +
+

+
+ +
+

+ + Give the Explanation and click 'Submit' +
+

+
+ +
+

+ + Select the Action and Action Information and click 'Validate Action' +
+

+
+ +
+

+ + Click 'Action Category' menu to create new Action categories +
+

+
+ +
+

+ + Click 'Discipline Category' menu to create new Discipline Category reasons +
+

+
+ +
+
+
+ + +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/hr_disciplinary_tracking/static/description/oh_icon.png b/hr_disciplinary_tracking/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_disciplinary_tracking/static/description/oh_icon.png differ diff --git a/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-1.png b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-1.png new file mode 100644 index 00000000..69be61d0 Binary files /dev/null and b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-1.png differ diff --git a/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-2.png b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-2.png new file mode 100644 index 00000000..ee9c59a6 Binary files /dev/null and b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-2.png differ diff --git a/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-3.png b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-3.png new file mode 100644 index 00000000..00ed3ffa Binary files /dev/null and b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-3.png differ diff --git a/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-4.png b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-4.png new file mode 100644 index 00000000..0c127d7e Binary files /dev/null and b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-4.png differ diff --git a/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-5.png b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-5.png new file mode 100644 index 00000000..d712e9ce Binary files /dev/null and b/hr_disciplinary_tracking/static/description/open-hrms-disciplinary-action-5.png differ diff --git a/hr_disciplinary_tracking/views/category_view.xml b/hr_disciplinary_tracking/views/category_view.xml new file mode 100755 index 00000000..810a429f --- /dev/null +++ b/hr_disciplinary_tracking/views/category_view.xml @@ -0,0 +1,143 @@ + + + + + + + RULES + Violation of Company Rules + + + BEHAVE + Misbehaviour to Co-workers + + + DAMAGE + Damage to Company Properties + + + INSTRUCTION + Not Follow Management Instructions + + + INSTRUCTION + Work Performance Issues + + + + + + NOACTION + No Action + + + + VERBAL + Verbal Warning + + + + + WRITTEN + Written Warning + + + + MEET + Meet the Manager + + + + SUSPENSION + Suspend the Employee + Suspend the Employee for one Week + + + + TERMINATE + Terminate the Employee + + + + + + discipline.category.tree + discipline.category + + + + + + + + + + discipline.category.form + discipline.category + +
+ + + + + + + +
+
+
+ + + + + action.category.tree + action.category + + + + + + + + + action.category.form + action.category + +
+ + + + + + + +
+
+
+ + + + + Discipline Categories + discipline.category + form + tree,form + + + + Action Categories + action.category + form + tree,form + + + + + + + + +
+
diff --git a/hr_disciplinary_tracking/views/disciplinary_action.xml b/hr_disciplinary_tracking/views/disciplinary_action.xml new file mode 100755 index 00000000..77c348ef --- /dev/null +++ b/hr_disciplinary_tracking/views/disciplinary_action.xml @@ -0,0 +1,142 @@ + + + + + + + disciplinary.action.tree + disciplinary.action + + + + + + + + + + + disciplinary.action.form + disciplinary.action + +
+
+
+ +
+

+ +

+
+

+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+
+
+ + + + Disciplinary Action Creation + disciplinary.action + form + tree,form + [('state','!=','action')] + + + + Disciplinary Action View + disciplinary.action + form + tree,form + + + + + inherit.employee.form.view + hr.employee + + + + + + + + + + + + + + + + + + + +
+
diff --git a/hr_disciplinary_tracking/views/disciplinary_sequence.xml b/hr_disciplinary_tracking/views/disciplinary_sequence.xml new file mode 100755 index 00000000..dcebfce6 --- /dev/null +++ b/hr_disciplinary_tracking/views/disciplinary_sequence.xml @@ -0,0 +1,14 @@ + + + + + + + Open HRMS Disciplinary Action + disciplinary.action + DIS + 3 + + + + diff --git a/hr_employee_shift/README.rst b/hr_employee_shift/README.rst new file mode 100644 index 00000000..a28b2f07 --- /dev/null +++ b/hr_employee_shift/README.rst @@ -0,0 +1,43 @@ +OHRMS Employee Shift v12 +======================== + +Easily create, manage, and track employee shift schedules + +Depends +======= +[hr] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/10.0/setup/install.html +- Install our custom addon + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Saritha Sahadevan, saritha@cybrosys.in + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_employee_shift/__init__.py b/hr_employee_shift/__init__.py new file mode 100644 index 00000000..7cacd9c2 --- /dev/null +++ b/hr_employee_shift/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models diff --git a/hr_employee_shift/__manifest__.py b/hr_employee_shift/__manifest__.py new file mode 100644 index 00000000..7dbe2c8a --- /dev/null +++ b/hr_employee_shift/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open Hrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': "Open HRMS Employee Shift", + 'version': '12.0.1.0.0', + 'summary': """Easily create, manage, and track employee shift schedules.""", + 'description': """Easily create, manage, and track employee shift schedules.""", + 'category': 'Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['hr', 'hr_payroll', 'resource'], + 'data': [ + 'security/ir.model.access.csv', + 'security/hr_employee_shift_security.xml', + 'views/hr_employee_shift_view.xml', + 'views/hr_employee_contract_view.xml', + 'views/hr_generate_shift_view.xml', + 'views/templates.xml', + ], + 'demo': [ + 'demo/shift_schedule_data.xml', + ], + 'images': ["static/description/banner.jpg"], + 'license': "AGPL-3", + 'installable': True, + 'application': True, +} diff --git a/hr_employee_shift/demo/shift_schedule_data.xml b/hr_employee_shift/demo/shift_schedule_data.xml new file mode 100644 index 00000000..863a8544 --- /dev/null +++ b/hr_employee_shift/demo/shift_schedule_data.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + Morning + + + + + + diff --git a/hr_employee_shift/doc/RELEASE_NOTES.md b/hr_employee_shift/doc/RELEASE_NOTES.md new file mode 100644 index 00000000..38c40aed --- /dev/null +++ b/hr_employee_shift/doc/RELEASE_NOTES.md @@ -0,0 +1,11 @@ +## Module + +#### 21.04.2018 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project + +#### 17.12.2018 +#### Version 11.0.1.0.1 +##### ADD +- Payslip creation considering employee shift \ No newline at end of file diff --git a/hr_employee_shift/models/__init__.py b/hr_employee_shift/models/__init__.py new file mode 100644 index 00000000..15320eb5 --- /dev/null +++ b/hr_employee_shift/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import hr_employee_shift, hr_employee_contract, hr_generate_shift, hr_shift_payroll +# from . import resource diff --git a/hr_employee_shift/models/hr_employee_contract.py b/hr_employee_shift/models/hr_employee_contract.py new file mode 100644 index 00000000..1f0884e2 --- /dev/null +++ b/hr_employee_shift/models/hr_employee_contract.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo.exceptions import Warning +from odoo import models, fields, api, _ + + +class HrEmployeeContract(models.Model): + _inherit = 'hr.contract' + + shift_schedule = fields.One2many('hr.shift.schedule', 'rel_hr_schedule', string="Shift Schedule") + working_hours = fields.Many2one('resource.calendar', string='Working Schedule') + department_id = fields.Many2one('hr.department', string="Department", + required=True) + + +class HrSchedule(models.Model): + _name = 'hr.shift.schedule' + + start_date = fields.Date(string="Date From", required=True) + end_date = fields.Date(string="Date To", required=True) + rel_hr_schedule = fields.Many2one('hr.contract') + hr_shift = fields.Many2one('resource.calendar', string="Shift", required=True) + company_id = fields.Many2one('res.company', string='Company') + + @api.onchange('start_date', 'end_date') + def get_department(self): + """Adding domain to the hr_shift field""" + hr_department = None + if self.start_date: + hr_department = self.rel_hr_schedule.department_id.id + return { + 'domain': { + 'hr_shift': [('hr_department', '=', hr_department)] + } + } + + @api.multi + def write(self, vals): + self._check_overlap(vals) + return super(HrSchedule, self).write(vals) + + @api.model + def create(self, vals): + self._check_overlap(vals) + return super(HrSchedule, self).create(vals) + + def _check_overlap(self, vals): + if vals.get('start_date', False) and vals.get('end_date', False): + shifts = self.env['hr.shift.schedule'].search([('rel_hr_schedule', '=', vals.get('rel_hr_schedule'))]) + for each in shifts: + if each != shifts[-1]: + if each.end_date >= vals.get('start_date') or each.start_date >= vals.get('start_date'): + raise Warning(_('The dates may not overlap with one another.')) + if vals.get('start_date') > vals.get('end_date'): + raise Warning(_('Start date should be less than end date.')) + return True + diff --git a/hr_employee_shift/models/hr_employee_shift.py b/hr_employee_shift/models/hr_employee_shift.py new file mode 100644 index 00000000..6e155e64 --- /dev/null +++ b/hr_employee_shift/models/hr_employee_shift.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo.exceptions import ValidationError +from odoo import models, fields, api, _ + + +class HrEmployeeInherited(models.Model): + _inherit = 'hr.employee' + + resource_calendar_ids = fields.Many2one('resource.calendar', 'Working Hours') + + +class HrEmployeeShift(models.Model): + _inherit = 'resource.calendar' + + def _get_default_attendance_ids(self): + return [ + (0, 0, {'name': _('Monday Morning'), 'dayofweek': '0', 'hour_from': 8, 'hour_to': 12}), + (0, 0, {'name': _('Tuesday Morning'), 'dayofweek': '1', 'hour_from': 8, 'hour_to': 12}), + (0, 0, {'name': _('Wednesday Morning'), 'dayofweek': '2', 'hour_from': 8, 'hour_to': 12}), + (0, 0, {'name': _('Thursday Morning'), 'dayofweek': '3', 'hour_from': 8, 'hour_to': 12}), + (0, 0, {'name': _('Friday Morning'), 'dayofweek': '4', 'hour_from': 8, 'hour_to': 12}), + ] + + color = fields.Integer(string='Color Index') + hr_department = fields.Many2one('hr.department', string="Department", required=True) + sequence = fields.Integer(string="Sequence", required=True, default=1) + attendance_ids = fields.One2many( + 'resource.calendar.attendance', 'calendar_id', 'Workingssss Time', + copy=True, default=_get_default_attendance_ids) + + @api.constrains('sequence') + def validate_seq(self): + if self.hr_department.id: + record = self.env['resource.calendar'].search([('hr_department', '=', self.hr_department.id), + ('sequence', '=', self.sequence), + ('company_id', '=', self.company_id.id) + ]) + if len(record) > 1: + raise ValidationError("One record with same sequence is already active." + "You can't activate more than one record at a time") + + diff --git a/hr_employee_shift/models/hr_generate_shift.py b/hr_employee_shift/models/hr_generate_shift.py new file mode 100644 index 00000000..2eda931b --- /dev/null +++ b/hr_employee_shift/models/hr_generate_shift.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields + + +class HrGenerateShift(models.Model): + _name = 'hr.shift.generate' + + hr_department = fields.Many2one('hr.department', string="Department") + start_date = fields.Date(string="Start Date", required=True) + end_date = fields.Date(string="End Date", required=True) + company_id = fields.Many2one('res.company', string='Company') + + def action_schedule_shift(self): + """Create mass schedule for all departments based on the shift scheduled in corresponding employee's contract""" + + if self.hr_department: + for contract in self.env['hr.contract'].search([('department_id', '=', self.hr_department.id)]): + if contract.shift_schedule: + for shift_val in contract.shift_schedule: + shift = shift_val.hr_shift + start_date = self.start_date + end_date = self.end_date + shift_obj = self.env['resource.calendar'].search([('hr_department', '=', self.hr_department.id), + ('name', '=', shift.name)], limit=1) + sequence = shift_obj.sequence + seq_no = sequence + 1 + new_shift = self.env['resource.calendar'].search([ + ('sequence', '=', seq_no), ('hr_department', '=', self.hr_department.id)], limit=1) + if new_shift: + shift_ids = [(0, 0, { + 'hr_shift': new_shift.id, + 'start_date': start_date, + 'end_date': end_date + })] + contract.shift_schedule = shift_ids + else: + seq_no = 1 + new_shift = self.env['resource.calendar'].search([ + ('sequence', '=', seq_no), ('hr_department', '=', self.hr_department.id)], limit=1) + if new_shift: + shift_ids = [(0, 0, { + 'hr_shift': new_shift.id, + 'start_date': start_date, + 'end_date': end_date + })] + contract.shift_schedule = shift_ids + else: + for contract in self.env['hr.contract'].search([]): + if contract.shift_schedule and contract.department_id: + for shift_val in contract.shift_schedule: + shift = shift_val.hr_shift + start_date = self.start_date + end_date = self.end_date + shift_obj = self.env['resource.calendar'].search([('hr_department', '=', contract.department_id.id), + ('name', '=', shift.name)], limit=1) + sequence = shift_obj.sequence + seq_no = sequence + 1 + new_shift = self.env['resource.calendar'].search([ + ('sequence', '=', seq_no), ('hr_department', '=', contract.department_id.id)], limit=1) + if new_shift: + shift_ids = [(0, 0, { + 'hr_shift': new_shift.id, + 'start_date': start_date, + 'end_date': end_date + })] + contract.shift_schedule = shift_ids + else: + seq_no = 1 + new_shift = self.env['resource.calendar'].search([ + ('sequence', '=', seq_no), ('hr_department', '=', contract.department_id.id)], limit=1) + shift_ids = [(0, 0, { + 'hr_shift': new_shift.id, + 'start_date': start_date, + 'end_date': end_date + })] + contract.shift_schedule = shift_ids + + + + + diff --git a/hr_employee_shift/models/hr_shift_payroll.py b/hr_employee_shift/models/hr_shift_payroll.py new file mode 100644 index 00000000..86715171 --- /dev/null +++ b/hr_employee_shift/models/hr_shift_payroll.py @@ -0,0 +1,197 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from datetime import timedelta +from odoo import models, fields, api, _, tools +from datetime import datetime, time +import datetime +import math +from pytz import utc +from odoo.tools.float_utils import float_round +from collections import namedtuple + + +class HrPayroll(models.Model): + _inherit = 'hr.payslip' + + @api.model + def get_worked_day_lines(self, contract_ids, date_from, date_to): + """ + @param contract_ids: list of contract id + @return: returns a list of dict containing the input that should be applied for the given contract between date_from and date_to + """ + def was_on_leave_interval(employee_id, date_from, date_to): + date_from = fields.Datetime.to_string(date_from) + date_to = fields.Datetime.to_string(date_to) + return self.env['hr.leave'].search([ + ('state', '=', 'validate'), + ('employee_id', '=', employee_id), + # ('type', '=', 'remove'), + ('date_from', '<=', date_from), + ('date_to', '>=', date_to) + ], limit=1) + + res = [] + # fill only if the contract as a working schedule linked + uom_day = self.env.ref('product.product_uom_day', raise_if_not_found=False) + for contract in contract_ids: + uom_hour = self.env.ref('product.product_uom_hour', raise_if_not_found=False) + interval_data = [] + holidays = self.env['hr.leave'] + attendances = { + 'name': _("Normal Working Days paid at 100%"), + 'sequence': 1, + 'code': 'WORK100', + 'number_of_days': 0.0, + 'number_of_hours': 0.0, + 'contract_id': contract.id, + } + leaves = {} + + # Gather all intervals and holidays + for days in contract.shift_schedule: + start_date = datetime.datetime.strptime(str(days.start_date), tools.DEFAULT_SERVER_DATE_FORMAT) + end_date = datetime.datetime.strptime(str(days.end_date), tools.DEFAULT_SERVER_DATE_FORMAT) + nb_of_days = (days.end_date - days.start_date).days + 1 + for day in range(0, nb_of_days): + working_intervals_on_day = days.hr_shift._get_day_work_intervals( + start_date + timedelta(days=day)) + for interval in working_intervals_on_day: + interval_data.append( + (interval, was_on_leave_interval(contract.employee_id.id, interval[0], interval[1]))) + + # Extract information from previous data. A working interval is considered: + # - as a leave if a hr.holiday completely covers the period + # - as a working period instead + for interval, holiday in interval_data: + holidays |= holiday + hours = (interval[1] - interval[0]).total_seconds() / 3600.0 + if holiday: + # if he was on leave, fill the leaves dict + if holiday.holiday_status_id.name in leaves: + leaves[holiday.holiday_status_id.name]['number_of_hours'] += hours + else: + leaves[holiday.holiday_status_id.name] = { + 'name': holiday.holiday_status_id.name, + 'sequence': 5, + 'code': holiday.holiday_status_id.name, + 'number_of_days': 0.0, + 'number_of_hours': hours, + 'contract_id': contract.id, + } + else: + # add the input vals to tmp (increment if existing) + attendances['number_of_hours'] += hours + # Clean-up the results + leaves = [value for key, value in leaves.items()] + for data in [attendances] + leaves: + data['number_of_days'] = uom_hour._compute_quantity(data['number_of_hours'], uom_day) \ + if uom_day and uom_hour \ + else data['number_of_hours'] / 8.0 + res.append(data) + return res + + +class Calendar(models.Model): + _inherit = 'resource.calendar' + _interval_obj = namedtuple('Interval', ('start_datetime', 'end_datetime', 'data')) + + def string_to_datetime(self, value): + """ Convert the given string value to a datetime in UTC. """ + return utc.localize(fields.Datetime.from_string(value)) + + def float_to_time(self, hours): + """ Convert a number of hours into a time object. """ + if hours == 24.0: + return time.max + fractional, integral = math.modf(hours) + return time(int(integral), int(float_round(60 * fractional, precision_digits=0)), 0) + + def _interval_new(self, start_datetime, end_datetime, kw=None): + kw = kw if kw is not None else dict() + kw.setdefault('attendances', self.env['resource.calendar.attendance']) + kw.setdefault('leaves', self.env['resource.calendar.leaves']) + return self._interval_obj(start_datetime, end_datetime, kw) + + @api.multi + def _get_day_work_intervals(self, day_date, start_time=None, end_time=None, compute_leaves=False, + resource_id=None): + self.ensure_one() + + if not start_time: + start_time = datetime.time.min + if not end_time: + end_time = datetime.time.max + + working_intervals = [att_interval for att_interval in + self._iter_day_attendance_intervals(day_date, start_time, end_time)] + + # filter according to leaves + if compute_leaves: + leaves = self._get_leave_intervals( + resource_id=resource_id, + start_datetime=datetime.datetime.combine(day_date, start_time), + end_datetime=datetime.datetime.combine(day_date, end_time)) + working_intervals = [ + sub_interval + for interval in working_intervals + for sub_interval in self._leave_intervals(interval, leaves)] + + # adapt tz + return [self._interval_new( + self.string_to_datetime(interval[0]), + self.string_to_datetime(interval[1]), + interval[2]) for interval in working_intervals] + + @api.multi + def _get_day_attendances(self, day_date, start_time, end_time): + """ Given a day date, return matching attendances. Those can be limited + by starting and ending time objects. """ + self.ensure_one() + weekday = day_date.weekday() + attendances = self.env['resource.calendar.attendance'] + + for attendance in self.attendance_ids.filtered( + lambda att: + int(att.dayofweek) == weekday and + not (att.date_from and fields.Date.from_string(att.date_from) > day_date) and + not (att.date_to and fields.Date.from_string(att.date_to) < day_date)): + if start_time and self.float_to_time(attendance.hour_to) < start_time: + continue + if end_time and self.float_to_time(attendance.hour_from) > end_time: + continue + attendances |= attendance + return attendances + + def _iter_day_attendance_intervals(self, day_date, start_time, end_time): + """ Get an iterator of all interval of current day attendances. """ + for calendar_working_day in self._get_day_attendances(day_date, start_time, end_time): + from_time = self.float_to_time(calendar_working_day.hour_from) + to_time = self.float_to_time(calendar_working_day.hour_to) + + dt_f = datetime.datetime.combine(day_date, max(from_time, start_time)) + dt_t = datetime.datetime.combine(day_date, min(to_time, end_time)) + + yield self._interval_new(dt_f, dt_t, {'attendances': calendar_working_day}) + + + diff --git a/hr_employee_shift/security/hr_employee_shift_security.xml b/hr_employee_shift/security/hr_employee_shift_security.xml new file mode 100644 index 00000000..2b9a2088 --- /dev/null +++ b/hr_employee_shift/security/hr_employee_shift_security.xml @@ -0,0 +1,16 @@ + + + + Hr Shift Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Hr Shift Genarate Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + \ No newline at end of file diff --git a/hr_employee_shift/security/ir.model.access.csv b/hr_employee_shift/security/ir.model.access.csv new file mode 100644 index 00000000..a51d85c3 --- /dev/null +++ b/hr_employee_shift/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_employee_shift_hr_employee_shift,hr_employee_shift.hr_shift_schedule,model_hr_shift_schedule,hr.group_hr_manager,1,1,1,1 +access_hr_employee_shift_hr_employee_shift1,hr_employee_shift.hr_shift_generate,model_hr_shift_generate,hr.group_hr_manager,1,1,1,1 \ No newline at end of file diff --git a/hr_employee_shift/static/description/HRMS-BUTTON.png b/hr_employee_shift/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/hr_employee_shift/static/description/HRMS-BUTTON.png differ diff --git a/hr_employee_shift/static/description/banner.jpg b/hr_employee_shift/static/description/banner.jpg new file mode 100644 index 00000000..9d697827 Binary files /dev/null and b/hr_employee_shift/static/description/banner.jpg differ diff --git a/hr_employee_shift/static/description/cybro-service.png b/hr_employee_shift/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/hr_employee_shift/static/description/cybro-service.png differ diff --git a/hr_employee_shift/static/description/cybro_logo.png b/hr_employee_shift/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/hr_employee_shift/static/description/cybro_logo.png differ diff --git a/hr_employee_shift/static/description/icon.png b/hr_employee_shift/static/description/icon.png new file mode 100644 index 00000000..674251dd Binary files /dev/null and b/hr_employee_shift/static/description/icon.png differ diff --git a/hr_employee_shift/static/description/index.html b/hr_employee_shift/static/description/index.html new file mode 100644 index 00000000..b91b4a95 --- /dev/null +++ b/hr_employee_shift/static/description/index.html @@ -0,0 +1,370 @@ +
+
+

+ Employee Shift Management +

+

+ Easily create, manage, and track employee shift schedules. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Employee Shift Management is a component of Open HRMS suit. + This module allows the user to create and manage employee work shifts. + Administrator can create various shifts according to the working hours and assign the Shift in + employee work contract. The module also helps to automatically assign new shift according to + the shift sequence. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+
+ +
+

+ Features +

+
+
+ Define list of Work Shifts
+ Define flexible hour wise shift
+ Assign shift in employee contract
+ Assign new shift automatically +
+
+
+
+
+ + +
+
+

+ Create Employee Shift +

+
+ +
+

+ Employee Shift In Contract +

+

+ + Have an option to schedule shift in employee contract form. + It is very important to create atleast one shift schedule manually in contract form. +
+

+
+ +
+

+ Generate Automatic Shifts +

+

+ + Automatically assign new shift according to the shift sequence. +
+

+
+ +
+

+ Employee Shifts +

+
+ +
+
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/hr_employee_shift/static/description/oh_icon.png b/hr_employee_shift/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_employee_shift/static/description/oh_icon.png differ diff --git a/hr_employee_shift/static/description/open-hrms-employee-shift-1.png b/hr_employee_shift/static/description/open-hrms-employee-shift-1.png new file mode 100644 index 00000000..cf62a430 Binary files /dev/null and b/hr_employee_shift/static/description/open-hrms-employee-shift-1.png differ diff --git a/hr_employee_shift/static/description/open-hrms-employee-shift-2.png b/hr_employee_shift/static/description/open-hrms-employee-shift-2.png new file mode 100644 index 00000000..0f5256b6 Binary files /dev/null and b/hr_employee_shift/static/description/open-hrms-employee-shift-2.png differ diff --git a/hr_employee_shift/static/description/open-hrms-employee-shift-3.png b/hr_employee_shift/static/description/open-hrms-employee-shift-3.png new file mode 100644 index 00000000..7ac98c3c Binary files /dev/null and b/hr_employee_shift/static/description/open-hrms-employee-shift-3.png differ diff --git a/hr_employee_shift/static/description/open-hrms-employee-shift-4.png b/hr_employee_shift/static/description/open-hrms-employee-shift-4.png new file mode 100644 index 00000000..e4457aa0 Binary files /dev/null and b/hr_employee_shift/static/description/open-hrms-employee-shift-4.png differ diff --git a/hr_employee_shift/static/description/shift_icon.png b/hr_employee_shift/static/description/shift_icon.png new file mode 100644 index 00000000..a54888f4 Binary files /dev/null and b/hr_employee_shift/static/description/shift_icon.png differ diff --git a/hr_employee_shift/static/src/css/shift_dashboard.css b/hr_employee_shift/static/src/css/shift_dashboard.css new file mode 100644 index 00000000..f99fe0e9 --- /dev/null +++ b/hr_employee_shift/static/src/css/shift_dashboard.css @@ -0,0 +1,7 @@ + +.style_shift{ + color: black !important; + font-size: 15px; + text-align: center; + padding: 10px 0px 2px 3px; +} diff --git a/hr_employee_shift/static/src/less/shift_dashboard.less b/hr_employee_shift/static/src/less/shift_dashboard.less new file mode 100644 index 00000000..3c3dd2a0 --- /dev/null +++ b/hr_employee_shift/static/src/less/shift_dashboard.less @@ -0,0 +1,10 @@ +@dashboard-bg-color: white; + +.o_kanban_view.o_kanban_dashboard.o_shift_kanban { + @sale-table-spacing: 20px; + + .oe_kanban_content{ + padding-top: 50px!important; + } + +} \ No newline at end of file diff --git a/hr_employee_shift/views/hr_employee_contract_view.xml b/hr_employee_shift/views/hr_employee_contract_view.xml new file mode 100644 index 00000000..6b5625b7 --- /dev/null +++ b/hr_employee_shift/views/hr_employee_contract_view.xml @@ -0,0 +1,29 @@ + + + + + employee.contract + hr.contract + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hr_employee_shift/views/hr_employee_shift_view.xml b/hr_employee_shift/views/hr_employee_shift_view.xml new file mode 100644 index 00000000..29317671 --- /dev/null +++ b/hr_employee_shift/views/hr_employee_shift_view.xml @@ -0,0 +1,97 @@ + + + + + + hr.employee.resource + hr.employee + + + + + + + + + + resource.calendar + resource.calendar + + + + + + + + + + + + + + + + + employee.shift.kanban + resource.calendar + + + + + +
+ +
+
+
+
+
+ +
+
+
+ +
+ [] +
+
+
+
+
+
+
+
+
+ + + Shift Working Time + resource.calendar + form + kanban,tree,form + + + +

+ Define working hours and time table that could be scheduled to your project members +

+
+
+ + + + + +
+
\ No newline at end of file diff --git a/hr_employee_shift/views/hr_generate_shift_view.xml b/hr_employee_shift/views/hr_generate_shift_view.xml new file mode 100644 index 00000000..ec2c954a --- /dev/null +++ b/hr_employee_shift/views/hr_generate_shift_view.xml @@ -0,0 +1,54 @@ + + + + + + + hr_employee_shift_generate_schedule form + hr.shift.generate + +
+ + + + + + + + + + + + + + +
+
+
+ +
+
+
+ + + + Employee Shift + hr.shift.generate + form + new + + + + + + +
+
\ No newline at end of file diff --git a/hr_employee_shift/views/templates.xml b/hr_employee_shift/views/templates.xml new file mode 100644 index 00000000..6768c74e --- /dev/null +++ b/hr_employee_shift/views/templates.xml @@ -0,0 +1,9 @@ + + + + diff --git a/hr_employee_transfer/README.rst b/hr_employee_transfer/README.rst new file mode 100755 index 00000000..df1c26e7 --- /dev/null +++ b/hr_employee_transfer/README.rst @@ -0,0 +1,39 @@ +Open HRMS Employee Transfer v11 +=============================== + +Employee transfer between branches. + +Depends +======= +[hr] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Sreejith P @ cybrosys, sreejith@cybrosys.in + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_employee_transfer/__init__.py b/hr_employee_transfer/__init__.py new file mode 100755 index 00000000..a0fdc10f --- /dev/null +++ b/hr_employee_transfer/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/hr_employee_transfer/__manifest__.py b/hr_employee_transfer/__manifest__.py new file mode 100755 index 00000000..1b5c0627 --- /dev/null +++ b/hr_employee_transfer/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Sreejith P () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Branch Transfer', + 'version': '12.0.1.0.0', + 'summary': 'Employee transfer between branches', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.openhrms.com', + 'depends': ['base', + 'hr_employee_updation' + ], + 'data': [ + 'views/employee_transfer.xml', + 'security/ir.model.access.csv', + 'security/branch_security.xml', + ], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'application': True, + 'auto_install': False, + 'license': 'AGPL-3', +} diff --git a/hr_employee_transfer/docs/RELEASE_NOTES.md b/hr_employee_transfer/docs/RELEASE_NOTES.md new file mode 100755 index 00000000..766892d9 --- /dev/null +++ b/hr_employee_transfer/docs/RELEASE_NOTES.md @@ -0,0 +1,12 @@ +## Module hr_employee_transfer + + +#### 29.01.2019 +#### Version 12.2.1.0.0 +##### ADD +- validation modification to admin + +#### 21.04.2018 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/hr_employee_transfer/models/__init__.py b/hr_employee_transfer/models/__init__.py new file mode 100755 index 00000000..3adb5760 --- /dev/null +++ b/hr_employee_transfer/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +from . import employee_transfer +from . import hr_contract +from . import res_company diff --git a/hr_employee_transfer/models/employee_transfer.py b/hr_employee_transfer/models/employee_transfer.py new file mode 100755 index 00000000..8e46c903 --- /dev/null +++ b/hr_employee_transfer/models/employee_transfer.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from datetime import date +from odoo import models, fields, api, _ +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT +from odoo.exceptions import Warning + + +class EmployeeTransfer(models.Model): + _name = 'employee.transfer' + _description = 'Employee Transfer' + _order = "id desc" + + def _default_employee(self): + emp_ids = self.env['hr.employee'].search([('user_id', '=', self.env.uid)]) + return emp_ids and emp_ids[0] or False + + name = fields.Char(string='Name', help='Give a name to the Transfer', copy=False, default="/", readonly=True) + employee_id = fields.Many2one('hr.employee', string='Employee', required=True, + help='Select the employee you are going to transfer') + date = fields.Date(string='Date', default=fields.Date.today()) + branch = fields.Many2one('transfer.company', string='Transfer Branch', copy=False,required=True) + + state = fields.Selection( + [('draft', 'New'), ('cancel', 'Cancelled'), ('transfer', 'Transferred'), ('done', 'Done')], + string='Status', readonly=True, copy=False, default='draft', + help=" * The 'Draft' status is used when a transfer is created and unconfirmed Transfer.\n" + " * The 'Transferred' status is used when the user confirm the transfer. It stays in the open status till the other branch/company receive the employee.\n" + " * The 'Done' status is set automatically when the employee is Joined/Received.\n" + " * The 'Cancelled' status is used when user cancel Transfer." + ) + sequence_number = fields.Integer(string='Sequence Number', help='A unique sequence number for the Transfer', + default=1, copy=False) + company_id = fields.Many2one('res.company', string='Company', + related='employee_id.company_id') + note = fields.Text(string='Internal Notes') + transferred = fields.Boolean(string='Transferred', copy=False, default=False, compute='_get_transferred') + responsible = fields.Many2one('hr.employee', string='Responsible', default=_default_employee, readonly=True) + + def _get_transferred(self): + print("compute") + if self: + print("self", self.branch.company_id) + print("self", self.env.user.company_id.id) + if self.branch.company_id == self.env.user.company_id.id: + self.transferred = True + + @api.one + def transfer(self): + obj_emp = self.env['hr.employee'].browse(self.employee_id.id) + emp = {} + if not self.branch: + raise Warning(_( + 'You should select the transfer branch/company.')) + if self.branch.company_id == self.company_id.id: + raise Warning(_( + 'You cant transfer to same company.')) + for this in self: + emp = { + 'name': self.employee_id.name, + 'company_id': self.branch.company_id + + } + new_emp = self.env['hr.employee'].sudo().create(emp) + if obj_emp.address_home_id: + obj_emp.address_home_id.active = False + for obj_contract in self.env['hr.contract'].search([('employee_id', '=', self.employee_id.id)]): + if obj_contract.date_end: + continue + if not obj_contract.date_end: + obj_contract.write({'date_end': date.today().strftime(DEFAULT_SERVER_DATE_FORMAT)}) + self.wage = obj_contract.wage + self.state = 'transfer' + self.employee_id = new_emp + obj_emp.write({'active': False}) + + @api.multi + def receive_employee(self): + for this in self: + if this._context is None: + context = {} + partner = {} + for i in this: + partner = { + 'name': i.employee_id.name, + 'company_id': i.branch.company_id, + } + partner_created = self.env['res.partner'].create(partner) + self.env['hr.employee'].browse(this.employee_id.id).write({'address_home_id': partner_created.id}) + return { + 'name': _('Contract'), + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'hr.contract', + 'type': 'ir.actions.act_window', + 'target': 'current', + 'context': {'default_employee_id': this.employee_id.id, + 'default_date_start': this.date, + 'default_emp_transfer': this.id, + }, + } + + @api.one + def cancel_transfer(self): + obj_emp = self.env['hr.employee'].browse(self.employee_id.id) + emp = { + 'name': self.employee_id.name, + 'company_id': self.company_id.id, + } + obj_emp.write(emp) + for obj_contract in self.env['hr.contract'].search([('employee_id', '=', self.employee_id.id)]): + obj_contract.unlink() + self.state = 'cancel' + + @api.model + def create(self, vals): + vals['name'] = "Transfer Of " + self.env['hr.employee'].browse(vals['employee_id']).name + res = super(EmployeeTransfer, self).create(vals) + return res diff --git a/hr_employee_transfer/models/hr_contract.py b/hr_employee_transfer/models/hr_contract.py new file mode 100755 index 00000000..87fc8a0d --- /dev/null +++ b/hr_employee_transfer/models/hr_contract.py @@ -0,0 +1,16 @@ +from odoo import models, fields, api + + +class HrContract(models.Model): + _inherit = 'hr.contract' + + company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env.user.company_id) + from_transfer = fields.Boolean(string='Transferred', default=False) + emp_transfer = fields.Many2one('employee.transfer', string='Transferred Employee') + + @api.model + def create(self, vals): + res = super(HrContract, self).create(vals) + if res.emp_transfer: + self.env['employee.transfer'].browse(res.emp_transfer.id).write({'state': 'done'}) + return res diff --git a/hr_employee_transfer/models/hr_employee.py b/hr_employee_transfer/models/hr_employee.py new file mode 100755 index 00000000..42df9efd --- /dev/null +++ b/hr_employee_transfer/models/hr_employee.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api + + +class HrContract(models.Model): + _inherit = 'hr.employee' + + transfer_detail = fields.One2many('transfer.detail', 'employee_id', string='Transfer Details') + + +class TransferDetails(models.Model): + + _name = 'transfer.detail' + _description = 'Transfer Details' + + employee_id = fields.Many2one('hr.employee', string='Employee') + date = fields.Date(string='Date', copy=False) + company_id = fields.Many2one('res.company', string='Company') + pre_company = fields.Many2one('res.company', string='Previous Company') diff --git a/hr_employee_transfer/models/res_company.py b/hr_employee_transfer/models/res_company.py new file mode 100755 index 00000000..77c228a2 --- /dev/null +++ b/hr_employee_transfer/models/res_company.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api + + +class EmployeeTransfer(models.Model): + _name = 'transfer.company' + _description = 'Transfer Company' + _order = "id desc" + + name = fields.Char(string='Name', copy=False, ondelete='cascade') + company_id = fields.Integer(string='Company', help='Company name same as res.company', copy=False) + + +class ResCompany(models.Model): + _inherit = 'res.company' + + def init(self): + obj_company = self.env['res.company'].search([]) + + for company in obj_company: + obj_branch = self.env['transfer.company'].search([('company_id', '=', company.id)]) + com = {} + if not obj_branch: + com = { + 'name': company.name, + 'company_id': company.id, + } + obj = self.env['transfer.company'].create(com) + + @api.model + def create(self, res): + result = super(ResCompany, self).create(res) + com = {} + com = { + 'name': result.name, + 'company_id': result.id, + + } + self.env['transfer.company'].create(com) + return result diff --git a/hr_employee_transfer/security/branch_security.xml b/hr_employee_transfer/security/branch_security.xml new file mode 100755 index 00000000..f22cc587 --- /dev/null +++ b/hr_employee_transfer/security/branch_security.xml @@ -0,0 +1,18 @@ + + + + + Employee Rule + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Contract Rules + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + diff --git a/hr_employee_transfer/security/ir.model.access.csv b/hr_employee_transfer/security/ir.model.access.csv new file mode 100755 index 00000000..beea229f --- /dev/null +++ b/hr_employee_transfer/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_employee_transfer,employee.transfer,model_employee_transfer,hr.group_hr_user,1,1,0,0 +access_employee_transfer_manager,employee.transfer.manager,model_employee_transfer,hr.group_hr_manager,1,1,1,0 +access_employee_transfer_company,employee.company.manager,base.model_res_company,hr.group_hr_manager,1,1,1,0 +access_transfer_company,transfer.company.manager,model_transfer_company,hr.group_hr_manager,1,1,1,0 diff --git a/hr_employee_transfer/static/description/HRMS-BUTTON.png b/hr_employee_transfer/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_employee_transfer/static/description/HRMS-BUTTON.png differ diff --git a/hr_employee_transfer/static/description/banner.jpg b/hr_employee_transfer/static/description/banner.jpg new file mode 100755 index 00000000..1859d8b1 Binary files /dev/null and b/hr_employee_transfer/static/description/banner.jpg differ diff --git a/hr_employee_transfer/static/description/cybro-service.png b/hr_employee_transfer/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_employee_transfer/static/description/cybro-service.png differ diff --git a/hr_employee_transfer/static/description/cybro_logo.png b/hr_employee_transfer/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_employee_transfer/static/description/cybro_logo.png differ diff --git a/hr_employee_transfer/static/description/icon.png b/hr_employee_transfer/static/description/icon.png new file mode 100755 index 00000000..7fec2911 Binary files /dev/null and b/hr_employee_transfer/static/description/icon.png differ diff --git a/hr_employee_transfer/static/description/index.html b/hr_employee_transfer/static/description/index.html new file mode 100755 index 00000000..9280891e --- /dev/null +++ b/hr_employee_transfer/static/description/index.html @@ -0,0 +1,355 @@ +
+
+

+ Branch Transfer +

+

+ Employee transfer between branches +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Transferring employees between company is a basic thing in an organization. Odoo lacks a provision for employee transfer. This module gives a basic structure for employee transfer.
+ Make sure that your multi company is enabled. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+
+ +
+

+ Features +

+
+
+ Transfer employee between branches.
+ Create new contract for the employee.
+
+
+
+
+ +
+
+

+ Employee Transfer +

+

+ + Create an Employee Transfer, select the transfer company and click on the transfer button. +
+

+
+ +
+ +

+ Contract +

+

+ + Create new contract for the employee. +
+
+ +
+ +

+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+ +
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+ +
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/hr_employee_transfer/static/description/oh_icon.png b/hr_employee_transfer/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_employee_transfer/static/description/oh_icon.png differ diff --git a/hr_employee_transfer/static/description/open-hrms-employee-transfer-1.jpg b/hr_employee_transfer/static/description/open-hrms-employee-transfer-1.jpg new file mode 100644 index 00000000..c7cae211 Binary files /dev/null and b/hr_employee_transfer/static/description/open-hrms-employee-transfer-1.jpg differ diff --git a/hr_employee_transfer/static/description/open-hrms-employee-transfer-2.jpg b/hr_employee_transfer/static/description/open-hrms-employee-transfer-2.jpg new file mode 100644 index 00000000..fe5cf039 Binary files /dev/null and b/hr_employee_transfer/static/description/open-hrms-employee-transfer-2.jpg differ diff --git a/hr_employee_transfer/static/description/transfer_icon.png b/hr_employee_transfer/static/description/transfer_icon.png new file mode 100644 index 00000000..6986e829 Binary files /dev/null and b/hr_employee_transfer/static/description/transfer_icon.png differ diff --git a/hr_employee_transfer/views/employee_transfer.xml b/hr_employee_transfer/views/employee_transfer.xml new file mode 100755 index 00000000..bb4421b3 --- /dev/null +++ b/hr_employee_transfer/views/employee_transfer.xml @@ -0,0 +1,107 @@ + + + + Employee Transfer + employee.transfer + + + + + + + + + + + + + + + + + + + + + + Employee Transfer + employee.transfer + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + +
+
+
+
+ + Employee Transfer Tree + employee.transfer + + + + + + + + + + + + + + Employee Transfer + ir.actions.act_window + employee.transfer + form + tree,form + + [] + +

+ Click to create a new Transfer. +

+ Use this menu to browse previous transfer. To record new + transfer, you may use the create button. +

+
+
+ +
diff --git a/hr_employee_updation/README.md b/hr_employee_updation/README.md new file mode 100755 index 00000000..93877f95 --- /dev/null +++ b/hr_employee_updation/README.md @@ -0,0 +1,17 @@ +Open HRMS Employee Info +----------------------- +Supporting Addon for Open HRMS, Added Advanced Fields On Employee Master. + +Connect with experts +-------------------- + +If you have any question/queries/additional works on OpenHRMS or this module, You can drop an email directly to Cybrosys. + +Contacts +-------- +info - info@cybrosys.com +Jesni Banu - jesni@cybrosys.in + +Website: +https://www.openhrms.com +https://www.cybrosys.com diff --git a/hr_employee_updation/__init__.py b/hr_employee_updation/__init__.py new file mode 100755 index 00000000..9c6d6e05 --- /dev/null +++ b/hr_employee_updation/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models + + diff --git a/hr_employee_updation/__manifest__.py b/hr_employee_updation/__manifest__.py new file mode 100755 index 00000000..6de973b3 --- /dev/null +++ b/hr_employee_updation/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Employee Info', + 'version': '12.0.2.0.0', + 'summary': """Adding Advanced Fields In Employee Master""", + 'description': 'This module helps you to add more information in employee records.', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr', 'mail', 'hr_gamification'], + 'data': [ + 'security/ir.model.access.csv', + 'views/hr_employee_view.xml', + 'views/hr_notification.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_employee_updation/doc/RELEASE_NOTES.md b/hr_employee_updation/doc/RELEASE_NOTES.md new file mode 100755 index 00000000..eb5bffcd --- /dev/null +++ b/hr_employee_updation/doc/RELEASE_NOTES.md @@ -0,0 +1,11 @@ +## Module + +#### 19.05.2018 +#### Version 11.0.2.0.0 +##### FIX +- Bug fixed (key error: employee_ref) + +#### 10.04.2018 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit for Open HRMS Project diff --git a/hr_employee_updation/models/__init__.py b/hr_employee_updation/models/__init__.py new file mode 100755 index 00000000..7e7089a6 --- /dev/null +++ b/hr_employee_updation/models/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import hr_employee + + + + diff --git a/hr_employee_updation/models/hr_employee.py b/hr_employee_updation/models/hr_employee.py new file mode 100755 index 00000000..2f15e9f7 --- /dev/null +++ b/hr_employee_updation/models/hr_employee.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from datetime import datetime, timedelta +from odoo import models, fields, _ + +GENDER_SELECTION = [('male', 'Male'), + ('female', 'Female'), + ('other', 'Other')] + + +class HrEmployeeContractName(models.Model): + """This class is to add emergency contact table""" + + _name = 'hr.emergency.contact' + _description = 'HR Emergency Contact' + + number = fields.Char(string='Number', help='Contact Number') + relation = fields.Char(string='Contact', help='Relation with employee') + employee_obj = fields.Many2one('hr.employee', invisible=1) + + +class HrEmployeeFamilyInfo(models.Model): + """Table for keep employee family information""" + + _name = 'hr.employee.family' + _description = 'HR Employee Family' + + + employee_id = fields.Many2one('hr.employee', string="Employee", help='Select corresponding Employee', + invisible=1) + + member_name = fields.Char(string='Name') + relation = fields.Selection([('father', 'Father'), + ('mother', 'Mother'), + ('daughter', 'Daughter'), + ('son', 'Son'), + ('wife', 'Wife')], string='Relationship', help='Relation with employee') + member_contact = fields.Char(string='Contact No') + + +class HrEmployee(models.Model): + _inherit = 'hr.employee' + + def mail_reminder(self): + """Sending expiry date notification for ID and Passport""" + + now = datetime.now() + timedelta(days=1) + date_now = now.date() + match = self.search([]) + for i in match: + if i.id_expiry_date: + exp_date = fields.Date.from_string(i.id_expiry_date) - timedelta(days=14) + if date_now >= exp_date: + mail_content = " Hello " + i.name + ",
Your ID " + i.identification_id + "is going to expire on " + \ + str(i.id_expiry_date) + ". Please renew it before expiry date" + main_content = { + 'subject': _('ID-%s Expired On %s') % (i.identification_id, i.id_expiry_date), + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': i.work_email, + } + self.env['mail.mail'].sudo().create(main_content).send() + match1 = self.search([]) + for i in match1: + if i.passport_expiry_date: + exp_date1 = fields.Date.from_string(i.passport_expiry_date) - timedelta(days=180) + if date_now >= exp_date1: + mail_content = " Hello " + i.name + ",
Your Passport " + i.passport_id + "is going to expire on " + \ + str(i.passport_expiry_date) + ". Please renew it before expiry date" + main_content = { + 'subject': _('Passport-%s Expired On %s') % (i.passport_id, i.passport_expiry_date), + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': i.work_email, + } + self.env['mail.mail'].sudo().create(main_content).send() + personal_mobile = fields.Char(string='Mobile', related='address_home_id.mobile', store=True) + joining_date = fields.Date(string='Joining Date') + id_expiry_date = fields.Date(string='Expiry Date', help='Expiry date of Identification ID') + passport_expiry_date = fields.Date(string='Expiry Date', help='Expiry date of Passport ID') + id_attachment_id = fields.Many2many('ir.attachment', 'id_attachment_rel', 'id_ref', 'attach_ref', + string="Attachment", help='You can attach the copy of your Id') + passport_attachment_id = fields.Many2many('ir.attachment', 'passport_attachment_rel', 'passport_ref', 'attach_ref1', + string="Attachment", + help='You can attach the copy of Passport') + fam_ids = fields.One2many('hr.employee.family', 'employee_id', string='Family', help='Family Information') + emergency_contacts = fields.One2many('hr.emergency.contact', 'employee_obj', string='Emergency Contact') + + + diff --git a/hr_employee_updation/security/ir.model.access.csv b/hr_employee_updation/security/ir.model.access.csv new file mode 100755 index 00000000..c17dd7d9 --- /dev/null +++ b/hr_employee_updation/security/ir.model.access.csv @@ -0,0 +1,7 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_hr_employee_family_employee","hr.employee.family_employee","model_hr_employee_family","base.group_user",1,0,0,0 +"access_hr_employee_family_manager","hr.employee.family_manager","model_hr_employee_family","hr.group_hr_manager",1,1,1,1 +"access_hr_employee_family_user","hr.employee.family_user","model_hr_employee_family","hr.group_hr_user",1,1,1,1 +"access_hr_employee_emergency_contact","hr.emergency.contact","model_hr_emergency_contact","base.group_user",1,0,0,0 +"access_hr_employee_emergency_contact_manager","hr.emergency.contact","model_hr_emergency_contact","hr.group_hr_manager",1,1,1,1 +"access_hr_employee_emergency_contact_user","hr.emergency.contact","model_hr_emergency_contact","hr.group_hr_user",1,1,1,1 \ No newline at end of file diff --git a/hr_employee_updation/static/description/HRMS-BUTTON.png b/hr_employee_updation/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_employee_updation/static/description/HRMS-BUTTON.png differ diff --git a/hr_employee_updation/static/description/banner.jpg b/hr_employee_updation/static/description/banner.jpg new file mode 100755 index 00000000..663c0a0a Binary files /dev/null and b/hr_employee_updation/static/description/banner.jpg differ diff --git a/hr_employee_updation/static/description/cybro-service.png b/hr_employee_updation/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_employee_updation/static/description/cybro-service.png differ diff --git a/hr_employee_updation/static/description/cybro_logo.png b/hr_employee_updation/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_employee_updation/static/description/cybro_logo.png differ diff --git a/hr_employee_updation/static/description/icon.png b/hr_employee_updation/static/description/icon.png new file mode 100755 index 00000000..cc02f7a6 Binary files /dev/null and b/hr_employee_updation/static/description/icon.png differ diff --git a/hr_employee_updation/static/description/index.html b/hr_employee_updation/static/description/index.html new file mode 100755 index 00000000..41f92829 --- /dev/null +++ b/hr_employee_updation/static/description/index.html @@ -0,0 +1,369 @@ +
+
+

+ Open HRMS Employee Info +

+

+ Added Advance Fields On Employee Master +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ This module added some advanced features on Employee master. + Such as family info, joining date, passport and Id expiry date. + This module also sends expiry notification for passport and id to corresponding employees. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+ +
+
+

+ Features +

+
+
+ Provision for family information.
+ Provision for joining date and contact info.
+ Provision for passport and id expiry date and attachments.
+ Provision for expiry notification for passport and id documents.
+
+
+
+
+ +
+
+

+ Screenshots +

+

+ + Identification ID & Passport ID +
+

+
+ +
+

+ + Emergency Contact Number +
+

+
+ +
+

+ + Family Information +
+

+
+ +
+

+ + Joining Date +
+

+
+ +
+
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+ +
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+ +
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/hr_employee_updation/static/description/oh_icon.png b/hr_employee_updation/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_employee_updation/static/description/oh_icon.png differ diff --git a/hr_employee_updation/static/description/open-hrms-employee-updation-1.png b/hr_employee_updation/static/description/open-hrms-employee-updation-1.png new file mode 100755 index 00000000..e77bf7ee Binary files /dev/null and b/hr_employee_updation/static/description/open-hrms-employee-updation-1.png differ diff --git a/hr_employee_updation/static/description/open-hrms-employee-updation-2.png b/hr_employee_updation/static/description/open-hrms-employee-updation-2.png new file mode 100755 index 00000000..beb5e8c8 Binary files /dev/null and b/hr_employee_updation/static/description/open-hrms-employee-updation-2.png differ diff --git a/hr_employee_updation/static/description/open-hrms-employee-updation-3.png b/hr_employee_updation/static/description/open-hrms-employee-updation-3.png new file mode 100755 index 00000000..c7e019ee Binary files /dev/null and b/hr_employee_updation/static/description/open-hrms-employee-updation-3.png differ diff --git a/hr_employee_updation/static/description/open-hrms-employee-updation-4.png b/hr_employee_updation/static/description/open-hrms-employee-updation-4.png new file mode 100755 index 00000000..6b2800be Binary files /dev/null and b/hr_employee_updation/static/description/open-hrms-employee-updation-4.png differ diff --git a/hr_employee_updation/views/hr_employee_view.xml b/hr_employee_updation/views/hr_employee_view.xml new file mode 100755 index 00000000..21806cd7 --- /dev/null +++ b/hr_employee_updation/views/hr_employee_view.xml @@ -0,0 +1,84 @@ + + + + + + + + hr.employee.form.view + hr.employee + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hr.employee.view.form.inherit + hr.employee + + + + +
+ +
+ +
+
+
+
+ +
+
\ No newline at end of file diff --git a/hr_employee_updation/views/hr_notification.xml b/hr_employee_updation/views/hr_notification.xml new file mode 100755 index 00000000..3dbfa7de --- /dev/null +++ b/hr_employee_updation/views/hr_notification.xml @@ -0,0 +1,15 @@ + + + + + HR Employee Data Expiration + 1 + days + -1 + + + code + model.mail_reminder() + + + diff --git a/hr_gratuity_settlement/README.rst b/hr_gratuity_settlement/README.rst new file mode 100755 index 00000000..1fbc4055 --- /dev/null +++ b/hr_gratuity_settlement/README.rst @@ -0,0 +1,41 @@ +OHRMS Gratuity Settlement v12 +============================= + +Employee Gratuity Settlement during Resignation. + +Depends +======= +[hr_resignation] addon Open HRMS +[hr_payroll] addon Odoo +[mail] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Ajmal J K @ cybrosys + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_gratuity_settlement/__init__.py b/hr_gratuity_settlement/__init__.py new file mode 100755 index 00000000..a0fdc10f --- /dev/null +++ b/hr_gratuity_settlement/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/hr_gratuity_settlement/__manifest__.py b/hr_gratuity_settlement/__manifest__.py new file mode 100755 index 00000000..3ecdd771 --- /dev/null +++ b/hr_gratuity_settlement/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Ajmal JK() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Gratuity Settlement', + 'version': '12.0.1.0.0', + 'summary': """Employee Gratuity Settlement During Resignation """, + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'category': 'Generic Modules/Human Resources', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr_resignation','mail','hr_employee_updation'], + 'data': ['views/employee_gratuity_view.xml', + 'views/gratuity_sequence.xml', + 'views/other_settlements.xml', + 'security/ir.model.access.csv'], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_gratuity_settlement/data/settlement_reasons.xml b/hr_gratuity_settlement/data/settlement_reasons.xml new file mode 100644 index 00000000..5ea9d068 --- /dev/null +++ b/hr_gratuity_settlement/data/settlement_reasons.xml @@ -0,0 +1,16 @@ + + + + + + + Case of Death + Employee passed away + + + Disabled due to Sick or Accident + Employee physically disabled due to sick or accident + + + + diff --git a/hr_gratuity_settlement/docs/RELEASE_NOTES.md b/hr_gratuity_settlement/docs/RELEASE_NOTES.md new file mode 100755 index 00000000..aa9c966f --- /dev/null +++ b/hr_gratuity_settlement/docs/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module hr_gratuity + +#### 10.10.2018 +#### Version 12.0.1.0.0 +##### ADD +- Initial Commit diff --git a/hr_gratuity_settlement/models/__init__.py b/hr_gratuity_settlement/models/__init__.py new file mode 100755 index 00000000..b40523b7 --- /dev/null +++ b/hr_gratuity_settlement/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import employee_gratuity +from . import other_settlements diff --git a/hr_gratuity_settlement/models/employee_gratuity.py b/hr_gratuity_settlement/models/employee_gratuity.py new file mode 100755 index 00000000..53cefae1 --- /dev/null +++ b/hr_gratuity_settlement/models/employee_gratuity.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +import datetime +from odoo import fields, models, api, exceptions, _ +from odoo.exceptions import ValidationError,UserError +date_format = "%Y-%m-%d" + + +class EmployeeGratuity(models.Model): + _name = 'hr.gratuity' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Employee Gratuity" + + state = fields.Selection([ + ('draft', 'Draft'), + ('validate', 'Validated'), + ('approve', 'Approved'), + ('cancel', 'Cancelled')], + default='draft', track_visibility='onchange') + name = fields.Char(string='Reference', required=True, copy=False, readonly=True, + default=lambda self: _('New')) + employee_name = fields.Many2one('hr.resignation', string='Employee', required=True, + domain="[('state', '=', 'approved')]") + joined_date = fields.Date(string="Joined Date", readonly=True) + worked_years = fields.Integer(string="Total Work Years", readonly=True) + last_month_salary = fields.Integer(string="Last Salary", required=True, default=0) + allowance = fields.Char(string="Dearness Allowance", default=0) + gratuity_amount = fields.Integer(string="Gratuity Payable", required=True, default=0, + readony=True, help=("Gratuity is calculated based on the " + "equation Last salary * Number of years of service * 15 / 26 ")) + currency_id = fields.Many2one('res.currency', string='Currency', required=True, + default=lambda self: self.env.user.company_id.currency_id) + company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env.user.company_id) + + # assigning the sequence for the record + @api.model + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('hr.gratuity') + return super(EmployeeGratuity, self).create(vals) + + # Check whether any Gratuity request already exists + @api.onchange('employee_name') + @api.depends('employee_name') + def check_request_existence(self): + for rec in self: + if rec.employee_name: + + gratuity_request = self.env['hr.gratuity'].search([('employee_name', '=', rec.employee_name.id), + ('state', 'in', ['draft', 'validate', 'approve', 'cancel'])]) + if gratuity_request: + raise ValidationError(_('A Settlement request is already processed' + ' for this employee')) + + @api.multi + def validate_function(self): + # calculating the years of work by the employee + worked_years = int(datetime.datetime.now().year) - int(str(self.joined_date).split('-')[0]) + + if worked_years < 5: + + self.write({ + 'state': 'draft'}) + + worked_years = int(datetime.datetime.now().year) - int(str(self.joined_date).split('-')[0]) + self.worked_years = worked_years + + raise exceptions.except_orm(_('Employee Working Period is less than 5 Year'), + _('Only an Employee with minimum 5 years of working, will get the Gratuity')) + else: + + worked_years = int(datetime.datetime.now().year) - int(str(self.joined_date).split('-')[0]) + self.worked_years = worked_years + + cr = self._cr # find out the correct date of last salary of employee + + query = """select amount from hr_payslip_line psl + inner join hr_payslip ps on ps.id=psl.slip_id + where ps.employee_id="""+str(self.employee_name.employee_id.id)+\ + """and ps.state='done' and psl.code='NET' + order by ps.date_from desc limit 1""" + + cr.execute(query) + data = cr.fetchall() + if data : + last_salary = data[0][0] + else : + last_salary = 0 + self.last_month_salary = last_salary + + amount = ((self.last_month_salary + int(self.allowance)) * int(worked_years) * 15) / 26 + self.gratuity_amount = round(amount) if self.state == 'approve' else 0 + + self.write({ + 'state': 'validate'}) + + def approve_function(self): + + if not self.allowance.isdigit(): + raise ValidationError(_('Allowance value should be numeric !!')) + + self.write({ + 'state': 'approve' + }) + + amount = ((self.last_month_salary + int(self.allowance)) * int(self.worked_years) * 15) / 26 + self.gratuity_amount = round(amount) if self.state == 'approve' else 0 + + def cancel_function(self): + self.write({ + 'state': 'cancel' + }) + + def draft_function(self): + self.write({ + 'state': 'draft' + }) + + # assigning the join date of the selected employee + @api.onchange('employee_name') + def _on_change_employee_name(self): + rec = self.env['hr.resignation'].search([['id', '=', self.employee_name.id]]) + if rec: + self.joined_date = rec.joined_date + else: + self.joined_date = '' diff --git a/hr_gratuity_settlement/models/other_settlements.py b/hr_gratuity_settlement/models/other_settlements.py new file mode 100755 index 00000000..bef6cd25 --- /dev/null +++ b/hr_gratuity_settlement/models/other_settlements.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +import datetime +from odoo import fields, models, api, exceptions, _ +from odoo.exceptions import ValidationError,UserError +date_format = "%Y-%m-%d" + + +class OtherSettlements(models.Model): + _name = 'other.settlements' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Settlement" + + state = fields.Selection([ + ('draft', 'Draft'), + ('validate', 'Validated'), + ('approve', 'Approved'), + ('cancel', 'Cancelled'), + ], default='draft', track_visibility='onchange') + + name = fields.Char(string='Reference', required=True, copy=False, readonly=True, + default=lambda self: _('New')) + employee_name = fields.Many2one('hr.employee', string='Employee', required=True) + joined_date = fields.Date(string="Joined Date") + worked_years = fields.Integer(string="Total Work Years") + last_month_salary = fields.Integer(string="Last Salary", required=True, default=0) + allowance = fields.Char(string="Dearness Allowance", default=0) + gratuity_amount = fields.Integer(string="Gratuity Payable", required=True, default=0, readony=True, help=("Gratuity is calculated based on the equation Last salary * Number of years of service * 15 / 26 ")) + + reason = fields.Many2one('settlement.reason', string="Settlement Reason", required="True") + currency_id = fields.Many2one('res.currency', string='Currency', required=True, + default=lambda self: self.env.user.company_id.currency_id) + company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env.user.company_id) + + # assigning the sequence for the record + @api.model + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('other.settlements') + return super(OtherSettlements, self).create(vals) + + # Check whether any Settlement request already exists + @api.onchange('employee_name') + @api.depends('employee_name') + def check_request_existence(self): + for rec in self: + if rec.employee_name: + settlement_request = self.env['other.settlements'].search([('employee_name', '=', rec.employee_name.id), + ('state', 'in', ['draft', 'validate', 'approve'])]) + if settlement_request: + + raise ValidationError(_('A Settlement request is already processed' + ' for this employee')) + + @api.multi + def validate_function(self): + # calculating the years of work by the employee + worked_years = int(datetime.datetime.now().year) - int(str(self.joined_date).split('-')[0]) + + if worked_years >= 1: + + self.worked_years = worked_years + + cr = self._cr # find out the correct date of last salary of employee + query = """select amount from hr_payslip_line psl + inner join hr_payslip ps on ps.id=psl.slip_id + where ps.employee_id="""+str(self.employee_name.id)+\ + """and ps.state='done' and psl.code='NET' + order by ps.date_from desc limit 1""" + + cr.execute(query) + data = cr.fetchall() + if data: + last_salary = data[0][0] + else: + last_salary = 0 + + self.last_month_salary = last_salary + + amount = ((self.last_month_salary + int(self.allowance)) * int(worked_years) * 15) / 26 + self.gratuity_amount = round(amount) if self.state == 'approve' else 0 + + self.write({ + 'state': 'validate'}) + else: + + self.write({ + 'state': 'draft'}) + self.worked_years = worked_years + + raise exceptions.except_orm(_('Employee Working Period is less than 1 Year'), + _('Only an Employee with minimum 1 years of working, will get the Settlement advantage')) + + def approve_function(self): + + if not self.allowance.isdigit() : + raise ValidationError(_('Allowance value should be numeric !!')) + + self.write({ + 'state': 'approve' + }) + + amount = ((self.last_month_salary + int(self.allowance)) * int(self.worked_years) * 15) / 26 + self.gratuity_amount = round(amount) if self.state == 'approve' else 0 + + def cancel_function(self): + self.write({ + 'state': 'cancel' + }) + + def draft_function(self): + self.write({ + 'state': 'draft' + }) + +class SettlementReason(models.Model): + _name = 'settlement.reason' + _rec_name = 'settlement_reason' + + + settlement_reason = fields.Char(string="Reason",required=True) + description = fields.Text(string="Description") \ No newline at end of file diff --git a/hr_gratuity_settlement/security/ir.model.access.csv b/hr_gratuity_settlement/security/ir.model.access.csv new file mode 100755 index 00000000..2cce9634 --- /dev/null +++ b/hr_gratuity_settlement/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +view_hr_gratuity,view.hr.gratuity,model_hr_gratuity,hr.group_hr_manager,1,1,1,1 +view_hr_others,view.other.settlement,model_other_settlements,hr.group_hr_manager,1,1,1,1 +view_hr_others_resons,view.other.settlement.resons,model_settlement_reason,hr.group_hr_manager,1,1,1,1 diff --git a/hr_gratuity_settlement/static/description/HRMS-BUTTON.png b/hr_gratuity_settlement/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_gratuity_settlement/static/description/HRMS-BUTTON.png differ diff --git a/hr_gratuity_settlement/static/description/banner.jpg b/hr_gratuity_settlement/static/description/banner.jpg new file mode 100755 index 00000000..84422586 Binary files /dev/null and b/hr_gratuity_settlement/static/description/banner.jpg differ diff --git a/hr_gratuity_settlement/static/description/cybro-service.png b/hr_gratuity_settlement/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_gratuity_settlement/static/description/cybro-service.png differ diff --git a/hr_gratuity_settlement/static/description/cybro_logo.png b/hr_gratuity_settlement/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_gratuity_settlement/static/description/cybro_logo.png differ diff --git a/hr_gratuity_settlement/static/description/icon.png b/hr_gratuity_settlement/static/description/icon.png new file mode 100755 index 00000000..cc334ef9 Binary files /dev/null and b/hr_gratuity_settlement/static/description/icon.png differ diff --git a/hr_gratuity_settlement/static/description/index.html b/hr_gratuity_settlement/static/description/index.html new file mode 100755 index 00000000..6c4549f9 --- /dev/null +++ b/hr_gratuity_settlement/static/description/index.html @@ -0,0 +1,366 @@ +
+
+

+ Employee Gratuity Settlement +

+

+ Create Gratuity Settlements for Employees During Resignation +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Employee Gratuity Settlement is a component of Open HRMS suit. This module manages employee settlements during resignation process. + A Gratuity Settlement can be created only if the Resignation Request of the employee is approved. + The Gratuity amount is calculated by the basic equation, Last drawn salary (basic salary plus dearness allowance) * number of completed years of service * 15/26. +

+
+
+
+ +
+

+ Features +

+
+
+ Manager can create Gratuity Settlements of Employees.
+ A settlement can be created only if the Resignation Request of the employee is approved.
+ The Gratuity Amount is calculated based on a predefined equation. +
+
+
+
+
+ +
+
+

+ Screenshots +

+

+ + You can create Gratuity Settlement once the 'Resignation Request' of the employee is approved. +
+

+
+ +
+

+ + Select the Employee and click 'Validate'. +
+

+
+ +
+

+ + The last salary of employee is calculated from his latest payslip. Click 'Calculate' to calculate the Gratuity amount. +
+

+
+ +
+

+ + The Gratuity amount is calculated based on the basic equation. +
+

+
+ +
+

+ + Settlements Creation. +
+

+
+ +
+
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/hr_gratuity_settlement/static/description/oh_icon.png b/hr_gratuity_settlement/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_gratuity_settlement/static/description/oh_icon.png differ diff --git a/hr_gratuity_settlement/static/description/open-hrms-gratuity-1.png b/hr_gratuity_settlement/static/description/open-hrms-gratuity-1.png new file mode 100755 index 00000000..66782793 Binary files /dev/null and b/hr_gratuity_settlement/static/description/open-hrms-gratuity-1.png differ diff --git a/hr_gratuity_settlement/static/description/open-hrms-gratuity-2.png b/hr_gratuity_settlement/static/description/open-hrms-gratuity-2.png new file mode 100755 index 00000000..965bc0f4 Binary files /dev/null and b/hr_gratuity_settlement/static/description/open-hrms-gratuity-2.png differ diff --git a/hr_gratuity_settlement/static/description/open-hrms-gratuity-3.png b/hr_gratuity_settlement/static/description/open-hrms-gratuity-3.png new file mode 100755 index 00000000..7e5aad0d Binary files /dev/null and b/hr_gratuity_settlement/static/description/open-hrms-gratuity-3.png differ diff --git a/hr_gratuity_settlement/static/description/open-hrms-gratuity-4.png b/hr_gratuity_settlement/static/description/open-hrms-gratuity-4.png new file mode 100755 index 00000000..f40f61a9 Binary files /dev/null and b/hr_gratuity_settlement/static/description/open-hrms-gratuity-4.png differ diff --git a/hr_gratuity_settlement/static/description/open-hrms-gratuity-5.gif b/hr_gratuity_settlement/static/description/open-hrms-gratuity-5.gif new file mode 100644 index 00000000..55cb63f0 Binary files /dev/null and b/hr_gratuity_settlement/static/description/open-hrms-gratuity-5.gif differ diff --git a/hr_gratuity_settlement/static/description/open-hrms-gratuity-5.png b/hr_gratuity_settlement/static/description/open-hrms-gratuity-5.png new file mode 100644 index 00000000..ed9ca6da Binary files /dev/null and b/hr_gratuity_settlement/static/description/open-hrms-gratuity-5.png differ diff --git a/hr_gratuity_settlement/views/employee_gratuity_view.xml b/hr_gratuity_settlement/views/employee_gratuity_view.xml new file mode 100755 index 00000000..2dfa825b --- /dev/null +++ b/hr_gratuity_settlement/views/employee_gratuity_view.xml @@ -0,0 +1,109 @@ + + + + + hr.gratuity.tree + hr.gratuity + + + + + + + + + + + + + + hr.gratuity.form + hr.gratuity + +
+
+
+ +
+

+ +

+
+ + +

+

+ + +
+ + + +
+ + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + Gratuity Analysis + hr.gratuity + pivot + + + + + + + + + + + + Gratuity Settlement + hr.gratuity + form + tree,form + + + + Gratuity Analysis + hr.gratuity + form + pivot + [] + + + + + + + +
+
diff --git a/hr_gratuity_settlement/views/gratuity_sequence.xml b/hr_gratuity_settlement/views/gratuity_sequence.xml new file mode 100755 index 00000000..9ce89f85 --- /dev/null +++ b/hr_gratuity_settlement/views/gratuity_sequence.xml @@ -0,0 +1,21 @@ + + + + + + + Open HRMS Gratuity + hr.gratuity + GRT + 3 + + + + Open HRMS Other Settlements + other.settlements + SETT + 3 + + + + diff --git a/hr_gratuity_settlement/views/other_settlements.xml b/hr_gratuity_settlement/views/other_settlements.xml new file mode 100755 index 00000000..1f3c45d7 --- /dev/null +++ b/hr_gratuity_settlement/views/other_settlements.xml @@ -0,0 +1,112 @@ + + + + + settlement.reason.form + settlement.reason + +
+ + + + + + +
+
+
+ + + other.settlements.tree + other.settlements + + + + + + + + + + + + + other.settlements.form + other.settlements + +
+
+
+ +
+

+ +

+
+ + +

+

+ + +
+ + + +
+ + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + Settlement Analysis + other.settlements + pivot + + + + + + + + + + + + + Settlements + other.settlements + form + tree,form + + + + +
+
diff --git a/hr_insurance/README.rst b/hr_insurance/README.rst new file mode 100644 index 00000000..d488a219 --- /dev/null +++ b/hr_insurance/README.rst @@ -0,0 +1,40 @@ +OHRMS Employee Insurance Management v12 +======================================= + +Employee insurance management for Open HRMS. + +Depends +======= +[hr] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: v11.0 - Treesa Maria Jude @ cybrosys, odoo@cybrosys.com + v12.0 - Kavya Raveendran + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_insurance/__init__.py b/hr_insurance/__init__.py new file mode 100644 index 00000000..1609385d --- /dev/null +++ b/hr_insurance/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models diff --git a/hr_insurance/__manifest__.py b/hr_insurance/__manifest__.py new file mode 100644 index 00000000..19edbcd8 --- /dev/null +++ b/hr_insurance/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'Open HRMS Employee Insurance', + 'version': '12.0.1.0.0', + 'summary': """Employee Insurance Management for Open HRMS.""", + 'description': """Manages insurance amounts for employees to be deducted from salary""", + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.openhrms.com', + 'depends': [ + 'base', 'hr', 'hr_payroll', 'hr_employee_updation', + ], + 'data': [ + 'security/ir.model.access.csv', + 'security/hr_insurance_security.xml', + 'views/employee_insurance_view.xml', + 'views/insurance_salary_stucture.xml', + 'views/policy_management.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_insurance/doc/RELEASE_NOTES.md b/hr_insurance/doc/RELEASE_NOTES.md new file mode 100644 index 00000000..f4225ce4 --- /dev/null +++ b/hr_insurance/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 05.04.2019 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/hr_insurance/models/__init__.py b/hr_insurance/models/__init__.py new file mode 100644 index 00000000..d8310334 --- /dev/null +++ b/hr_insurance/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import policy_details +from . import employee_insurance diff --git a/hr_insurance/models/employee_insurance.py b/hr_insurance/models/employee_insurance.py new file mode 100644 index 00000000..6e14d929 --- /dev/null +++ b/hr_insurance/models/employee_insurance.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +import time +from datetime import datetime,date +from dateutil import relativedelta +from odoo import models, fields, api, _ + + +class EmployeeInsurance(models.Model): + _name = 'hr.insurance' + _description = 'HR Insurance' + _rec_name = 'employee_id' + + employee_id = fields.Many2one('hr.employee', string='Employee', required=True) + policy_id = fields.Many2one('insurance.policy', string='Policy', required=True) + amount = fields.Float(string='Policy Amount', required=True) + sum_insured = fields.Float(string="Sum Insured", required=True) + policy_coverage = fields.Selection([('monthly', 'Monthly'), ('yearly', 'Yearly')], + required=True, default='monthly', + string='Policy Coverage',) + date_from = fields.Date(string='Date From', + default=time.strftime('%Y-%m-%d'), readonly=True) + date_to = fields.Date(string='Date To', readonly=True, + default=str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10]) + state = fields.Selection([('active', 'Active'), + ('expired', 'Expired'), ], + default='active', string="State",compute='get_status') + company_id = fields.Many2one('res.company', string='Company', required=True, + default=lambda self: self.env.user.company_id) + + def get_status(self): + current_datetime = datetime.now() + current_date = datetime.strftime(current_datetime, "%Y-%m-%d ") + for i in self: + x = str(i.date_from) + y = str(i.date_to) + if x <= current_date: + if y >= current_date: + i.state = 'active' + else: + i.state = 'expired' + + @api.constrains('policy_coverage') + @api.onchange('policy_coverage') + def get_policy_period(self): + if self.policy_coverage == 'monthly': + self.date_to = str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10] + if self.policy_coverage == 'yearly': + self.date_to = str(datetime.now() + relativedelta.relativedelta(months=+12))[:10] + + +class HrInsurance(models.Model): + _inherit = 'hr.employee' + + insurance_percentage = fields.Float(string="Company Percentage ") + deduced_amount_per_month = fields.Float(string="Salary deduced per month", compute="get_deduced_amount") + deduced_amount_per_year = fields.Float(string="Salary deduced per year", compute="get_deduced_amount") + insurance = fields.One2many('hr.insurance', 'employee_id', string="Insurance", + domain=[('state', '=', 'active')]) + + def get_deduced_amount(self): + current_date = datetime.now() + current_datetime = datetime.strftime(current_date, "%Y-%m-%d ") + for emp in self: + ins_amount = 0 + for ins in emp.insurance: + x = str(ins.date_from) + y = str(ins.date_to) + if x < current_datetime: + if y > current_datetime: + if ins.policy_coverage == 'monthly': + ins_amount = ins_amount + (ins.amount*12) + else: + ins_amount = ins_amount + ins.amount + emp.deduced_amount_per_year = ins_amount-((ins_amount*emp.insurance_percentage)/100) + emp.deduced_amount_per_month = emp.deduced_amount_per_year/12 + + +class InsuranceRuleInput(models.Model): + _inherit = 'hr.payslip' + + def get_inputs(self, contract_ids, date_from, date_to): + res = super(InsuranceRuleInput, self).get_inputs(contract_ids, date_from, date_to) + contract_obj = self.env['hr.contract'] + for i in contract_ids: + if contract_ids[0]: + emp_id = contract_obj.browse(i[0].id).employee_id + for result in res: + if emp_id.deduced_amount_per_month != 0: + if result.get('code') == 'INSUR': + result['amount'] = emp_id.deduced_amount_per_month + return res diff --git a/hr_insurance/models/policy_details.py b/hr_insurance/models/policy_details.py new file mode 100644 index 00000000..0b0b0786 --- /dev/null +++ b/hr_insurance/models/policy_details.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import models, fields, api + + +class InsurancePolicy(models.Model): + _name = 'insurance.policy' + + name = fields.Char(string='Name', required=True) + note_field = fields.Html(string='Comment') + company_id = fields.Many2one('res.company', string='Company', required=True, + default=lambda self: self.env.user.company_id) diff --git a/hr_insurance/security/hr_insurance_security.xml b/hr_insurance/security/hr_insurance_security.xml new file mode 100644 index 00000000..e96c9cb8 --- /dev/null +++ b/hr_insurance/security/hr_insurance_security.xml @@ -0,0 +1,16 @@ + + + + Hr Insurancy Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Hr Insurance Policy company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + \ No newline at end of file diff --git a/hr_insurance/security/ir.model.access.csv b/hr_insurance/security/ir.model.access.csv new file mode 100644 index 00000000..030098bd --- /dev/null +++ b/hr_insurance/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + +access_hr_insurance_policy_officer,hr.insurance_policy.officer,hr_insurance.model_insurance_policy,hr.group_hr_user,1,1,1,1 +access_hr_insurance_policy_employee,hr.insurance_policy.employee,hr_insurance.model_insurance_policy,hr.group_hr_manager,1,1,1,1 +access_hr_insurance_policy_manager,hr.insurance_policy.manager,hr_insurance.model_insurance_policy,base.group_user,1,0,0,0 +access_hr_insurance_officer,hr.insurance.officer,hr_insurance.model_hr_insurance,hr.group_hr_user,1,1,1,1 +access_hr_insurance_employee,hr.insurance.employee,hr_insurance.model_hr_insurance,hr.group_hr_manager,1,1,1,1 +access_hr_insurance_manager,hr.insurance.manager,hr_insurance.model_hr_insurance,base.group_user,1,0,0,0 diff --git a/hr_insurance/static/description/HRMS-BUTTON.png b/hr_insurance/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/hr_insurance/static/description/HRMS-BUTTON.png differ diff --git a/hr_insurance/static/description/banner.jpg b/hr_insurance/static/description/banner.jpg new file mode 100644 index 00000000..f64af7d1 Binary files /dev/null and b/hr_insurance/static/description/banner.jpg differ diff --git a/hr_insurance/static/description/cybro-service.png b/hr_insurance/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/hr_insurance/static/description/cybro-service.png differ diff --git a/hr_insurance/static/description/cybro_logo.png b/hr_insurance/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/hr_insurance/static/description/cybro_logo.png differ diff --git a/hr_insurance/static/description/icon.png b/hr_insurance/static/description/icon.png new file mode 100644 index 00000000..b65b2782 Binary files /dev/null and b/hr_insurance/static/description/icon.png differ diff --git a/hr_insurance/static/description/index.html b/hr_insurance/static/description/index.html new file mode 100644 index 00000000..ef076b60 --- /dev/null +++ b/hr_insurance/static/description/index.html @@ -0,0 +1,351 @@ +
+
+

+ OHRMS Employee Insurance Management +

+

+ Employee Insurance Management for OHRMS +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ This module allows tracking the insurance details allowed for employees. Also + efficiently manages the insurance allowances with the salary. You can manage + the percentage of insurance amount to be deduced from the salary. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+
+ +
+

+ Features +

+
+
+ Helps to add employee insurance details
+ HR Manager can add insurance payment to Payslips
+ Helps to manage installment of the insurance
+ +
+
+
+
+
+
+
+

+ Screenshots +

+

+ + Set Insurance For Employees. +
+

+
+ +
+

+ + Policy Management. +
+

+
+ +
+

+ + Employee Insurance Details. +
+

+
+ +
+

+ + Amount Deduced On Payslip. +
+

+
+ +
+
+
+
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/hr_insurance/static/description/oh_icon.png b/hr_insurance/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_insurance/static/description/oh_icon.png differ diff --git a/hr_insurance/static/description/open-hrms-insurance-1.png b/hr_insurance/static/description/open-hrms-insurance-1.png new file mode 100644 index 00000000..743d3784 Binary files /dev/null and b/hr_insurance/static/description/open-hrms-insurance-1.png differ diff --git a/hr_insurance/static/description/open-hrms-insurance-2.png b/hr_insurance/static/description/open-hrms-insurance-2.png new file mode 100644 index 00000000..769c94ad Binary files /dev/null and b/hr_insurance/static/description/open-hrms-insurance-2.png differ diff --git a/hr_insurance/static/description/open-hrms-insurance-3.png b/hr_insurance/static/description/open-hrms-insurance-3.png new file mode 100644 index 00000000..dda89ffe Binary files /dev/null and b/hr_insurance/static/description/open-hrms-insurance-3.png differ diff --git a/hr_insurance/static/description/open-hrms-insurance-4.png b/hr_insurance/static/description/open-hrms-insurance-4.png new file mode 100644 index 00000000..5b8d120b Binary files /dev/null and b/hr_insurance/static/description/open-hrms-insurance-4.png differ diff --git a/hr_insurance/views/employee_insurance_view.xml b/hr_insurance/views/employee_insurance_view.xml new file mode 100644 index 00000000..ad206be9 --- /dev/null +++ b/hr_insurance/views/employee_insurance_view.xml @@ -0,0 +1,104 @@ + + + + + + hr.employee.Insurance_form + hr.employee + + + + + + + % + + + + + + + + + + + + + + + + + Employee Insurance + hr.insurance + +
+
+ +
+ + + + + + + + + + + + + + + + + + +
+
+
+ + Employee Insurance + hr.insurance + + + + + + + + + + + + + + + Employee Insurance + hr.insurance + form + tree,form + +

+ You have'nt created any policy yet. +

+
+
+ + + + + + + +
+
\ No newline at end of file diff --git a/hr_insurance/views/insurance_salary_stucture.xml b/hr_insurance/views/insurance_salary_stucture.xml new file mode 100644 index 00000000..256ee416 --- /dev/null +++ b/hr_insurance/views/insurance_salary_stucture.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + INSUR + Insurance Amount + + code + result = -(inputs.INSUR.amount) + + + + + INSUR + Insurance Amount + + + + + + + \ No newline at end of file diff --git a/hr_insurance/views/policy_management.xml b/hr_insurance/views/policy_management.xml new file mode 100644 index 00000000..2f8561a4 --- /dev/null +++ b/hr_insurance/views/policy_management.xml @@ -0,0 +1,55 @@ + + + + + Insurance Policy Details + insurance.policy + +
+ + + + + + + + + + + + + + + +
+
+
+ + Insurance Policy Details + insurance.policy + + + + + + + + + Insurance Policy + insurance.policy + form + tree,form + +

+ You have'nt created any policy yet. +

+
+
+ +
+
+ diff --git a/hr_leave_request_aliasing/README.md b/hr_leave_request_aliasing/README.md new file mode 100755 index 00000000..bbebcea8 --- /dev/null +++ b/hr_leave_request_aliasing/README.md @@ -0,0 +1,25 @@ +Open HRMS Leave Request Aliasing +-------------------------------- +Supporting Addon for Open HRMS, Allows You To Create Leave Request Automatically From Incoming Emails. + +Connect with experts +-------------------- + +If you have any question/queries/additional works on OpenHRMS or this module, You can drop an email directly to Cybrosys. + +Technical Notes +--------------- + +Here you need to send leave request through email with the following rules. +* You must send leave request through your registered email id. +* Mail subject must be start with 'LEAVE REQUEST ' +* Mail body must contain date as per given format (%d/%m/%Y) + +Contacts +-------- +info - info@cybrosys.com +Jesni Banu - jesni@cybrosys.in + +Website: +https://www.openhrms.com +https://www.cybrosys.com diff --git a/hr_leave_request_aliasing/__init__.py b/hr_leave_request_aliasing/__init__.py new file mode 100755 index 00000000..b579ce91 --- /dev/null +++ b/hr_leave_request_aliasing/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models + + diff --git a/hr_leave_request_aliasing/__manifest__.py b/hr_leave_request_aliasing/__manifest__.py new file mode 100755 index 00000000..00a8a9ee --- /dev/null +++ b/hr_leave_request_aliasing/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Leave Request Aliasing', + 'version': '12.0.1.0.0', + 'summary': """Allows You To Create Leave Request Automatically From Incoming Mails""", + 'description': 'This module allows you to create leave request directly from incoming mails.', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base_setup', 'hr_holidays'], + 'data': [ + # 'data/web_planner_data.xml', + 'views/hr_leave_template.xml', + 'views/leave_request_alias_view.xml', + 'views/res_config_views.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_leave_request_aliasing/data/web_planner_data.xml b/hr_leave_request_aliasing/data/web_planner_data.xml new file mode 100755 index 00000000..c21ce166 --- /dev/null +++ b/hr_leave_request_aliasing/data/web_planner_data.xml @@ -0,0 +1,81 @@ + + + + + + Leave strategy planner + + + planner_hr_leave + + + + diff --git a/hr_leave_request_aliasing/doc/RELEASE_NOTES.md b/hr_leave_request_aliasing/doc/RELEASE_NOTES.md new file mode 100755 index 00000000..d8cbf249 --- /dev/null +++ b/hr_leave_request_aliasing/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 24.03.2018 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit for Open HRMS Project diff --git a/hr_leave_request_aliasing/models/__init__.py b/hr_leave_request_aliasing/models/__init__.py new file mode 100755 index 00000000..3d56c9b5 --- /dev/null +++ b/hr_leave_request_aliasing/models/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import leave_request_alias +from . import res_config +# from . import web_planner + + diff --git a/hr_leave_request_aliasing/models/leave_request_alias.py b/hr_leave_request_aliasing/models/leave_request_alias.py new file mode 100755 index 00000000..c465b169 --- /dev/null +++ b/hr_leave_request_aliasing/models/leave_request_alias.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +import re +from datetime import datetime, timedelta +from odoo import models, api +from odoo.tools import email_split + + +class HrLeaveAlias(models.Model): + _inherit = 'hr.leave' + + @api.model + def message_new(self, msg_dict, custom_values=None): + """This function extracts required fields of hr.holidays from incoming mail then creating records""" + try: + if custom_values is None: + custom_values = {} + msg_subject = msg_dict.get('subject', '') + subject = re.search('LEAVE REQUEST', msg_subject) + if subject is not None: + email_address = email_split(msg_dict.get('email_from', False))[0] + employee = self.env['hr.employee'].sudo().search([ + '|', + ('work_email', 'ilike', email_address), + ('user_id.email', 'ilike', email_address) + ], limit=1) + msg_body = msg_dict.get('body', '') + cleaner = re.compile('<.*?>') + clean_msg_body = re.sub(cleaner, '', msg_body) + date_list = re.findall(r'\d{2}/\d{2}/\d{4}', clean_msg_body) + if len(date_list) > 0: + date_from = date_list[0] + if len(date_list) > 1: + start_date = datetime.strptime(date_list[1], '%d/%m/%Y') + date_to = start_date + timedelta(days=0) + else: + start_date = datetime.strptime(date_list[0], '%d/%m/%Y') + date_to = start_date + timedelta(days=1) + no_of_days_temp = (datetime.strptime(str(date_to), "%Y-%m-%d %H:%M:%S") - + datetime.strptime(date_from, '%d/%m/%Y')).days + custom_values.update({ + 'name': msg_subject.strip(), + 'employee_id': employee.id, + 'holiday_status_id': 1, + 'date_from': date_from, + 'date_to': date_to, + 'no_of_days_temp': no_of_days_temp + }) + return super(HrLeaveAlias, self).message_new(msg_dict, custom_values) + except: + pass + + diff --git a/hr_leave_request_aliasing/models/res_config.py b/hr_leave_request_aliasing/models/res_config.py new file mode 100755 index 00000000..58df9c67 --- /dev/null +++ b/hr_leave_request_aliasing/models/res_config.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import api, fields, models + + +class HrLeaveConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + alias_prefix = fields.Char(string='Default Alias Name for Leave', help='Default Alias Name for Leave') + alias_domain = fields.Char(string='Alias Domain', help='Default Alias Domain for Leave', + default=lambda self: self.env["ir.config_parameter"].get_param("mail.catchall.domain")) + + def set_values(self): + super(HrLeaveConfigSettings, self).set_values() + set_param = self.env['ir.config_parameter'].set_param + set_param('alias_prefix', self.alias_prefix) + set_param('alias_domain', self.alias_domain ) + + @api.model + def get_values(self): + res = super(HrLeaveConfigSettings, self).get_values() + get_param = self.env['ir.config_parameter'].sudo().get_param + res.update( + alias_prefix=get_param('alias_prefix', default=''), + alias_domain=get_param('alias_domain', default=''), + ) + return res + diff --git a/hr_leave_request_aliasing/models/web_planner.py b/hr_leave_request_aliasing/models/web_planner.py new file mode 100755 index 00000000..e62a026d --- /dev/null +++ b/hr_leave_request_aliasing/models/web_planner.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import api, models + + +class PlannerHrLeave(models.Model): + """This class is used to activate web.planner feature in 'hr_leave_request_aliasing' module""" + + _inherit = 'web.planner' + + @api.model + def _get_planner_application(self): + planner = super(PlannerHrLeave, self)._get_planner_application() + planner.append(['planner_hr_leave', 'Leave Planner']) + return planner + + @api.model + def _prepare_planner_hr_leave_data(self): + alias_record = self.env.ref('hr_leave_request_aliasing.mail_alias_leave') + return { + 'alias_domain': alias_record.alias_domain, + 'alias_name': alias_record.alias_name, + } + diff --git a/hr_leave_request_aliasing/static/description/HRMS-BUTTON.png b/hr_leave_request_aliasing/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_leave_request_aliasing/static/description/HRMS-BUTTON.png differ diff --git a/hr_leave_request_aliasing/static/description/banner.jpg b/hr_leave_request_aliasing/static/description/banner.jpg new file mode 100755 index 00000000..06286d84 Binary files /dev/null and b/hr_leave_request_aliasing/static/description/banner.jpg differ diff --git a/hr_leave_request_aliasing/static/description/cybro-service.png b/hr_leave_request_aliasing/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_leave_request_aliasing/static/description/cybro-service.png differ diff --git a/hr_leave_request_aliasing/static/description/cybro_logo.png b/hr_leave_request_aliasing/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_leave_request_aliasing/static/description/cybro_logo.png differ diff --git a/hr_leave_request_aliasing/static/description/icon.png b/hr_leave_request_aliasing/static/description/icon.png new file mode 100755 index 00000000..2ebe3a20 Binary files /dev/null and b/hr_leave_request_aliasing/static/description/icon.png differ diff --git a/hr_leave_request_aliasing/static/description/index.html b/hr_leave_request_aliasing/static/description/index.html new file mode 100755 index 00000000..98e89f2a --- /dev/null +++ b/hr_leave_request_aliasing/static/description/index.html @@ -0,0 +1,348 @@ + +
+
+

+ Open HRMS Leave Request Aliasing +

+

+ Creating Leave Request, Automatically From Incoming Emails +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Email aliasing is a default feature in Odoo which allows the user to fetch contents to ERP records directly from incoming emails. + The feature is a type of automation. Since we can configure the E-mails to fetch contents directly. + So here we are providing one of the new module to create leave request automatically from incoming email. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+ +
+
+

+ Features +

+
+
+ Automation on Leaves Request Mails.
+ Option to Set Aliasing Domain Separately for Leave Request.
+
+
+
+
+ + +
+
+

+ Screenshots +

+

+ + Here we can send leave request through our registered email id. Then it will create leave + request in Odoo. We must ensure that our mail subject must start with 'LEAVE REQUEST ' and date + format must be as '%d/%m/%Y'. +
+

+
+ +
+
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+ +
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+ +
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/hr_leave_request_aliasing/static/description/mail_aliasing.png b/hr_leave_request_aliasing/static/description/mail_aliasing.png new file mode 100755 index 00000000..958acd2b Binary files /dev/null and b/hr_leave_request_aliasing/static/description/mail_aliasing.png differ diff --git a/hr_leave_request_aliasing/static/description/oh_icon.png b/hr_leave_request_aliasing/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_leave_request_aliasing/static/description/oh_icon.png differ diff --git a/hr_leave_request_aliasing/static/description/open-hrms-leave-request.png b/hr_leave_request_aliasing/static/description/open-hrms-leave-request.png new file mode 100755 index 00000000..958acd2b Binary files /dev/null and b/hr_leave_request_aliasing/static/description/open-hrms-leave-request.png differ diff --git a/hr_leave_request_aliasing/static/src/js/web_planner_hr_leave.js b/hr_leave_request_aliasing/static/src/js/web_planner_hr_leave.js new file mode 100755 index 00000000..f0510233 --- /dev/null +++ b/hr_leave_request_aliasing/static/src/js/web_planner_hr_leave.js @@ -0,0 +1,6 @@ +odoo.define('planner_hr_leave.planner', function (require) { +"use strict"; + +var planner = require('web.planner.common'); + +}); diff --git a/hr_leave_request_aliasing/views/hr_leave_template.xml b/hr_leave_request_aliasing/views/hr_leave_template.xml new file mode 100755 index 00000000..46bd5462 --- /dev/null +++ b/hr_leave_request_aliasing/views/hr_leave_template.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/hr_leave_request_aliasing/views/leave_request_alias_view.xml b/hr_leave_request_aliasing/views/leave_request_alias_view.xml new file mode 100755 index 00000000..e90d12df --- /dev/null +++ b/hr_leave_request_aliasing/views/leave_request_alias_view.xml @@ -0,0 +1,9 @@ + + + + leave + + + employees + + diff --git a/hr_leave_request_aliasing/views/res_config_views.xml b/hr_leave_request_aliasing/views/res_config_views.xml new file mode 100755 index 00000000..669b1a3e --- /dev/null +++ b/hr_leave_request_aliasing/views/res_config_views.xml @@ -0,0 +1,54 @@ + + + + + Configure Leave + res.config.settings + + + + +
+

Leaves

+
+
+
+
+
+
+
+
+
+
+ + + Leaves Config + ir.actions.act_window + res.config.settings + form + inline + {'module' : 'hr_leave_request_aliasing'} + + + +
+
diff --git a/hr_multi_company/README.md b/hr_multi_company/README.md new file mode 100755 index 00000000..92115909 --- /dev/null +++ b/hr_multi_company/README.md @@ -0,0 +1,17 @@ +OHRMS Multi Company +--------------------- +Supporting Addon for Open HRMS, Added Advance Fields On Employee Master + +Connect with experts +-------------------- + +If you have any question/queries/additional works on OpenHRMS or this module, You can drop an email directly to Cybrosys. + +Contacts +-------- +info - info@cybrosys.com +Jesni Banu - jesni@cybrosys.in + +Website: +https://www.openhrms.com +https://www.cybrosys.com diff --git a/hr_multi_company/__init__.py b/hr_multi_company/__init__.py new file mode 100755 index 00000000..9c6d6e05 --- /dev/null +++ b/hr_multi_company/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models + + diff --git a/hr_multi_company/__manifest__.py b/hr_multi_company/__manifest__.py new file mode 100755 index 00000000..470924bb --- /dev/null +++ b/hr_multi_company/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Multi-Company', + 'version': '12.0.1.0.0', + 'summary': """Enables Multi-Company""", + 'description': 'This module enables multi company features', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr_contract', 'hr_payroll', 'hr_expense', 'hr_attendance', 'hr_employee_transfer'], + 'data': [ + 'views/hr_company_view.xml', + 'views/multi_company_view.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_multi_company/doc/RELEASE_NOTES.md b/hr_multi_company/doc/RELEASE_NOTES.md new file mode 100755 index 00000000..7ee93a11 --- /dev/null +++ b/hr_multi_company/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.03.2018 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit for Open HRMS Project diff --git a/hr_multi_company/models/__init__.py b/hr_multi_company/models/__init__.py new file mode 100755 index 00000000..0e2cb355 --- /dev/null +++ b/hr_multi_company/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import hr_multi_company + diff --git a/hr_multi_company/models/hr_multi_company.py b/hr_multi_company/models/hr_multi_company.py new file mode 100755 index 00000000..6d8a492d --- /dev/null +++ b/hr_multi_company/models/hr_multi_company.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields + + +class HrAttendanceMultiCompany(models.Model): + _inherit = 'hr.attendance' + + company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, + default=lambda self: self.env.user.company_id) + + +class HrLeaveMultiCompany(models.Model): + _inherit = 'hr.leave' + + company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, + default=lambda self: self.env.user.company_id) + + +class HrPayslipMultiCompany(models.Model): + _inherit = 'hr.payslip.run' + + company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, + default=lambda self: self.env.user.company_id) + + +class HrSalaryCategoryMultiCompany(models.Model): + _inherit = 'hr.salary.rule.category' + + company_id = fields.Many2one('res.company', 'Company', copy=False, readonly=True, + default=lambda self: self.env.user.company_id) diff --git a/hr_multi_company/static/description/HRMS-BUTTON.png b/hr_multi_company/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_multi_company/static/description/HRMS-BUTTON.png differ diff --git a/hr_multi_company/static/description/banner.jpg b/hr_multi_company/static/description/banner.jpg new file mode 100755 index 00000000..08b67a19 Binary files /dev/null and b/hr_multi_company/static/description/banner.jpg differ diff --git a/hr_multi_company/static/description/cybro-service.png b/hr_multi_company/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_multi_company/static/description/cybro-service.png differ diff --git a/hr_multi_company/static/description/cybro_logo.png b/hr_multi_company/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_multi_company/static/description/cybro_logo.png differ diff --git a/hr_multi_company/static/description/icon.png b/hr_multi_company/static/description/icon.png new file mode 100755 index 00000000..1dbe70d0 Binary files /dev/null and b/hr_multi_company/static/description/icon.png differ diff --git a/hr_multi_company/static/description/index.html b/hr_multi_company/static/description/index.html new file mode 100755 index 00000000..9eac0941 --- /dev/null +++ b/hr_multi_company/static/description/index.html @@ -0,0 +1,357 @@ + +
+
+

+ Open HRMS Multi Company +

+

+ Managing Multi Company In HR Processes. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ + +
+
+

+ Overview +

+

+ This module enables HR multi company, hence HR manager can easily handle + multi company process separately. We can activate multi company feature in general settings as usual. + This will automatically add company field in every HR related records. +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+ +
+ +
+

+ Features +

+
+
+ Managing multi company.
+
+
+ Handle multiple companies separately.
+
+
+
+
+ +
+
+

+ Screenshots +

+

+ + The employee's details in every Open HRMS module shows the company that the employee belongs to. +
+

+
+ +
+ + +

+ +
+

+
+ +
+ +
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/hr_multi_company/static/description/oh_icon.png b/hr_multi_company/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_multi_company/static/description/oh_icon.png differ diff --git a/hr_multi_company/static/description/open-hrms-multi-company-1.png b/hr_multi_company/static/description/open-hrms-multi-company-1.png new file mode 100644 index 00000000..8445d7b0 Binary files /dev/null and b/hr_multi_company/static/description/open-hrms-multi-company-1.png differ diff --git a/hr_multi_company/static/description/open-hrms-multi-company-2.png b/hr_multi_company/static/description/open-hrms-multi-company-2.png new file mode 100644 index 00000000..28bd28ac Binary files /dev/null and b/hr_multi_company/static/description/open-hrms-multi-company-2.png differ diff --git a/hr_multi_company/views/hr_company_view.xml b/hr_multi_company/views/hr_company_view.xml new file mode 100755 index 00000000..cca6e8e3 --- /dev/null +++ b/hr_multi_company/views/hr_company_view.xml @@ -0,0 +1,57 @@ + + + + hr.holidays.form.view1 + hr.leave + + + + + + + + + + hr.contract.form.view1 + hr.contract + + + + + + + + + + hr.attendance.form.view1 + hr.attendance + + + + + + + + + + hr.payslip.run.form.view1 + hr.payslip.run + + + + + + + + + + hr.salary.rule.category.form.view1 + hr.salary.rule.category + + + + + + + + \ No newline at end of file diff --git a/hr_multi_company/views/multi_company_view.xml b/hr_multi_company/views/multi_company_view.xml new file mode 100755 index 00000000..a9dfdca8 --- /dev/null +++ b/hr_multi_company/views/multi_company_view.xml @@ -0,0 +1,72 @@ + + + + Department Create, Write, Unlink + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Salary rules of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Salary structures of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Payslips batches of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Payslips of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Salary Category of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Payslips Contribution of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Attendance of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Holidays of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Expense of my Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + \ No newline at end of file diff --git a/hr_reminder/README.rst b/hr_reminder/README.rst new file mode 100755 index 00000000..2fe35cf9 --- /dev/null +++ b/hr_reminder/README.rst @@ -0,0 +1,39 @@ +Open HRMS Reminders Todo V11 +============================ + +HR Reminder For OHRMS + +Depends +======= +[hr] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/10.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Treesa Maria Jude @ cybrosys, treesa@cybrosys.in + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_reminder/__init__.py b/hr_reminder/__init__.py new file mode 100755 index 00000000..a84ea577 --- /dev/null +++ b/hr_reminder/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models +from . import controllers diff --git a/hr_reminder/__manifest__.py b/hr_reminder/__manifest__.py new file mode 100755 index 00000000..99a12578 --- /dev/null +++ b/hr_reminder/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Reminders Todo', + 'version': '12.0.1.0.0', + 'category': 'Generic Modules/Human Resources', + 'summary': 'HR Reminder For OHRMS', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr'], + 'data': [ + 'security/ir.model.access.csv', + 'security/hr_reminder_security.xml', + 'views/hr_reminder_view.xml', + 'views/reminder_template.xml', + ], + 'qweb': [ + 'static/src/xml/reminder_topbar.xml', ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_reminder/controllers/__init__.py b/hr_reminder/controllers/__init__.py new file mode 100755 index 00000000..948e84ff --- /dev/null +++ b/hr_reminder/controllers/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import main diff --git a/hr_reminder/controllers/main.py b/hr_reminder/controllers/main.py new file mode 100755 index 00000000..bfb960de --- /dev/null +++ b/hr_reminder/controllers/main.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import http +from odoo.http import request + + +class Reminders(http.Controller): + + @http.route('/hr_reminder/all_reminder', type='json', auth="public") + def all_reminder(self): + reminder = [] + for i in request.env['hr.reminder'].search([]): + if i.reminder_active: + reminder.append(i.name) + return reminder + + @http.route('/hr_reminder/reminder_active', type='json', auth="public") + def reminder_active(self, **kwargs): + reminder_value = kwargs.get('reminder_name') + value = [] + + for i in request.env['hr.reminder'].search([('name', '=', reminder_value)]): + value.append(i.model_name.model) + value.append(i.model_field.name) + value.append(i.search_by) + value.append(i.date_set) + value.append(i.date_from) + value.append(i.date_to) + # value.append(i.exclude_year) + return value diff --git a/hr_reminder/controllers/time_reminder.py b/hr_reminder/controllers/time_reminder.py new file mode 100755 index 00000000..4419d8ab --- /dev/null +++ b/hr_reminder/controllers/time_reminder.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- + +import werkzeug + +from odoo.api import Environment +import odoo.http as http + +from odoo.http import request +from odoo import SUPERUSER_ID +from odoo import registry as registry_get + + +class CalendarController(http.Controller): + + @http.route('/calendar/meeting/accept', type='http', auth="calendar") + def accept(self, db, token, action, id, **kwargs): + registry = registry_get(db) + with registry.cursor() as cr: + env = Environment(cr, SUPERUSER_ID, {}) + attendee = env['calendar.attendee'].search([('access_token', '=', token), ('state', '!=', 'accepted')]) + if attendee: + attendee.do_accept() + return self.view(db, token, action, id, view='form') + + @http.route('/calendar/meeting/decline', type='http', auth="calendar") + def declined(self, db, token, action, id): + registry = registry_get(db) + with registry.cursor() as cr: + env = Environment(cr, SUPERUSER_ID, {}) + attendee = env['calendar.attendee'].search([('access_token', '=', token), ('state', '!=', 'declined')]) + if attendee: + attendee.do_decline() + return self.view(db, token, action, id, view='form') + + @http.route('/calendar/meeting/view', type='http', auth="calendar") + def view(self, db, token, action, id, view='calendar'): + registry = registry_get(db) + with registry.cursor() as cr: + # Since we are in auth=none, create an env with SUPERUSER_ID + env = Environment(cr, SUPERUSER_ID, {}) + attendee = env['calendar.attendee'].search([('access_token', '=', token)]) + timezone = attendee.partner_id.tz + lang = attendee.partner_id.lang or 'en_US' + event = env['calendar.event'].with_context(tz=timezone, lang=lang).browse(int(id)) + + # If user is logged, redirect to form view of event + # otherwise, display the simplifyed web page with event informations + if request.session.uid: + return werkzeug.utils.redirect('/web?db=%s#id=%s&view_type=form&model=calendar.event' % (db, id)) + + # NOTE : we don't use request.render() since: + # - we need a template rendering which is not lazy, to render before cursor closing + # - we need to display the template in the language of the user (not possible with + # request.render()) + return env['ir.ui.view'].with_context(lang=lang).render_template( + 'calendar.invitation_page_anonymous', { + 'event': event, + 'attendee': attendee, + }) + + # Function used, in RPC to check every 5 minutes, if notification to do for an event or not + @http.route('/calendar/notify', type='json', auth="user") + def notify(self): + return request.env['calendar.alarm_manager'].get_next_notif() + + @http.route('/calendar/notify_ack', type='json', auth="user") + def notify_ack(self, type=''): + return request.env['res.partner']._set_calendar_last_notif_ack() diff --git a/hr_reminder/docs/RELEASE_NOTES.md b/hr_reminder/docs/RELEASE_NOTES.md new file mode 100755 index 00000000..cd7da7a5 --- /dev/null +++ b/hr_reminder/docs/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module hr_reminder + +#### 21.04.2018 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/hr_reminder/models/__init__.py b/hr_reminder/models/__init__.py new file mode 100755 index 00000000..88311d89 --- /dev/null +++ b/hr_reminder/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import hr_reminder diff --git a/hr_reminder/models/hr_reminder.py b/hr_reminder/models/hr_reminder.py new file mode 100755 index 00000000..e9a6f38a --- /dev/null +++ b/hr_reminder/models/hr_reminder.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Treesa Maria Jude () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from datetime import datetime +from odoo import models, fields + + +class HrPopupReminder(models.Model): + _name = 'hr.reminder' + + name = fields.Char(string='Title', required=True) + model_name = fields.Many2one('ir.model', string="Model", required=True, domain="[('model', 'like','hr')]") + model_field = fields.Many2one('ir.model.fields', string='Field', + domain="[('model_id', '=',model_name),('ttype', 'in', ['datetime','date'])]", + required=True) + search_by = fields.Selection([('today', 'Today'), + ('set_period', 'Set Period'), + ('set_date', 'Set Date'), ], + required=True, string="Search By") + days_before = fields.Integer(string='Reminder before') + active = fields.Boolean(string="Active",default=True) + # exclude_year = fields.Boolean(string="Consider day alone") + reminder_active = fields.Boolean(string="Reminder Active") + date_set = fields.Date(string='Select Date') + date_from = fields.Date(string="Start Date") + date_to = fields.Date(string="End Date") + expiry_date = fields.Date(string="Reminder Expiry Date") + company_id = fields.Many2one('res.company', string='Company', required=True, + default=lambda self: self.env.user.company_id) + + def reminder_scheduler(self): + now = fields.Datetime.from_string(fields.Datetime.now()) + today = fields.Date.today() + obj = self.env['hr.reminder'].search([]) + for i in obj: + if i.search_by != "today": + if i.expiry_date and datetime.strptime(today, "%Y-%m-%d") == datetime.strptime(i.expiry_date, "%Y-%m-%d"): + i.active = False + else: + if i.search_by == "set_date": + d1 = datetime.strptime(i.date_set, "%Y-%m-%d") + d2 = datetime.strptime(today, "%Y-%m-%d") + daydiff = abs((d2 - d1).days) + if daydiff <= i.days_before: + i.reminder_active = True + else: + i.reminder_active = False + elif i.search_by == "set_period": + d1 = datetime.strptime(i.date_from, "%Y-%m-%d") + d2 = datetime.strptime(today, "%Y-%m-%d") + daydiff = abs((d2 - d1).days) + if daydiff <= i.days_before: + i.reminder_active = True + else: + i.reminder_active = False + else: + i.reminder_active = True + diff --git a/hr_reminder/security/hr_reminder_security.xml b/hr_reminder/security/hr_reminder_security.xml new file mode 100755 index 00000000..2650c4fa --- /dev/null +++ b/hr_reminder/security/hr_reminder_security.xml @@ -0,0 +1,10 @@ + + + + Hr Reminder Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + \ No newline at end of file diff --git a/hr_reminder/security/ir.model.access.csv b/hr_reminder/security/ir.model.access.csv new file mode 100755 index 00000000..46fc9f5d --- /dev/null +++ b/hr_reminder/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + +access_hr_reminder_officer,hr.reminder.officer,hr_reminder.model_hr_reminder,hr.group_hr_user,1,1,1,1 +access_hr_reminder_employee,hr.reminder.employee,hr_reminder.model_hr_reminder,hr.group_hr_manager,1,1,1,1 +access_hr_reminder_manager,hr.reminder.manager,hr_reminder.model_hr_reminder,base.group_user,0,0,0,0 diff --git a/hr_reminder/static/description/HRMS-BUTTON.png b/hr_reminder/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_reminder/static/description/HRMS-BUTTON.png differ diff --git a/hr_reminder/static/description/banner.jpg b/hr_reminder/static/description/banner.jpg new file mode 100755 index 00000000..7579d32e Binary files /dev/null and b/hr_reminder/static/description/banner.jpg differ diff --git a/hr_reminder/static/description/cybro-service.png b/hr_reminder/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_reminder/static/description/cybro-service.png differ diff --git a/hr_reminder/static/description/cybro_logo.png b/hr_reminder/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_reminder/static/description/cybro_logo.png differ diff --git a/hr_reminder/static/description/icon.png b/hr_reminder/static/description/icon.png new file mode 100755 index 00000000..cf84f5d5 Binary files /dev/null and b/hr_reminder/static/description/icon.png differ diff --git a/hr_reminder/static/description/index.html b/hr_reminder/static/description/index.html new file mode 100755 index 00000000..7c8787b5 --- /dev/null +++ b/hr_reminder/static/description/index.html @@ -0,0 +1,391 @@ +
+
+

+ Reminders +

+

+ Forget about Forgetting. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Reminders is an effective module,helps to memorise all your important dates. We +can set reminders to any model (eg: Sales,HR,Project etc..) and also their corresponding +date fields to compare.This eases the company work load to memorize the special +dates (eg: Expiration date,Deadline date,Assigned Date etc...). +

+
+
+

+ Configuration +

+

+ No additional configuration is required. +

+
+
+
+ +
+

+ Features +

+
+
+ Set the reminder for different models.
+ Different types of search options +
    +
  •    Today: Compares to the current date.
  • +
  •    Set Date: Compares with the given date.
  • +
  •    Set Period: Reminder is set between a time range(Start date - End date).
  • +
+ +
+
+
+
+
+ +
+
+

+ Screenshots +

+

+ + Set your reminders for any model and the corresponding date field. + Also this module allows different methods to search. +
+

+
+ +
+

+ + Setting the search by today. +
+

+
+ +
+

+ + Setting the search by date. +
+

+
+ +
+

+ + Setting the search by period. +
+

+
+ +
+

+ + Select the Reminder from the list of Reminders. +
+

+
+ +
+

+ + Related Result of search. +
+

+
+ +
+
+
+ +
+
+

Open HRMS

+

Most advanced open source HR management software

+
+
+ +
+
+
+
+ + + +
+
+
+ cybrosys technologies +
+ +
+
+

+ Our Services +

+ +
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
diff --git a/hr_reminder/static/description/oh_icon.png b/hr_reminder/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_reminder/static/description/oh_icon.png differ diff --git a/hr_reminder/static/description/open-hrms-reminder-1.png b/hr_reminder/static/description/open-hrms-reminder-1.png new file mode 100755 index 00000000..126e3c6d Binary files /dev/null and b/hr_reminder/static/description/open-hrms-reminder-1.png differ diff --git a/hr_reminder/static/description/open-hrms-reminder-2.png b/hr_reminder/static/description/open-hrms-reminder-2.png new file mode 100644 index 00000000..d252b366 Binary files /dev/null and b/hr_reminder/static/description/open-hrms-reminder-2.png differ diff --git a/hr_reminder/static/description/open-hrms-reminder-3.png b/hr_reminder/static/description/open-hrms-reminder-3.png new file mode 100755 index 00000000..624321a2 Binary files /dev/null and b/hr_reminder/static/description/open-hrms-reminder-3.png differ diff --git a/hr_reminder/static/description/open-hrms-reminder-4.png b/hr_reminder/static/description/open-hrms-reminder-4.png new file mode 100755 index 00000000..5e7ba1c9 Binary files /dev/null and b/hr_reminder/static/description/open-hrms-reminder-4.png differ diff --git a/hr_reminder/static/description/open-hrms-reminder-5.png b/hr_reminder/static/description/open-hrms-reminder-5.png new file mode 100755 index 00000000..092b2812 Binary files /dev/null and b/hr_reminder/static/description/open-hrms-reminder-5.png differ diff --git a/hr_reminder/static/description/open-hrms-reminder-6.png b/hr_reminder/static/description/open-hrms-reminder-6.png new file mode 100755 index 00000000..ce937578 Binary files /dev/null and b/hr_reminder/static/description/open-hrms-reminder-6.png differ diff --git a/hr_reminder/static/description/popup.png b/hr_reminder/static/description/popup.png new file mode 100755 index 00000000..092b2812 Binary files /dev/null and b/hr_reminder/static/description/popup.png differ diff --git a/hr_reminder/static/description/reminder.png b/hr_reminder/static/description/reminder.png new file mode 100755 index 00000000..126e3c6d Binary files /dev/null and b/hr_reminder/static/description/reminder.png differ diff --git a/hr_reminder/static/description/reminder_icon.png b/hr_reminder/static/description/reminder_icon.png new file mode 100644 index 00000000..b80b18c2 Binary files /dev/null and b/hr_reminder/static/description/reminder_icon.png differ diff --git a/hr_reminder/static/description/result.png b/hr_reminder/static/description/result.png new file mode 100755 index 00000000..ce937578 Binary files /dev/null and b/hr_reminder/static/description/result.png differ diff --git a/hr_reminder/static/description/set_date.png b/hr_reminder/static/description/set_date.png new file mode 100755 index 00000000..624321a2 Binary files /dev/null and b/hr_reminder/static/description/set_date.png differ diff --git a/hr_reminder/static/description/set_period.png b/hr_reminder/static/description/set_period.png new file mode 100755 index 00000000..5e7ba1c9 Binary files /dev/null and b/hr_reminder/static/description/set_period.png differ diff --git a/hr_reminder/static/description/set_today.png b/hr_reminder/static/description/set_today.png new file mode 100644 index 00000000..d252b366 Binary files /dev/null and b/hr_reminder/static/description/set_today.png differ diff --git a/hr_reminder/static/src/css/notification.css b/hr_reminder/static/src/css/notification.css new file mode 100755 index 00000000..01f689dd --- /dev/null +++ b/hr_reminder/static/src/css/notification.css @@ -0,0 +1,32 @@ + +.oe_webclient_notification_action t { + color: white; +} +.oe_webclient_notification_action p { + color: white; + margin-top: 1em; +} + .label { + display: inline-block; + color: white; + max-width: 100%; + margin-bottom: 4px; + font-weight: bold; + font-size: larger; +} +.reminder-dropdown { + .o-flex(0, 1, auto); + background: #FFFFFF; + max-height: 400px; + min-height: 50px; + overflow-y: auto; + + @media (max-width: @screen-xs-max) { + max-height: none; + } + +.detail-client-address-country { + color: black; + } + + diff --git a/hr_reminder/static/src/js/reminder_topbar.js b/hr_reminder/static/src/js/reminder_topbar.js new file mode 100755 index 00000000..b12a2558 --- /dev/null +++ b/hr_reminder/static/src/js/reminder_topbar.js @@ -0,0 +1,84 @@ +odoo.define('hr_reminder.reminder_topbar', function (require) { +"use strict"; + +var core = require('web.core'); +var SystrayMenu = require('web.SystrayMenu'); +var Widget = require('web.Widget'); +var QWeb = core.qweb; +var ajax = require('web.ajax'); + +var reminder_menu = Widget.extend({ + template:'reminder_menu', + + events: { + "click .dropdown-toggle": "on_click_reminder", + "click .detail-client-address-country": "reminder_active", + }, + + + on_click_reminder: function (event) { + var self = this + ajax.jsonRpc("/hr_reminder/all_reminder", 'call',{} + ).then(function(all_reminder){ + self.all_reminder = all_reminder + self.$('.o_mail_navbar_dropdown_top').html(QWeb.render('reminder_menu',{ + values: self.all_reminder + })); + }) + }, + + + reminder_active: function(){ + var self = this; + var value =$("#reminder_select").val(); + ajax.jsonRpc("/hr_reminder/reminder_active", 'call',{'reminder_name':value} + ).then(function(reminder){ + self.reminder = reminder + for (var i=0;i<1;i++){ + var model = self.reminder[i] + var date = self.reminder[i+1] + console.log("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDd",date,new Date()) + if (self.reminder[i+2] == 'today'){ + + return self.do_action({ + type: 'ir.actions.act_window', + res_model: model, + view_mode: 'list', + view_type: 'list', + domain: [[date, '=', new Date()]], + views: [[false, 'list']], + target: 'new',}) + } + + else if (self.reminder[i+2] == 'set_date'){ + return self.do_action({ + type: 'ir.actions.act_window', + res_model: model, + view_mode: 'list', + view_type: 'list', + domain: [[date, '=', self.reminder[i+3]]], + views: [[false, 'list']], + target: 'new', + }) + } + + else if (self.reminder[i+2] == 'set_period'){ + return self.do_action({ + type: 'ir.actions.act_window', + res_model: model, + view_mode: 'list', + view_type: 'list', + domain: [[date, '<', self.reminder[i+5]],[date, '>', self.reminder[i+4]]], + views: [[false, 'list']], + target: 'new', + }) + } + + } + + }); + }, +}); + +SystrayMenu.Items.push(reminder_menu); +}); diff --git a/hr_reminder/static/src/xml/reminder_topbar.xml b/hr_reminder/static/src/xml/reminder_topbar.xml new file mode 100755 index 00000000..b61c42ab --- /dev/null +++ b/hr_reminder/static/src/xml/reminder_topbar.xml @@ -0,0 +1,28 @@ + + + + +
  • + + + +
  • +
    +
    \ No newline at end of file diff --git a/hr_reminder/views/hr_reminder_view.xml b/hr_reminder/views/hr_reminder_view.xml new file mode 100755 index 00000000..4845b27b --- /dev/null +++ b/hr_reminder/views/hr_reminder_view.xml @@ -0,0 +1,80 @@ + + + + + + Reminder scheduler + + code + model.reminder_scheduler() + + 1 + minutes + -1 + + + + + + + hr.reminder.form.view + hr.reminder + +
    + +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + hr.reminder.tree.view + hr.reminder + + + + + + + + + + + + Reminders + hr.reminder + tree,form + +

    + Click here to create new reminder. +

    +
    +
    + + + +
    +
    \ No newline at end of file diff --git a/hr_reminder/views/reminder_template.xml b/hr_reminder/views/reminder_template.xml new file mode 100755 index 00000000..e7cf0e20 --- /dev/null +++ b/hr_reminder/views/reminder_template.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/hr_resignation/README.rst b/hr_resignation/README.rst new file mode 100755 index 00000000..0b9e7534 --- /dev/null +++ b/hr_resignation/README.rst @@ -0,0 +1,40 @@ +OHRMS Employee Resignation v12 +============================== + +Employee Resignation Process. + +Depends +======= +[hr_employee_updation] addon Open HRMS +[mail] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Niyas Raphy @ cybrosys, odoo@cybrosys.com + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_resignation/__init__.py b/hr_resignation/__init__.py new file mode 100755 index 00000000..a0fdc10f --- /dev/null +++ b/hr_resignation/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/hr_resignation/__manifest__.py b/hr_resignation/__manifest__.py new file mode 100755 index 00000000..aa2e4845 --- /dev/null +++ b/hr_resignation/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Niyas Raphy() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Resignation', + 'version': '12.0.2.0.0', + 'summary': 'Handle the resignation process of the employee', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.openhrms.com', + 'depends': ['hr_employee_updation', 'mail'], + 'category': 'Generic Modules/Human Resources', + 'maintainer': 'Cybrosys Techno Solutions', + 'demo': [], + 'data': [ + 'security/security.xml', + 'security/ir.model.access.csv', + 'data/resign_employee.xml', + 'views/hr_employee.xml', + 'views/resignation_view.xml', + 'views/approved_resignation.xml', + 'views/resignation_sequence.xml', + ], + 'installable': True, + 'application': False, + 'auto_install': False, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', +} + diff --git a/hr_resignation/data/resign_employee.xml b/hr_resignation/data/resign_employee.xml new file mode 100644 index 00000000..89930f07 --- /dev/null +++ b/hr_resignation/data/resign_employee.xml @@ -0,0 +1,16 @@ + + + + + HR Resignation: update employee + + code + model.update_employee_status() + + 1 + days + -1 + + + + \ No newline at end of file diff --git a/hr_resignation/docs/RELEASE_NOTES.md b/hr_resignation/docs/RELEASE_NOTES.md new file mode 100755 index 00000000..31947c9f --- /dev/null +++ b/hr_resignation/docs/RELEASE_NOTES.md @@ -0,0 +1,11 @@ +## Module hr_resignation + +#### 07.04.2018 +#### Version 12.0.1.0.0 +##### ADD +- Initial Commit + +#### 10.03.2019 +#### Version 12.0.2.0.0 +##### UPDT +- Resignation Field in Employee Master diff --git a/hr_resignation/models/__init__.py b/hr_resignation/models/__init__.py new file mode 100755 index 00000000..fb9ec22a --- /dev/null +++ b/hr_resignation/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import hr_resignation diff --git a/hr_resignation/models/hr_resignation.py b/hr_resignation/models/hr_resignation.py new file mode 100755 index 00000000..b4361cf6 --- /dev/null +++ b/hr_resignation/models/hr_resignation.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +import datetime +from datetime import datetime +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError +date_format = "%Y-%m-%d" + + +class HrResignation(models.Model): + _name = 'hr.resignation' + _inherit = 'mail.thread' + _rec_name = 'employee_id' + + def _get_employee_id(self): + # assigning the related employee of the logged in user + employee_rec = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) + return employee_rec.id + + name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, index=True, + default=lambda self: _('New')) + employee_id = fields.Many2one('hr.employee', string="Employee", default=_get_employee_id, + help='Name of the employee for whom the request is creating') + department_id = fields.Many2one('hr.department', string="Department", related='employee_id.department_id', + help='Department of the employee') + joined_date = fields.Date(string="Join Date", required=True, + help='Joining date of the employee') + expected_revealing_date = fields.Date(string="Relieving Date", required=True, + help='Date on which he is revealing from the company') + resign_confirm_date = fields.Date(string="Resign confirm date", help='Date on which the request is confirmed') + approved_revealing_date = fields.Date(string="Approved Date", help='The date approved for the relieving') + reason = fields.Text(string="Reason", help='Specify reason for leaving the company') + notice_period = fields.Char(string="Notice Period", compute='_notice_period') + state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirm'), ('approved', 'Approved'), ('cancel', 'Cancel')], + string='Status', default='draft') + + @api.onchange('employee_id') + def set_join_date(self): + self.joined_date = self.employee_id.joining_date if self.employee_id.joining_date else '' + + @api.model + def create(self, vals): + # assigning the sequence for the record + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code('hr.resignation') or _('New') + res = super(HrResignation, self).create(vals) + return res + + @api.constrains('employee_id') + def check_employee(self): + # Checking whether the user is creating leave request of his/her own + for rec in self: + if not self.env.user.has_group('hr.group_hr_user'): + if rec.employee_id.user_id.id and rec.employee_id.user_id.id != self.env.uid: + raise ValidationError(_('You cannot create request for other employees')) + + @api.onchange('employee_id') + @api.depends('employee_id') + def check_request_existence(self): + # Check whether any resignation request already exists + for rec in self: + if rec.employee_id: + resignation_request = self.env['hr.resignation'].search([('employee_id', '=', rec.employee_id.id), + ('state', 'in', ['confirm', 'approved'])]) + if resignation_request: + raise ValidationError(_('There is a resignation request in confirmed or' + ' approved state for this employee')) + + @api.multi + def _notice_period(self): + # calculating the notice period for the employee + for rec in self: + if rec.approved_revealing_date and rec.resign_confirm_date: + approved_date = datetime.strptime(str(rec.approved_revealing_date), date_format) + confirmed_date = datetime.strptime(str(rec.resign_confirm_date), date_format) + notice_period = approved_date - confirmed_date + rec.notice_period = notice_period.days + + @api.constrains('joined_date', 'expected_revealing_date') + def _check_dates(self): + # validating the entered dates + for rec in self: + resignation_request = self.env['hr.resignation'].search([('employee_id', '=', rec.employee_id.id), + ('state', 'in', ['confirm', 'approved'])]) + if resignation_request: + raise ValidationError(_('There is a resignation request in confirmed or' + ' approved state for this employee')) + if rec.joined_date >= rec.expected_revealing_date: + raise ValidationError(_('Relieving date must be anterior to joining date')) + + @api.multi + def confirm_resignation(self): + for rec in self: + rec.state = 'confirm' + rec.resign_confirm_date = str(datetime.now()) + + @api.multi + def cancel_resignation(self): + for rec in self: + rec.state = 'cancel' + + @api.multi + def reject_resignation(self): + for rec in self: + rec.state = 'rejected' + + @api.multi + def approve_resignation(self): + for rec in self: + if not rec.approved_revealing_date: + raise ValidationError(_('Enter Approved Relieving Date')) + if rec.approved_revealing_date and rec.resign_confirm_date: + if rec.approved_revealing_date <= rec.resign_confirm_date: + raise ValidationError(_('Approved relieving date must be anterior to confirmed date')) + rec.state = 'approved' + + @api.multi + def update_employee_status(self): + resignation = self.env['hr.resignation'].search([('state', '=', 'approved')]) + for rec in resignation: + if rec.approved_revealing_date <= fields.Date.today() and rec.employee_id.active: + rec.employee_id.active = False + rec.employee_id.resign_date = rec.approved_revealing_date + + +class HrEmployee(models.Model): + _inherit = 'hr.employee' + + resign_date = fields.Date('Resign Date', readonly=True) diff --git a/hr_resignation/security/ir.model.access.csv b/hr_resignation/security/ir.model.access.csv new file mode 100755 index 00000000..62723a73 --- /dev/null +++ b/hr_resignation/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +view_hr_resignation,view.hr.resignation,hr_resignation.model_hr_resignation,base.group_user,1,1,1,0 +view_hr_employee,view.hr.employee,hr.model_hr_employee,base.group_user,1,1,1,0 diff --git a/hr_resignation/security/security.xml b/hr_resignation/security/security.xml new file mode 100755 index 00000000..25074e4c --- /dev/null +++ b/hr_resignation/security/security.xml @@ -0,0 +1,11 @@ + + + + + Employee Resignation + + ['|',('employee_id.user_id','=',user.id),('employee_id.user_id','=',False)] + + + + diff --git a/hr_resignation/static/description/HRMS-BUTTON.png b/hr_resignation/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_resignation/static/description/HRMS-BUTTON.png differ diff --git a/hr_resignation/static/description/banner.jpg b/hr_resignation/static/description/banner.jpg new file mode 100755 index 00000000..a41f5283 Binary files /dev/null and b/hr_resignation/static/description/banner.jpg differ diff --git a/hr_resignation/static/description/cybro-service.png b/hr_resignation/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_resignation/static/description/cybro-service.png differ diff --git a/hr_resignation/static/description/cybro_logo.png b/hr_resignation/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_resignation/static/description/cybro_logo.png differ diff --git a/hr_resignation/static/description/hrms-demo.png b/hr_resignation/static/description/hrms-demo.png new file mode 100644 index 00000000..529366e6 Binary files /dev/null and b/hr_resignation/static/description/hrms-demo.png differ diff --git a/hr_resignation/static/description/hrms.ico b/hr_resignation/static/description/hrms.ico new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_resignation/static/description/hrms.ico differ diff --git a/hr_resignation/static/description/icon.png b/hr_resignation/static/description/icon.png new file mode 100755 index 00000000..94d72614 Binary files /dev/null and b/hr_resignation/static/description/icon.png differ diff --git a/hr_resignation/static/description/index.html b/hr_resignation/static/description/index.html new file mode 100755 index 00000000..2e5a8463 --- /dev/null +++ b/hr_resignation/static/description/index.html @@ -0,0 +1,346 @@ + +
    +
    +

    + Employee Resignation +

    +

    + Easily create, manage, and track employee resignations. +

    +
    + Cybrosys Technologies +
    + +
    + cybrosys technologies +
    +
    +
    +
    + + +
    +
    +

    + Overview +

    +

    + Employee Resignation is a component of Open HRMS suit. This module manages employee resignation process. + Employee can fill and send resignation request from their portal and higher level officers can take + appropriate actions on it. +

    +
    +
    +

    + Configuration +

    +

    + No additional configuration is required. +

    +
    +
    + +
    +
    +

    + Features +

    +
    +
    + Employee will create his/her resignation request
    + Higher level officers can approve or reject the request
    +
    +
    +
    +
    + + +
    +
    +

    + Screenshots +

    +

    + + Working of HR resignation module +
    +

    +
    + +
    +
    +
    + + +
    +
    +

    Open HRMS

    +

    Most advanced open source HR management software

    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + cybrosys technologies +
    +
    +
    +

    + Our Services +

    + +
    +
    +
    +
    +

    + Our Industries +

    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Trading + +

    +

    + Easily procure and sell your products. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Manufacturing +

    +

    + Plan, track and schedule your operations. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Restaurant +

    +

    + Run your bar or restaurant methodical. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + POS +

    +

    + Easy configuring and convivial selling. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + E-commerce & Website +

    +

    + Mobile friendly, awe-inspiring product pages. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Hotel Management +

    +

    + An all-inclusive hotel management application. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Education +

    +

    + A Collaborative platform for educational management. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Service Management +

    +

    + Keep track of services and invoice accordingly. +

    +
    +
    +
    +
    +
    +
    + +
    + + diff --git a/hr_resignation/static/description/oh_icon.png b/hr_resignation/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_resignation/static/description/oh_icon.png differ diff --git a/hr_resignation/static/description/open-hrms-resignation.gif b/hr_resignation/static/description/open-hrms-resignation.gif new file mode 100644 index 00000000..c05de027 Binary files /dev/null and b/hr_resignation/static/description/open-hrms-resignation.gif differ diff --git a/hr_resignation/static/description/resignation_web.png b/hr_resignation/static/description/resignation_web.png new file mode 100644 index 00000000..de95a41f Binary files /dev/null and b/hr_resignation/static/description/resignation_web.png differ diff --git a/hr_resignation/views/approved_resignation.xml b/hr_resignation/views/approved_resignation.xml new file mode 100755 index 00000000..b5349752 --- /dev/null +++ b/hr_resignation/views/approved_resignation.xml @@ -0,0 +1,22 @@ + + + + + + Approved Resignation + hr.resignation + form + tree,form + [('state', '=', 'approved')] + +

    Approved Resignation +

    +
    +
    + + +
    +
    + + diff --git a/hr_resignation/views/hr_employee.xml b/hr_resignation/views/hr_employee.xml new file mode 100644 index 00000000..bc128049 --- /dev/null +++ b/hr_resignation/views/hr_employee.xml @@ -0,0 +1,13 @@ + + + + hr.employee.form.view + hr.employee + + + + + + + + \ No newline at end of file diff --git a/hr_resignation/views/resignation_sequence.xml b/hr_resignation/views/resignation_sequence.xml new file mode 100755 index 00000000..65ee9ee4 --- /dev/null +++ b/hr_resignation/views/resignation_sequence.xml @@ -0,0 +1,15 @@ + + + + + + + Open HRMS Resignation + hr.resignation + RES + 3 + + + + + diff --git a/hr_resignation/views/resignation_view.xml b/hr_resignation/views/resignation_view.xml new file mode 100755 index 00000000..d6a61147 --- /dev/null +++ b/hr_resignation/views/resignation_view.xml @@ -0,0 +1,81 @@ + + + + + hr.resignation.tree + hr.resignation + + + + + + + + + + + + + + hr.resignation.form + hr.resignation + + +
    +
    +
    + +
    +

    + +

    +
    + + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    +
    + + Employee Resignation + hr.resignation + form + tree,form + [('state', 'in', ('draft', 'confirm'))] + +

    Employee Resignation Form +

    +
    +
    + + + +
    +
    + + diff --git a/hr_reward_warning/README.md b/hr_reward_warning/README.md new file mode 100755 index 00000000..6a66b187 --- /dev/null +++ b/hr_reward_warning/README.md @@ -0,0 +1,17 @@ +OH Reward/Warning +--------------------- +Supporting Addon for Open HRMS, Managing Official Announcements + +Connect with experts +-------------------- + +If you have any question/queries/additional works on OpenHRMS or this module, You can drop an email directly to Cybrosys. + +Contacts +-------- +info - info@cybrosys.com +Jesni Banu - odoo@cybrosys.com + +Website: +https://www.openhrms.com +https://www.cybrosys.com diff --git a/hr_reward_warning/__init__.py b/hr_reward_warning/__init__.py new file mode 100755 index 00000000..0f9b4903 --- /dev/null +++ b/hr_reward_warning/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models diff --git a/hr_reward_warning/__manifest__.py b/hr_reward_warning/__manifest__.py new file mode 100755 index 00000000..16b12e60 --- /dev/null +++ b/hr_reward_warning/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Official Announcements', + 'version': '12.0.2.0.1', + 'summary': """Managing Official Announcements""", + 'description': 'This module helps you to manage hr official announcements', + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'mail', 'hr'], + 'data': [ + 'security/ir.model.access.csv', + 'security/reward_security.xml', + 'views/hr_announcement_view.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_reward_warning/doc/RELEASE_NOTES.md b/hr_reward_warning/doc/RELEASE_NOTES.md new file mode 100755 index 00000000..7b86d32a --- /dev/null +++ b/hr_reward_warning/doc/RELEASE_NOTES.md @@ -0,0 +1,14 @@ +## Module + +#### 21.04.2018 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Open HRMS Project + +#### 13.03.2019 +#### Version 12.0.2.0.0 +##### UPDT +- Separate sequences for general and other announcements +- Employee/ Department/ Job position wise announcements +- Extra fields in announcement +- Removed the done state from announcement diff --git a/hr_reward_warning/models/__init__.py b/hr_reward_warning/models/__init__.py new file mode 100755 index 00000000..e14076a2 --- /dev/null +++ b/hr_reward_warning/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import hr_warning +from . import hr_employee diff --git a/hr_reward_warning/models/hr_employee.py b/hr_reward_warning/models/hr_employee.py new file mode 100755 index 00000000..a3ea794e --- /dev/null +++ b/hr_reward_warning/models/hr_employee.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from datetime import datetime +from odoo import models, fields, api, _ + + +class HrAnnouncements(models.Model): + _inherit = 'hr.employee' + + @api.multi + def _announcement_count(self): + now = datetime.now() + now_date = now.date() + for rec in self: + ann_ids_general = self.env['hr.announcement'].sudo().search([('is_announcement', '=', True), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + ann_ids_emp = self.env['hr.announcement'].search([('employee_ids', 'in', [rec.id]), + ('announcement_type', '=', 'employee'), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + ann_ids_dep = self.env['hr.announcement'].sudo().search([('department_ids', 'in', [rec.department_id.id]), + ('announcement_type', '=', 'department'), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + ann_ids_job = self.env['hr.announcement'].sudo().search([('position_ids', 'in', [rec.job_id.id]), + ('announcement_type', '=', 'job_position'), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + rec.announcement_count = len(ann_ids_general) + len(ann_ids_emp) + len(ann_ids_dep) + len(ann_ids_job) + + @api.multi + def announcement_view(self): + now = datetime.now() + now_date = now.date() + for rec in self: + ann_ids_general = self.env['hr.announcement'].sudo().search([('is_announcement', '=', True), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + ann_ids_emp = self.env['hr.announcement'].sudo().search([('announcement_type', '=', 'employee'), + ('employee_ids', 'in', [rec.id]), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + ann_ids_dep = self.env['hr.announcement'].sudo().search([('announcement_type', '=', 'department'), + ('department_ids', 'in', [rec.department_id.id]), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + ann_ids_job = self.env['hr.announcement'].sudo().search([('announcement_type', '=', 'job_position'), + ('position_ids', 'in', [rec.job_id.id]), + ('state', 'in', ('approved', 'done')), + ('date_start', '<=', now_date), + ('date_end', '>=', now_date)]) + + ann_obj = ann_ids_general.ids + ann_ids_emp.ids + ann_ids_job.ids + ann_ids_dep.ids + ann_ids = [] + for each in ann_obj: + ann_ids.append(each) + view_id = self.env.ref('hr_reward_warning.view_hr_announcement_form').id + if ann_ids: + if len(ann_ids) > 1: + value = { + 'domain': str([('id', 'in', ann_ids)]), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'hr.announcement', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'name': _('Announcements'), + 'res_id': ann_ids + } + else: + value = { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'hr.announcement', + 'view_id': view_id, + 'type': 'ir.actions.act_window', + 'name': _('Announcements'), + 'res_id': ann_ids and ann_ids[0] + } + return value + + announcement_count = fields.Integer(compute='_announcement_count', string='# Announcements') diff --git a/hr_reward_warning/models/hr_warning.py b/hr_reward_warning/models/hr_warning.py new file mode 100755 index 00000000..fb6c2d80 --- /dev/null +++ b/hr_reward_warning/models/hr_warning.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from datetime import datetime +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError + + +class HrAnnouncementTable(models.Model): + _name = 'hr.announcement' + _description = 'HR Announcement' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char(string='Code No:') + announcement_reason = fields.Text(string='Title', states={'draft': [('readonly', False)]}, required=True, readonly=True) + state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), + ('approved', 'Approved'), ('rejected', 'Refused')], + string='Status', default='draft', + track_visibility='always') + requested_date = fields.Date(string='Requested Date', default=datetime.now().strftime('%Y-%m-%d')) + attachment_id = fields.Many2many('ir.attachment', 'doc_warning_rel', 'doc_id', 'attach_id4', + string="Attachment", help='You can attach the copy of your Letter') + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.user.company_id, readonly=True,) + is_announcement = fields.Boolean(string='Is general Announcement?') + announcement_type = fields.Selection([('employee', 'By Employee'), ('department', 'By Department'), ('job_position', 'By Job Position')]) + employee_ids = fields.Many2many('hr.employee', 'hr_employee_announcements', 'announcement', 'employee', + string='Employees') + department_ids = fields.Many2many('hr.department', 'hr_department_announcements', 'announcement', 'department', + string='Departments') + position_ids = fields.Many2many('hr.job', 'hr_job_position_announcements', 'announcement', 'job_position', + string='Job Positions') + announcement = fields.Html(string='Letter', states={'draft': [('readonly', False)]}, readonly=True) + date_start = fields.Date(string='Start Date', default=fields.Date.today(), required=True) + date_end = fields.Date(string='End Date', default=fields.Date.today(), required=True) + + @api.multi + def reject(self): + self.state = 'rejected' + + @api.multi + def approve(self): + self.state = 'approved' + + @api.multi + def sent(self): + self.state = 'to_approve' + + @api.constrains('date_start', 'date_end') + def validation(self): + if self.date_start > self.date_end: + raise ValidationError("Start date must be less than End Date") + + @api.model + def create(self, vals): + if vals.get('is_announcement'): + vals['name'] = self.env['ir.sequence'].next_by_code('hr.announcement.general') + else: + vals['name'] = self.env['ir.sequence'].next_by_code('hr.announcement') + return super(HrAnnouncementTable, self).create(vals) diff --git a/hr_reward_warning/security/ir.model.access.csv b/hr_reward_warning/security/ir.model.access.csv new file mode 100755 index 00000000..49d676c9 --- /dev/null +++ b/hr_reward_warning/security/ir.model.access.csv @@ -0,0 +1,4 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_hr_employee_reward_admin","hr.employee.reward","model_hr_announcement","hr.group_hr_manager",1,1,1,1 +"access_hr_employee_reward_user","hr.employee.reward.user","model_hr_announcement","hr.group_hr_user",1,1,1,1 +"access_hr_employee_reward_employee","hr.employee.reward.employee","model_hr_announcement","base.group_user",1,0,0,0 diff --git a/hr_reward_warning/security/reward_security.xml b/hr_reward_warning/security/reward_security.xml new file mode 100755 index 00000000..c8f6db1f --- /dev/null +++ b/hr_reward_warning/security/reward_security.xml @@ -0,0 +1,9 @@ + + + + Announcement Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + diff --git a/hr_reward_warning/static/description/HRMS-BUTTON.png b/hr_reward_warning/static/description/HRMS-BUTTON.png new file mode 100755 index 00000000..0f1b65be Binary files /dev/null and b/hr_reward_warning/static/description/HRMS-BUTTON.png differ diff --git a/hr_reward_warning/static/description/announcement_icon.png b/hr_reward_warning/static/description/announcement_icon.png new file mode 100644 index 00000000..b6b97367 Binary files /dev/null and b/hr_reward_warning/static/description/announcement_icon.png differ diff --git a/hr_reward_warning/static/description/banner.jpg b/hr_reward_warning/static/description/banner.jpg new file mode 100755 index 00000000..61924dab Binary files /dev/null and b/hr_reward_warning/static/description/banner.jpg differ diff --git a/hr_reward_warning/static/description/cybro-service.png b/hr_reward_warning/static/description/cybro-service.png new file mode 100755 index 00000000..252929a8 Binary files /dev/null and b/hr_reward_warning/static/description/cybro-service.png differ diff --git a/hr_reward_warning/static/description/cybro_logo.png b/hr_reward_warning/static/description/cybro_logo.png new file mode 100755 index 00000000..bb309114 Binary files /dev/null and b/hr_reward_warning/static/description/cybro_logo.png differ diff --git a/hr_reward_warning/static/description/hr_reward.png b/hr_reward_warning/static/description/hr_reward.png new file mode 100755 index 00000000..184ee961 Binary files /dev/null and b/hr_reward_warning/static/description/hr_reward.png differ diff --git a/hr_reward_warning/static/description/icon.png b/hr_reward_warning/static/description/icon.png new file mode 100755 index 00000000..81e5258c Binary files /dev/null and b/hr_reward_warning/static/description/icon.png differ diff --git a/hr_reward_warning/static/description/index.html b/hr_reward_warning/static/description/index.html new file mode 100755 index 00000000..6c2e64ab --- /dev/null +++ b/hr_reward_warning/static/description/index.html @@ -0,0 +1,348 @@ +
    +
    +

    + Open HRMS Official Announcements +

    +

    + Manages Official Announcements +

    +
    + Cybrosys Technologies +
    + +
    + cybrosys technologies +
    +
    +
    +
    +
    +
    +

    + Overview +

    +

    + This module helps you to manage official announcements. +

    +
    +
    +

    + Configuration +

    +

    + No additional configuration is required. +

    +
    +
    +
    +
    +

    + Features +

    +
    +
    + Manages Official Announcements.
    + Add Attachments to the announcement
    + + + +
    +
    +
    +
    +
    +
    +

    + Screenshots +

    +

    + + Create new announcement and send for approval +
    +

    +
    + +
    +

    + + Employees can view the approved announcement +
    +

    +
    + +
    + +
    +
    + + +
    +
    +

    Open HRMS

    +

    Most advanced open source HR management software

    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + cybrosys technologies +
    +
    +
    +

    + Our Services +

    + +
    +
    +
    +
    +

    + Our Industries +

    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Trading + +

    +

    + Easily procure and sell your products. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Manufacturing +

    +

    + Plan, track and schedule your operations. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Restaurant +

    +

    + Run your bar or restaurant methodical. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + POS +

    +

    + Easy configuring and convivial selling. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + E-commerce & Website +

    +

    + Mobile friendly, awe-inspiring product pages. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Hotel Management +

    +

    + An all-inclusive hotel management application. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Education +

    +

    + A Collaborative platform for educational management. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Service Management +

    +

    + Keep track of services and invoice accordingly. +

    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/hr_reward_warning/static/description/oh_icon.png b/hr_reward_warning/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_reward_warning/static/description/oh_icon.png differ diff --git a/hr_reward_warning/static/description/open-hrms-announcement-1.png b/hr_reward_warning/static/description/open-hrms-announcement-1.png new file mode 100644 index 00000000..7f77752e Binary files /dev/null and b/hr_reward_warning/static/description/open-hrms-announcement-1.png differ diff --git a/hr_reward_warning/static/description/open-hrms-announcement-2.png b/hr_reward_warning/static/description/open-hrms-announcement-2.png new file mode 100644 index 00000000..261155d0 Binary files /dev/null and b/hr_reward_warning/static/description/open-hrms-announcement-2.png differ diff --git a/hr_reward_warning/views/hr_announcement_view.xml b/hr_reward_warning/views/hr_announcement_view.xml new file mode 100755 index 00000000..86c78431 --- /dev/null +++ b/hr_reward_warning/views/hr_announcement_view.xml @@ -0,0 +1,156 @@ + + + + + + Announcement + hr.announcement.general + GA + + + + + Announcement + hr.announcement + AN + + + + + hr.announcement.form + hr.announcement + +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    +
    + + + hr.announcement.tree + hr.announcement + + + + + + + + + + + hr.announcement.search + hr.announcement + + + + + + + + + + + + + + + + + Announcements + hr.announcement + form + tree,form + + +

    + Click to Create a New Record. +

    +
    +
    + + + + + + + hr.employee.form.inherit.view + hr.employee + + +
    + +
    +
    +
    +
    +
    diff --git a/hr_theme/README.md b/hr_theme/README.md new file mode 100644 index 00000000..c4b101b7 --- /dev/null +++ b/hr_theme/README.md @@ -0,0 +1,44 @@ +Open HRMS Theme +=============== + +Theme for Open HRMS. + +Depends +======= +[web] addon Odoo + +Tech +==== +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developers: v11 - Avinash Nk + v11 -Sanjith Rashin + v12 - Milind Mohan P + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_theme/__init__.py b/hr_theme/__init__.py new file mode 100644 index 00000000..23750fee --- /dev/null +++ b/hr_theme/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Avinash Nk () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### diff --git a/hr_theme/__manifest__.py b/hr_theme/__manifest__.py new file mode 100644 index 00000000..b813f5bc --- /dev/null +++ b/hr_theme/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Avinash Nk () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Open HRMS Theme', + 'version': '12.0.1.0.0', + 'summary': """Curtain Raiser of Open HRMS.""", + 'description': """Open HRMS all set in new colour theme of blues and whites totaling to a new experience""", + 'category': 'Themes', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['web', 'web_responsive'], + 'data': [ + 'views/open_hrms_theme.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_theme/doc/RELEASE_NOTES.md b/hr_theme/doc/RELEASE_NOTES.md new file mode 100644 index 00000000..495bbcf3 --- /dev/null +++ b/hr_theme/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.03.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Open Hrms Project diff --git a/hr_theme/static/description/HRMS-BUTTON.png b/hr_theme/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/hr_theme/static/description/HRMS-BUTTON.png differ diff --git a/hr_theme/static/description/banner.jpg b/hr_theme/static/description/banner.jpg new file mode 100644 index 00000000..367c38d2 Binary files /dev/null and b/hr_theme/static/description/banner.jpg differ diff --git a/hr_theme/static/description/cybro-service.png b/hr_theme/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/hr_theme/static/description/cybro-service.png differ diff --git a/hr_theme/static/description/cybro_logo.png b/hr_theme/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/hr_theme/static/description/cybro_logo.png differ diff --git a/hr_theme/static/description/icon.png b/hr_theme/static/description/icon.png new file mode 100644 index 00000000..e41f5650 Binary files /dev/null and b/hr_theme/static/description/icon.png differ diff --git a/hr_theme/static/description/index.html b/hr_theme/static/description/index.html new file mode 100644 index 00000000..1162bef5 --- /dev/null +++ b/hr_theme/static/description/index.html @@ -0,0 +1,319 @@ +
    +
    +

    + Open HRMS Theme +

    +

    + Theme for OHRMS +

    +
    + Cybrosys Technologies +
    + +
    + cybrosys technologies +
    +
    +
    +
    + +
    +
    +

    + Overview +

    +

    + Blessed are they who see beautiful things in humble places. Head to new Open HRMS website all set in blue + and white color tone giving visual bliss to the eyes and its redefined user interface ensuring a clear and concise outlook on human resource. +

    +
    +
    + +
    +
    +

    + Kanban View +

    + +
    + +
    +

    + Form View +

    + +
    + +
    +
    +
    +
    +
    +

    Open HRMS

    +

    Most advanced open source HR management software

    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + cybrosys technologies +
    +
    +
    +

    + Our Services +

    + +
    +
    +
    +
    +

    + Our Industries +

    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Trading + +

    +

    + Easily procure and sell your products. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Manufacturing +

    +

    + Plan, track and schedule your operations. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Restaurant +

    +

    + Run your bar or restaurant methodical. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + POS +

    +

    + Easy configuring and convivial selling. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + E-commerce & Website +

    +

    + Mobile friendly, awe-inspiring product pages. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Hotel Management +

    +

    + An all-inclusive hotel management application. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Education +

    +

    + A Collaborative platform for educational management. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Service Management +

    +

    + Keep track of services and invoice accordingly. +

    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/hr_theme/static/description/open_hrms_theme.png b/hr_theme/static/description/open_hrms_theme.png new file mode 100644 index 00000000..7bc04845 Binary files /dev/null and b/hr_theme/static/description/open_hrms_theme.png differ diff --git a/hr_theme/static/description/open_hrms_theme_form.png b/hr_theme/static/description/open_hrms_theme_form.png new file mode 100644 index 00000000..d54ad517 Binary files /dev/null and b/hr_theme/static/description/open_hrms_theme_form.png differ diff --git a/hr_theme/static/src/css/theme_hr_front.css b/hr_theme/static/src/css/theme_hr_front.css new file mode 100644 index 00000000..e84bd4fd --- /dev/null +++ b/hr_theme/static/src/css/theme_hr_front.css @@ -0,0 +1,80 @@ +.navbar-light .navbar-nav .show > .nav-link, .navbar-light .navbar-nav .active > .nav-link, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .nav-link.active { + color: #fff !important; + font-weight: bold !important; +} + +.o_main_navbar > ul > li > a:hover, .o_main_navbar > ul > li > label:hover { + background-color: ##023163 !important; +} + +.navbar-light { + + background-color: #00438a !important; + +} + +.nav-link{ + color:#fff !important; +} +.dropdown-item { + color: #00438a !important; +} +.btn-info { + color: #fff !important; + background-color: #17a2b8; + border-color: #17a2b8; +} +.dropdown-item { + color: #00438a !important; +} + +.dropdown-menu { + background-color: #FFF !IMPORTANT; +} + +.oe_kanban_action_a { + color: #fff !important; +} + +.o_main_navbar { + border: 1px solid #fff !important; + background-color: #fff !important; + -webkit-box-shadow: 0px 0px 8px #00438a !important; + box-shadow: 0px 0px 8px #00438a !important; +} +.o_main_navbar{ + color: white; + background-color: #014389 !important; + border-color: #014389 !important; +} +.o_main_navbar > ul > li > a:hover { + background-color: #023163 !important; +} +.o_tooltip.bottom::before { + border-bottom-color: #014389 !important; +} +.o_tooltip::after { + border-color: #014389 !important; + background: radial-gradient(#014389, #03366d) !important; +} +.o_tooltip { + border: 2px solid #014389 !important; + background-color: #7c7bad;transition: width 133ms ease 0ms, height 133ms ease 0ms, margin 133ms ease 0ms, border-radius 133ms ease 66ms; +} +#oe_main_menu_navbar .o_menu_systray a[data-action="edit"], #oe_main_menu_navbar .o_menu_systray a[data-action="translate"] { + color: #ffffff; + background-color: #014389 !important; + border-color: #014389 !important; +} +#web_editor-top-edit form.navbar-form .btn.btn-primary { + background-color: #00438b !important; + border-color: #00438b !important; +} +body .modal.o_technical_modal .btn:not(.o_btn_preview).btn-primary{ +background-color: #002144 !important; +border-color: #002144 !important; +} + +.o_affix_enabled > .navbar.navbar-expand-md.navbar-light.bg-light { + background-color: #00438a !important; +} \ No newline at end of file diff --git a/hr_theme/static/src/css/theme_sub_menu.css b/hr_theme/static/src/css/theme_sub_menu.css new file mode 100644 index 00000000..02e81571 --- /dev/null +++ b/hr_theme/static/src/css/theme_sub_menu.css @@ -0,0 +1,723 @@ +.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { + color: #00438a !important; + background-color: #fff !important; + border-color: #dee2e6 #dee2e6 #fff; + border-bottom: 1px solid #fff !important; +} +.o_form_view .oe_button_box .oe_stat_button:hover { + + background-color: #e6e6e6 !important; + +} +.o_form_view .oe_button_box.o_full .o_dropdown_more { + + position: absolute; + top: 100%; + left: auto; + bottom: auto; + right: auto; + min-width: 0; + padding: 0px; + +} + +.navbar-light { + + background-color: #00438a !important; + +} + +.o_field_widget.o_field_many2manytags .badge .o_badge_text { + + color: #4c4c4c !important; +} +.o_mail_systray_item .o_mail_systray_dropdown .o_no_activity { + color: grey !important; +} + +.o_mail_systray_item .o_mail_systray_dropdown .o_activity_filter_button { + padding: 2px; + color: grey !important; +} + +.o_field_widget.o_field_many2manytags .badge a { + color: inherit !important; +} + +.o_form_view .oe_button_box .oe_stat_button .o_stat_info .o_stat_text, .o_form_view .oe_button_box .oe_stat_button > span .o_stat_text { + font-size: small; + color: #4c4c4c; +} + +.nav-tabs .nav-link, .nav-tabs .nav-item.show .nav-link:hover { + color: #fff !important; +} +.nav-tabs .nav-link, .nav-tabs .nav-item.show .nav-link { + color: #00438a !important; + background-color: #fff; + border-bottom: 1px solid #dee2e6 !important; + +} + +.o_mail_systray_item .o_mail_systray_dropdown .o_mail_systray_dropdown_top .o_filter_button, .o_mail_systray_item .o_mail_systray_dropdown .o_mail_systray_dropdown_top .o_new_message { + + padding: 5px; + color: white !important; + +} + +.o_searchview .o_searchview_facet .o_searchview_facet_label { + background-color: #00438a !important; +} +.o_thread_window .o_thread_window_header { + color: white; + background-color: #00438a !important; +} +.badge{ + color:white !important; +} + +.o_user_menu.show > .dropdown-menu.show { + margin-left: -37px !important; +} +.o_mail_preview.o_preview_unread { + background-color: #2e69ab !important; + color: white !important; +} + +.o_loading { + background-color: #00438a !important; +} + +.o_mail_discuss .o_mail_discuss_sidebar .o_mail_discuss_item.o_active { + background-color: #212529; + box-shadow: inset 3px 0 0 #00438a !important; +} + + +.o_thread_window .o_thread_window_header +.o_thread_window_buttons .o_thread_window_close, +.o_thread_window +.o_thread_window_header .o_thread_window_buttons +.o_thread_window_expand { + color: white !important; +} + +.o_main_navbar > ul > li > a:hover, .o_main_navbar > ul > li > label:hover { + background-color: #26b587 !important; + color: #fff !important; +} +.o_main_navbar > .o_menu_brand:hover { + background-color: transparent !important; +} +.nav-link{ + color:#fff !important; +} +.dropdown-item { + color: #00438a !important; +} +.btn-info { + color: #fff !important; + background-color: #17a2b8; + border-color: #17a2b8; +} +.dropdown-item { + color: #fff !important; +} +.dropdown-menu { + background-color: #00438b !IMPORTANT; +} +.o_menu_apps .dropdown-menu.show { + height: calc(99.9vh - 46px); + width: 99.9vw; + background-color: #fff !important; + +} + + +.o_menu_apps .dropdown-menu.show > .dropdown-item{ + color: #00438b !important; +} +.o_menu_apps .dropdown-menu.show > .dropdown-item:hover{ + color: #00438b !important; + background-color: #e9ecef !important; +} +.o_main_navbar > ul > li > a, .o_main_navbar > ul > li > label { + color: #00438a !important; + line-height: 46px; +} +.o_main_navbar > .o_menu_brand { + display: block; + float: left; + margin-right: 35px; + user-select: none; + color: #4c4c4c !important; + font-size: 22px; + font-weight: 500; + line-height: 46px; + cursor: pointer; +} + + + +.oe_secondary_menu_section a { + color: #ffffff !important; +} +.o_sub_menu_content{ + background: #00438b; +} +.oe_kanban_action_button{ + background: #01448b; +} +.oe_kanban_action_a{ + color: #00438b !important; +} +.btn.btn-secondary.btn-sm.float-right.oe_kanban_action.oe_kanban_action_a{ + color: #00438b !important; + +} + +.o_tooltip{ + background: #00438b !important; + border: 2px solid #00438b !important; +} +.nav-pills > li.active > a:focus { + color: #377ab6 !important; + +} +.o_web_client > .o_main .o_sub_menu .o_sub_menu_content .oe_secondary_submenu > li:not(.active) > a { + color: #ffffff !important; +} + +.oe_secondary_menu_section{ + color: white !important; +} +.oe_secondary_menu_section a:focus{ + color: #00438b !important; +} +.o_kanban_manage_toggle_button{ + color: #01448b; !important; +} +.nav > li > a:hover, .nav > li > a:focus { + text-decoration: none; + background-color: #00346b !IMPORTANT; +} +.dropdown-menu > li > a { + color: #ffffff !IMPORTANT; +} + +.dropdown-menu > li > a:focus{ + background-color: #00346b !IMPORTANT; +} +.o_project_kanban_box{ + background-color: #01448b !IMPORTANT; +} +.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { + text-decoration: none; + color: #fff; + background-color: #00346b !important; +} + + +.show .dropdown-menu .dropdown-header { + color: white !important; + background-color: #a8a8a8 !important; + font-weight: bold; +} + +.o_main_navbar .show .dropdown-toggle { + background-color: #e7e7e7 !important; + color: #00438a !important; +} + +.dropdown-item:hover, .dropdown-item:focus { + color: #fff !important; + text-decoration: none; + background-color: #26b587 !important; +} + +.btn-primary:hover, .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { + color: #ffffff !important; + background-color: #26b587 !important; + border-color: #26b587 !important; +} + +.o_tooltip.bottom::before { + border-bottom-color: #00438b !important; +} +.o_tooltip::after { + content: ""; + position: absolute; + top: -2px; + left: -2px; + bottom: -2px; + right: -2px; + border-color: #00438b !important; + border-radius: 50%; + transition: margin 133ms ease 0ms, border-radius 200ms linear 0s; + background: radial-gradient(#2d7bbd, #00438b) !important; +} +.o_tooltip > .o_tooltip_content { + color: white !important; +} +.o_tooltip > .o_tooltip_content .o_skip_tour { + color: #cacaca !important; +} +.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { + color: #377ab6 !important; + background-color: #00346b !important; + +} +.oe_menu_text:focus { + color: #377ab6 !important; +} + +.o_kanban_view.o_kanban_dashboard.o_salesteam_kanban .o_sales_dashboard > div > table > tbody > tr > td.o_main { + background-color: #01448b !important; +} +.o_kanban_view.o_kanban_dashboard.o_kanban_ungrouped .o_kanban_card_header .o_kanban_card_header_title .o_primary, .o_kanban_view.o_kanban_dashboard.o_kanban_grouped .o_kanban_card_header .o_kanban_card_header_title .o_primary { + color: #01448b !important; + font-weight: 700; +} +.o_tooltip.right::before, .o_tooltip.left::before { + border-right-color: #00438b; +} +.o_kanban_view.o_kanban_dashboard.o_kanban_ungrouped a, .o_kanban_view.o_kanban_dashboard.o_kanban_grouped a { + color: #9ea2a7 !important; +} +.o_progressbar .o_progress .o_progressbar_complete { + background-color: #01448b !important; + height: 100%; +} +.o_kanban_view.o_kanban_dashboard.o_salesteam_kanban .o_sales_dashboard > div > table > tbody > tr > td.o_main a { + color: white !important; +} +.o_kanban_view.o_kanban_dashboard.o_salesteam_kanban .o_sales_dashboard > div > table > tbody > tr > td.o_warning a { + color: white !important; +} +a { + color: #01448b; +} +.o_web_client > .o_main .o_sub_menu .o_sub_menu_content .oe_secondary_menu_section { + padding-top: 8px; +} +.oe_highlight { + color: #ffffff; + background-color: #01448b; + border-color: #01448b; +} +.o_control_panel .breadcrumb > li > a { + color: #01448b; + cursor: pointer; +} +.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { + color: #ffffff; +} +.oe_highlight:hover { + color: #ffffff; + background-color: #00438b; + border-color: #00438b; +} +.o_form_view ul.oe_form_status_clickable li.oe_active:hover > .arrow span { + background: -webkit-gradient(linear, left top, right bottom, from(#01448b), to(#01448b)); +} +.o_form_view ul.oe_form_status_clickable li.oe_active:hover { + background-image: linear-gradient(to bottom, #01448b, #01448b); +} +.o_form_view.o_form_readonly .o_form_uri:first-line { + color: #01448b; +} +.navbar-inverse { + background-color: #01448b !important; + border-color: #083a6f !important; +} +.navbar-inverse .navbar-nav > li > a { + color: #ffffff !important; +} +.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #00346b !important; +} +.o_kanban_view.o_kanban_dashboard.o_salesteam_kanban .o_sales_dashboard > div > table > tbody > tr > td.o_warning { + background-color: #00c390; +} +.o_web_client > .o_main .o_sub_menu .o_sub_menu_logo { + background: #fff !important; +} +.o_kanban_view.o_kanban_dashboard.o_salesteam_kanban .o_sales_dashboard > div > table > tbody > tr > td.o_warning:hover { + background-color: #099470 !important; +} +.o_kanban_view.o_kanban_ungrouped { + background: #fff !important; +} +.o_kanban_view.o_kanban_dashboard.o_kanban_ungrouped .o_kanban_card_header, .o_kanban_view.o_kanban_dashboard.o_kanban_grouped .o_kanban_card_header { + background-color: #f1f1f1 !important; +} +::-webkit-scrollbar-track +{ + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3) !important; + border-radius: 10px !important; + background-color: #F5F5F5 !important; +} +::-webkit-scrollbar +{ + width: 8px !important; + background-color: #F5F5F5 !important; +} + +::-webkit-scrollbar-thumb +{ + border-radius: 10px !important; + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3) !important; + background-color: #1b5ea7 !important; +} +.o_tooltip.active.bottom::after { + border-width: 0 !important; +} +.o_searchview .o_searchview_autocomplete li.o-selection-focus { + background-color: #00346b !important; +} +.o_mail_chat .o_mail_chat_sidebar .o_mail_chat_channel_item.o_active { + background-color: #00346b !important; +} +.o_mail_chat .o_mail_chat_sidebar { + background-color: #245284 !important; + color: #ffffff !important; +} +.o_mail_chat .o_mail_chat_sidebar .o_mail_chat_channel_item:hover { + background-color: #00346b !important; +} +.o_mail_chat .o_mail_chat_content .o_chat_composer { + border-top: 1px solid #dadada !important; + background-color: #d6d6d6 !important; +} +.o_form_view.o_form_readonly .o_form_uri:hover:first-line { + color: #00346b !important; +} +.o_form_view .oe_button_box .oe_stat_button .o_button_icon { + color: #00c390 !important; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #00438b14 !important; + border: none !important; +} + +.o_form_view ul.oe_form_status li.oe_active, .o_form_view ul.oe_form_status_clickable li.oe_active { + background-color: #00438b; + background-image: -webkit-gradient(linear, left top, left bottom, from(#0067d6), to(#00438b)) !important; + background-image: -webkit-linear-gradient(top, #004998, #0065d2) !important; + background-image: -moz-linear-gradient(top, #abaaca, #555487) !important; + background-image: -ms-linear-gradient(top, #abaaca, #555487) !important; + background-image: -o-linear-gradient(top, #abaaca, #555487) !important; + background-image: linear-gradient(to bottom, #0066d4, #004691) !important; +} +.o_form_view ul.oe_form_status li.oe_active > .arrow span, .o_form_view ul.oe_form_status_clickable li.oe_active > .arrow span { + background-color: #004793; + background: -moz-linear-gradient(135deg, #555487, #abaaca) !important; + background: -o-linear-gradient(135deg, #abaaca, #555487) !important; + background: -webkit-gradient(linear, left top, right bottom, from(#0065d2), to(#00448e)) !important; + background: -ms-linear-gradient(top, #abaaca, #555487) !important; +} +.oe_kanban_action_a { + color: #ffffff !important; +} +.nav .nav-tabs li a:hover { + color: #ffffff; +} + +.o_menu_apps .dropdown-menu.show .o-menu-search-result { + color: #00438b !important; +} +.o_web_client { + background-color: #ffffff !important; +} +.nav-tabs > li.active > a { + color: #00438b !important; +} +.nav-tabs > li.active > a:focus{ + color: #ffffff !important; +} +.nav > li > a:hover { + text-decoration: none; + background-color: #00346b !IMPORTANT; + color: #fff !important; +} +.o_form_view .o_form_required.o_form_input, .o_form_view .o_form_required .o_form_input, .o_form_view .o_form_required.o_form_textarea, .o_form_view .o_form_required .o_form_textarea { + background-color: #bbd9f9 !important; +} +.o_form_view .oe_link { + color: #01448b !important; + font-weight: normal; + border-radius: 0; +} +.o_form_view .o_horizontal_separator { + color: #01448b; + font-weight: bold; +} +.o_calendar_container .o_calendar_sidebar_container .ui-datepicker table .ui-state-active { + background: none; + background-color: #01448b !important; + color: #ffffff !important; +} +.o_calendar_container .o_calendar_sidebar_container .ui-datepicker table .ui-state-default { + color: #01448b; +} +a:hover { + color: #002042 !important; +} +.o_mail_navbar_item .o_mail_navbar_dropdown .o_mail_navbar_dropdown_channels .o_mail_channel_preview .o_channel_info .o_channel_title .o_channel_name { + color: #ffffff !important; +} +.o_mail_navbar_item .o_mail_navbar_dropdown .o_mail_navbar_dropdown_top .o_filter_button:hover, .o_mail_navbar_item .o_mail_navbar_dropdown .o_mail_navbar_dropdown_top .o_filter_button.o_selected { + color: white !important; +} +.o_mail_navbar_item .o_mail_navbar_dropdown .o_mail_navbar_dropdown_channels .o_mail_channel_preview:hover { + background-color: #00346b !important; +} +.o_form_view .oe_button_box .oe_stat_button .o_stat_info .o_stat_value { + color: #4c4c4c !important; +} +.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { + background-color: #002e5f !important; +} +.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { + background-color: #002e5f; +} +.o_web_settings_dashboard .o_web_settings_dashboard_col .o_web_settings_dashboard_planner .o_web_settings_dashboard_progress_title { + color: #01448b !important; +} +.progress-bar { + background-color: #01448b; +} +.o_web_client > .o_main .o_sub_menu .o_sub_menu_content .oe_secondary_submenu .oe_menu_toggler:before { + border-left: 4px solid #ffffff !important; +} +.oe_secondary_menu_section a:focus { + color: #002042 !important; + font-weight: 900; +} +.ui-autocomplete .ui-menu-item.ui-state-focus { + background-color: #01448b; +} +a { + color:#00438b !important; +} +.oe_tooltip_string { + background-color: #00c390 !important; +} +.oe_secondary_menu_section.active { + color: #377ab6; +} +.o_web_client > .o_main .o_sub_menu .o_sub_menu_footer { + background: #f0eeee !important; +} +.o_sub_menu_footer img { + width: 79% !important; +} +.o_chat_window { + border: none !important; + box-shadow: 2px 14px 32px 5px rgba(0, 0, 0, 0.02), 0 3px 13px 0px rgba(0, 0, 0, 0.35); +} +.o_chat_window .o_chat_header { + background-color: #00438b !important; +} +.o_chat_window .o_chat_header .o_chat_window_close { + color: white !important; + padding: 3px; + margin-left: 5px; +} +.o_chat_window .o_chat_header .o_chat_window_close:hover { + background-color: #00346b !important; +} +.datepicker-days thead { + background-color: #00438b !important; +} +.bootstrap-datetimepicker-widget td.day { + color: #fff !important; +} +.bootstrap-datetimepicker-widget td.cw { + color: #bbbbbb !important; +} +.datepicker .table-condensed > tbody > tr > td.active, .datepicker .table-condensed > tbody > tr > td .active { + background-color: #00254c !important; +} +.datepicker .table-condensed > tbody > tr > td.today:before { + border-bottom-color: #00254c !important; +} +.bootstrap-datetimepicker-widget td.day:hover, .bootstrap-datetimepicker-widget td.hour:hover, .bootstrap-datetimepicker-widget td.minute:hover, .bootstrap-datetimepicker-widget td.second:hover { + background: #00254c !important; +} +.datepicker .table-condensed > thead > tr:last-child { + color: #00438b !important; + background-color: #ffffff !important; +} +.o_form_view ul.oe_form_status_clickable li > .label { + color: #00438b !important; +} +.o_form_view ul.oe_form_status li.oe_active > .label, .o_form_view ul.oe_form_status_clickable li.oe_active > .label { + color: white !important; + text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4; +} +.oe_secondary_menu_section.active a { + color: #001f40 !important; +} +.datepicker .table-condensed > thead > tr:first-child th:hover { + color: white; + background-color: #00346b !important; +} +.bootstrap-datetimepicker-widget td span { + color: #fff !important; +} +.bootstrap-datetimepicker-widget td span:hover { + background: #00254c !important; +} +.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset, .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset { + color: #fff; +} +.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-palette-title, .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title { + color: #fff; +} +.note-color-palette h6 { + color: #fff; +} +.note-color.btn-group .fa { + background: #02448b !important; +} +ul#ui-id-7 a:hover { + color: #fff !important; +} +.o_control_panel .o_cp_sidebar .o_hidden_input_file .o_form_binary_form span { + padding: 3px 25px; + color: #ffffff !important; +} +.o_control_panel .o_cp_sidebar .o_hidden_input_file .o_form_binary_form:hover { + background-color: #00346b !important; +} +.o_search_options .o_favorites_menu .o_save_name { + color: #fff !important; +} +.oe_view_nocontent .oe_view_nocontent_create:before { + background: transparent url(/hr_theme/static/src/img/arrow.png) no-repeat 0px 0px !important; +} +.o_mail_chat .o_mail_annoying_notification_bar { + background-color: #00c390 !important; + border-bottom: 1px solid #00c390 !important; +} +.o_main_navbar { + border: 1px solid #fff !important; + background-color: #fff !important; +} +.fa-external-link { + color: #01448b !important; + border-color: #ffffff !important; + background: #ffffff !important; +} +.ui-menu-item a:hover,.ui-menu-item a:focus { + color: #ffffff !important; +} +.ui-autocomplete .ui-menu-item.ui-state-focus a{ + color: #ffffff !important; +} + +.o_dashboards .o_website_dashboard div.o_box h2 { + color: #01448b !important; +} +.o_form_view .o_form_field_image .o_form_image_controls { + background-color: #01448b; +} + +.oe_highlight:active:hover, .oe_highlight.active:hover, .open > .dropdown-toggle.oe_highlight:hover, .oe_highlight:active:focus, .oe_highlight.active:focus, .open > .dropdown-toggle.oe_highlight:focus, .oe_highlight:active.focus, .oe_highlight.active.focus, .open > .dropdown-toggle.oe_highlight.focus { + color: #ffffff; + background-color: #01448b !important; + border-color: #01448b !important; +} + +.btn.btn-sm.oe_highlight:active, .btn.btn-sm.oe_highlight:focus { + background-color: #00346b !important; + border-color: #00346b !important; +} +button.btn.btn-primary.btn-sm.o_form_button_edit { + background-color: #01448b !important; + border-color: #01448b !important; +} +.o_form_view .o_form_statusbar > .o_statusbar_status > .o_arrow_button.btn-primary.disabled { + color: #01448b !important; +} +button.btn.btn-primary.btn-sm.o_list_button_add { + background-color: #01448b !important; + border-color: #01448b !important; +} +button.btn.btn-primary.btn-sm.o_form_button_save { + background-color: #01448b !important; + border-color: #01448b !important; +} +.o_required_modifier.o_input{ + background-color: #aad3ff !important; +} +button.btn.btn-primary.btn-sm.o-kanban-button-new { + background-color: #00438b !important; + border-color: #00438b !important; +} +.o_required_modifier .o_input { + background-color: #aad3ff !important; +} +.oe_highlight { + background-color: #7c7bad; + border-color: #7c7bad; + color: #ffffff; + background-color: #00438b !important; + border-color: #00438b !important; +} +.btn-primary { + color: #ffffff !important; + background-color: #1b5ca4; + border-color: #19579a; +} + +.btn-default { + color: #a59393; +} +.o_dashboards .o_website_dashboard .o_dashboard_common .o_inner_box.o_primary, .o_dashboards .o_website_dashboard .o_dashboard_common .o_inner_box.o_apps { + background-color: #00438b !important; +} +.label-primary { + background-color: #00438b; +} +.o_mail_navbar_item .o_mail_navbar_dropdown .o_no_activity { + color: #fff !important; + opacity: 1; +} +.o_mail_channel_preview { + background-color: #2e69ab; +} +.o_mail_navbar_item .o_mail_navbar_dropdown .o_mail_navbar_dropdown_channels .o_mail_channel_preview:hover { + background-color: #2e69ab !important; +} +.nav-tabs > li.active > a:focus{ + color: #ffffff !important; +} +.nav-tabs > li.active > a:focus { + background-color: #ffffff !important; + color: #01448b !important; +} +.btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #0a61bd; + border-color: #0a61bd; +} +.btn-primary:focus, .btn-primary.focus { + color: #ffffff; + background-color: #00438b !important; + border-color: #00438b !important; +} +.o_tooltip.active.right::before { + left: -10px; + border-right-color: #00438b; +} +.o_tooltip::after { + border-color: transparent !important; +} + +.alert.alert-warning.clearfix > .btn.btn-link{ + color: #555487 !important; +} \ No newline at end of file diff --git a/hr_theme/static/src/img/arrow.png b/hr_theme/static/src/img/arrow.png new file mode 100644 index 00000000..eb683031 Binary files /dev/null and b/hr_theme/static/src/img/arrow.png differ diff --git a/hr_theme/static/src/img/favicon.ico b/hr_theme/static/src/img/favicon.ico new file mode 100644 index 00000000..a2e22879 Binary files /dev/null and b/hr_theme/static/src/img/favicon.ico differ diff --git a/hr_theme/static/src/img/open_hrms_logo.png b/hr_theme/static/src/img/open_hrms_logo.png new file mode 100644 index 00000000..a462223d Binary files /dev/null and b/hr_theme/static/src/img/open_hrms_logo.png differ diff --git a/hr_theme/static/src/img/powered_by.png b/hr_theme/static/src/img/powered_by.png new file mode 100644 index 00000000..4ff5adb0 Binary files /dev/null and b/hr_theme/static/src/img/powered_by.png differ diff --git a/hr_theme/views/open_hrms_theme.xml b/hr_theme/views/open_hrms_theme.xml new file mode 100644 index 00000000..f2691ac6 --- /dev/null +++ b/hr_theme/views/open_hrms_theme.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hr_vacation_mngmt/README.rst b/hr_vacation_mngmt/README.rst new file mode 100755 index 00000000..6a2fe8d6 --- /dev/null +++ b/hr_vacation_mngmt/README.rst @@ -0,0 +1,35 @@ +OHRMS Vacation Management v12 +============================= +Vacation Management for Open HRMS. + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: v11.0 - Aswani PC @ cybrosys.com, Contact: odoo@cybrosys.com + v12.0 - Kavya Raveendran @ cybrosys.com, Contact: odoo@cybrosys.com + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_vacation_mngmt/__init__.py b/hr_vacation_mngmt/__init__.py new file mode 100644 index 00000000..c7443356 --- /dev/null +++ b/hr_vacation_mngmt/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Aswani PC () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models +from . import wizard diff --git a/hr_vacation_mngmt/__manifest__.py b/hr_vacation_mngmt/__manifest__.py new file mode 100644 index 00000000..63d577a2 --- /dev/null +++ b/hr_vacation_mngmt/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open Hrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Aswani PC () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': "Open HRMS Vacation Management", + 'version': '12.0.1.0.0', + 'summary': """Vacation Management,manages employee vacation""", + 'description': """HR Vacation management""", + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.openhrms.com', + 'category': 'Generic Modules/Human Resources', + 'depends': ['hr_leave_request_aliasing', 'project', 'hr_payroll', 'account'], + 'data': [ + 'security/hr_vacation_security.xml', + 'security/ir.model.access.csv', + 'data/hr_payslip_data.xml', + 'views/hr_reminder.xml', + 'data/hr_vacation_data.xml', + 'wizard/reassign_task.xml', + 'views/hr_employee_ticket.xml', + 'views/hr_vacation.xml', + 'views/hr_payslip.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/hr_vacation_mngmt/data/hr_payslip_data.xml b/hr_vacation_mngmt/data/hr_payslip_data.xml new file mode 100644 index 00000000..68d53475 --- /dev/null +++ b/hr_vacation_mngmt/data/hr_payslip_data.xml @@ -0,0 +1,31 @@ + + + + Leave Salary + + + + + + Leave Salary + LS + + + + none + code + result = categories.BASIC + + + + Leave Salary + LS + + + + none + code + result = categories.BASIC + categories.ALW + + + \ No newline at end of file diff --git a/hr_vacation_mngmt/data/hr_vacation_data.xml b/hr_vacation_mngmt/data/hr_vacation_data.xml new file mode 100644 index 00000000..3bc470c1 --- /dev/null +++ b/hr_vacation_mngmt/data/hr_vacation_data.xml @@ -0,0 +1,31 @@ + + + + + Flight ticket status update + + code + model.run_update_ticket_status() + 1 + days + -1 + + + + + HR Leave Reminder + + code + model.send_leave_reminder() + 1 + days + -1 + + + + + Airlines + True + + + \ No newline at end of file diff --git a/hr_vacation_mngmt/doc/RELEASE_NOTES.md b/hr_vacation_mngmt/doc/RELEASE_NOTES.md new file mode 100644 index 00000000..035f6b3f --- /dev/null +++ b/hr_vacation_mngmt/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 08.05.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/hr_vacation_mngmt/models/__init__.py b/hr_vacation_mngmt/models/__init__.py new file mode 100644 index 00000000..827a1258 --- /dev/null +++ b/hr_vacation_mngmt/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import hr_vacation +from . import hr_payslip +from . import hr_employee_ticket diff --git a/hr_vacation_mngmt/models/hr_employee_ticket.py b/hr_vacation_mngmt/models/hr_employee_ticket.py new file mode 100644 index 00000000..12c9ea54 --- /dev/null +++ b/hr_vacation_mngmt/models/hr_employee_ticket.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- + +from datetime import datetime +from odoo import models, fields, api, _ +from odoo.exceptions import UserError, ValidationError + + +class HrFlightTicket(models.Model): + _name = 'hr.flight.ticket' + + name = fields.Char() + employee_id = fields.Many2one('hr.leave', string='Employee', required=True) + ticket_type = fields.Selection([('one', 'One Way'), ('round', 'Round Trip')], string='Ticket Type', default='round') + depart_from = fields.Char(string='Departure', required=True) + destination = fields.Char(string='Destination', required=True) + date_start = fields.Date(string='Start Date', required=True) + date_return = fields.Date(string='Return Date') + ticket_class = fields.Selection([('economy', 'Economy'), + ('premium_economy', 'Premium Economy'), + ('business', 'Business'), + ('first_class', 'First Class')], string='Class') + ticket_fare = fields.Float(string='Ticket Fare') + flight_details = fields.Text(string='Flight Details') + return_flight_details = fields.Text(string='Return Flight Details') + state = fields.Selection([('booked', 'Booked'), ('confirmed', 'Confirmed'), ('started', 'Started'), + ('completed', 'Completed'), ('canceled', 'Canceled')], string='Status', default='booked') + invoice_id = fields.Many2one('account.invoice', string='Invoice') + leave_id = fields.Many2one('hr.leave', string='Leave') + company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env.user.company_id) + + @api.multi + def name_get(self): + res = [] + for ticket in self: + res.append((ticket.id, _("Flight ticket for %s on %s to %s") % ( + ticket.employee_id.name, ticket.date_start, ticket.destination))) + return res + + @api.constrains('date_start', 'date_return') + def check_valid_date(self): + if self.filtered(lambda c: c.date_return and c.date_start > c.date_return): + raise ValidationError(_('Flight travelling start date must be less than flight return date.')) + + def book_ticket(self): + return {'type': 'ir.actions.act_window_close'} + + def confirm_ticket(self): + if self.ticket_fare <= 0: + raise UserError(_('Please add ticket fare.')) + inv_obj = self.env['account.invoice'].sudo() + expense_account = self.env['ir.config_parameter'].sudo().get_param('travel_expense_account') + if not expense_account: + raise UserError(_('Please select expense account for the flight tickets.')) + domain = [ + ('type', '=', 'purchase'), + ('company_id', '=', self.company_id.id), + ] + journal_id = self.env['account.journal'].search(domain, limit=1) + partner = self.env.ref('hr_vacation_mngmt.air_lines_partner') + if not partner.property_payment_term_id: + date_due = fields.Date.context_today(self) + else: + pterm = partner.property_payment_term_id + pterm_list = \ + pterm.with_context(currency_id=self.env.user.company_id.id).compute( + value=1, date_ref=fields.Date.context_today(self))[0] + date_due = max(line[0] for line in pterm_list) + inv_data = { + 'name': '', + 'origin': 'Flight Ticket', + 'type': 'in_invoice', + 'journal_id': journal_id.id, + 'payment_term_id': partner.property_payment_term_id.id, + 'date_due': date_due, + 'reference': False, + 'partner_id': partner.id, + 'account_id': partner.property_account_payable_id.id, + 'invoice_line_ids': [(0, 0, { + 'name': 'Flight Ticket', + 'price_unit': self.ticket_fare, + 'quantity': 1.0, + 'account_id': expense_account, + })], + } + inv_id = inv_obj.create(inv_data) + inv_id.action_invoice_open() + self.write({'state': 'confirmed', 'invoice_id': inv_id.id}) + + def cancel_ticket(self): + if self.state == 'booked': + self.write({'state': 'canceled'}) + elif self.state == 'confirmed': + if self.invoice_id and self.invoice_id.state == 'paid': + self.write({'state': 'canceled'}) + if self.invoice_id and self.invoice_id.state == 'open': + self.invoice_id.action_invoice_cancel() + self.write({'state': 'canceled'}) + + @api.model + def run_update_ticket_status(self): + run_out_tickets = self.search([('state', 'in', ['confirmed', 'started']), + ('date_return', '<=', datetime.now())]) + confirmed_tickets = self.search([('state', '=', 'confirmed'), ('date_start', '<=', datetime.now()), + ('date_return', '>', datetime.now())]) + for ticket in run_out_tickets: + ticket.write({'state': 'completed'}) + for ticket in confirmed_tickets: + ticket.write({'state': 'started'}) + + @api.multi + def action_view_invoice(self): + return { + 'name': _('Flight Ticket Invoice'), + 'view_mode': 'form', + 'view_id': self.env.ref('account.invoice_supplier_form').id, + 'res_model': 'account.invoice', + 'context': "{'type':'in_invoice'}", + 'type': 'ir.actions.act_window', + 'res_id': self.invoice_id.id, + } diff --git a/hr_vacation_mngmt/models/hr_payslip.py b/hr_vacation_mngmt/models/hr_payslip.py new file mode 100644 index 00000000..ccbc1ccc --- /dev/null +++ b/hr_vacation_mngmt/models/hr_payslip.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields, api, _ + + +class HrPayslip(models.Model): + _inherit = 'hr.payslip' + + leave_salary = fields.Boolean(string='Leave Salary') + + @api.model + def _get_payslip_lines(self, contract_ids, payslip_id): + def _sum_salary_rule_category(localdict, category, amount): + if category.parent_id: + localdict = _sum_salary_rule_category(localdict, category.parent_id, amount) + localdict['categories'].dict[category.code] = category.code in localdict['categories'].dict and localdict['categories'].dict[category.code] + amount or amount + return localdict + + class BrowsableObject(object): + def __init__(self, employee_id, dict, env): + self.employee_id = employee_id + self.dict = dict + self.env = env + + def __getattr__(self, attr): + return attr in self.dict and self.dict.__getitem__(attr) or 0.0 + + class InputLine(BrowsableObject): + """a class that will be used into the python code, mainly for usability purposes""" + def sum(self, code, from_date, to_date=None): + if to_date is None: + to_date = fields.Date.today() + self.env.cr.execute(""" + SELECT sum(amount) as sum + FROM hr_payslip as hp, hr_payslip_input as pi + WHERE hp.employee_id = %s AND hp.state = 'done' + AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s""", + (self.employee_id, from_date, to_date, code)) + return self.env.cr.fetchone()[0] or 0.0 + + class WorkedDays(BrowsableObject): + """a class that will be used into the python code, mainly for usability purposes""" + def _sum(self, code, from_date, to_date=None): + if to_date is None: + to_date = fields.Date.today() + self.env.cr.execute(""" + SELECT sum(number_of_days) as number_of_days, sum(number_of_hours) as number_of_hours + FROM hr_payslip as hp, hr_payslip_worked_days as pi + WHERE hp.employee_id = %s AND hp.state = 'done' + AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s""", + (self.employee_id, from_date, to_date, code)) + return self.env.cr.fetchone() + + def sum(self, code, from_date, to_date=None): + res = self._sum(code, from_date, to_date) + return res and res[0] or 0.0 + + def sum_hours(self, code, from_date, to_date=None): + res = self._sum(code, from_date, to_date) + return res and res[1] or 0.0 + + class Payslips(BrowsableObject): + """a class that will be used into the python code, mainly for usability purposes""" + + def sum(self, code, from_date, to_date=None): + if to_date is None: + to_date = fields.Date.today() + self.env.cr.execute("""SELECT sum(case when hp.credit_note = False then (pl.total) else (-pl.total) end) + FROM hr_payslip as hp, hr_payslip_line as pl + WHERE hp.employee_id = %s AND hp.state = 'done' + AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pl.slip_id AND pl.code = %s""", + (self.employee_id, from_date, to_date, code)) + res = self.env.cr.fetchone() + return res and res[0] or 0.0 + + # we keep a dict with the result because a value can be overwritten by another rule with the same code + result_dict = {} + rules_dict = {} + worked_days_dict = {} + inputs_dict = {} + blacklist = [] + payslip = self.env['hr.payslip'].browse(payslip_id) + for worked_days_line in payslip.worked_days_line_ids: + worked_days_dict[worked_days_line.code] = worked_days_line + for input_line in payslip.input_line_ids: + inputs_dict[input_line.code] = input_line + + categories = BrowsableObject(payslip.employee_id.id, {}, self.env) + inputs = InputLine(payslip.employee_id.id, inputs_dict, self.env) + worked_days = WorkedDays(payslip.employee_id.id, worked_days_dict, self.env) + payslips = Payslips(payslip.employee_id.id, payslip, self.env) + rules = BrowsableObject(payslip.employee_id.id, rules_dict, self.env) + + baselocaldict = {'categories': categories, 'rules': rules, 'payslip': payslips, 'worked_days': worked_days, + 'inputs': inputs} + # get the ids of the structures on the contracts and their parent id as well + contracts = self.env['hr.contract'].browse(contract_ids) + structure_ids = contracts.get_all_structures() + # get the rules of the structure and their children + rule_ids = self.env['hr.payroll.structure'].browse(structure_ids).get_all_rules() + # leave salary computation + if payslip.leave_salary: + leave_sal_basic = self.env.ref('hr_vacation_mngmt.hr_salary_rule_leave_salary_basic') + leave_sal_gross = self.env.ref('hr_vacation_mngmt.hr_salary_rule_leave_salary_gross') + default_leave_salary = self.env['ir.config_parameter'].sudo().get_param('default_leave_salary') + if default_leave_salary == '0': + leave_salary = leave_sal_basic + elif default_leave_salary == '1': + leave_salary = leave_sal_gross + else: + leave_salary = leave_sal_basic + rule_ids.append((leave_salary.id, leave_salary.sequence)) + # run the rules by sequence + sorted_rule_ids = [id for id, sequence in sorted(rule_ids, key=lambda x:x[1])] + sorted_rules = self.env['hr.salary.rule'].browse(sorted_rule_ids) + + for contract in contracts: + employee = contract.employee_id + localdict = dict(baselocaldict, employee=employee, contract=contract) + for rule in sorted_rules: + key = rule.code + '-' + str(contract.id) + localdict['result'] = None + localdict['result_qty'] = 1.0 + localdict['result_rate'] = 100 + # check if the rule can be applied + if rule._satisfy_condition(localdict) and rule.id not in blacklist: + # compute the amount of the rule + amount, qty, rate = rule._compute_rule(localdict) + # check if there is already a rule computed with that code + previous_amount = rule.code in localdict and localdict[rule.code] or 0.0 + # set/overwrite the amount computed for this rule in the localdict + tot_rule = amount * qty * rate / 100.0 + localdict[rule.code] = tot_rule + rules_dict[rule.code] = rule + # sum the amount for its salary category + localdict = _sum_salary_rule_category(localdict, rule.category_id, tot_rule - previous_amount) + # create/overwrite the rule in the temporary results + result_dict[key] = { + 'salary_rule_id': rule.id, + 'contract_id': contract.id, + 'name': rule.name, + 'code': rule.code, + 'category_id': rule.category_id.id, + 'sequence': rule.sequence, + 'appears_on_payslip': rule.appears_on_payslip, + 'condition_select': rule.condition_select, + 'condition_python': rule.condition_python, + 'condition_range': rule.condition_range, + 'condition_range_min': rule.condition_range_min, + 'condition_range_max': rule.condition_range_max, + 'amount_select': rule.amount_select, + 'amount_fix': rule.amount_fix, + 'amount_python_compute': rule.amount_python_compute, + 'amount_percentage': rule.amount_percentage, + 'amount_percentage_base': rule.amount_percentage_base, + 'register_id': rule.register_id.id, + 'amount': amount, + 'employee_id': contract.employee_id.id, + 'quantity': qty, + 'rate': rate, + } + else: + # blacklist this rule and its children + blacklist += [id for id, seq in rule._recursive_search_of_rules()] + + return list(result_dict.values()) + + +class HrPayrollConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + default_leave_salary = fields.Selection([('0', 'Basic'), ('1', 'Gross')], string='Leave Salary', default_model='hr.leave') + + def get_values(self): + res = super(HrPayrollConfigSettings, self).get_values() + res.update( + default_leave_salary=self.env['ir.config_parameter'].sudo().get_param('default_leave_salary') + ) + return res + + def set_values(self): + super(HrPayrollConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param('default_leave_salary', self.default_leave_salary) diff --git a/hr_vacation_mngmt/models/hr_vacation.py b/hr_vacation_mngmt/models/hr_vacation.py new file mode 100644 index 00000000..a92fc359 --- /dev/null +++ b/hr_vacation_mngmt/models/hr_vacation.py @@ -0,0 +1,172 @@ +# -*- coding: utf-8 -*- + +from datetime import datetime, timedelta, date +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class HrLeaveRequest(models.Model): + _inherit = 'hr.leave' + + remaining_leaves = fields.Float(string='Remaining Legal Leaves', related='employee_id.remaining_leaves') + overlapping_leaves = fields.Many2many('hr.leave', compute='get_overlapping_leaves', string='Overlapping Leaves') + pending_tasks = fields.One2many('pending.task', 'leave_id', string='Pending Tasks') + holiday_managers = fields.Many2many('res.users', compute='get_hr_holiday_managers') + flight_ticket = fields.One2many('hr.flight.ticket', 'leave_id', string='Flight Ticket') + double_validation = fields.Boolean('Apply Double Validation', related='holiday_status_id.double_validation') + expense_account = fields.Many2one('account.account') + leave_salary = fields.Selection([('0', 'Basic'), ('1', 'Gross')], string='Leave Salary') + + + @api.one + def get_overlapping_leaves(self): + if self.date_from and self.date_to: + overlap_leaves = [] + from_date = self.date_from + to_date = self.date_to + r = (to_date + timedelta(days=1) - from_date).days + leave_dates = [str(from_date + timedelta(days=i)) for i in range(r)] + leaves = self.env['hr.leave'].search([('state', '=', 'validate'), + ('department_id', '=', self.department_id.id)]) + other_leaves = leaves - self + for leave in other_leaves: + frm_dte = leave.date_from + to_dte = leave.date_to + r = (to_dte + timedelta(days=1) - frm_dte).days + leave_dtes = [str(frm_dte + timedelta(days=i)) for i in range(r)] + if set(leave_dtes).intersection(set(leave_dates)): + overlap_leaves.append(leave.id) + self.update({'overlapping_leaves': [(6, 0, overlap_leaves)]}) + + @api.multi + def action_approve(self): + if not self.env.user.has_group('hr_holidays.group_hr_holidays_user'): + raise UserError(_('Only an HR Officer or Manager can approve leave requests.')) + + manager = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) + for holiday in self: + if holiday.state != 'confirm': + raise UserError(_('Leave request must be confirmed ("To Approve") in order to approve it.')) + + if holiday.pending_tasks: + if holiday.user_id: + ctx = dict(self.env.context or {}) + ctx.update({ + 'default_leave_req_id': self.id, + }) + return { + 'name': _('Re-Assign Task'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'task.reassign', + 'target': 'new', + 'context': ctx, + } + else: + if holiday.double_validation: + return holiday.write({'state': 'validate1', 'manager_id': manager.id if manager else False}) + else: + holiday.action_validate() + + def book_ticket(self): + if not self.env.user.has_group('hr_holidays.group_hr_holidays_user'): + raise UserError(_('Only an HR Officer or Manager can book flight tickets.')) + ctx = dict(self.env.context or {}) + ctx.update({ + 'default_employee_id': self.employee_id.id, + 'default_leave_id': self.id, + }) + return { + 'name': _('Book Flight Ticket'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'view_id': self.env.ref('hr_vacation_mngmt.view_hr_book_flight_ticket_form').id, + 'res_model': 'hr.flight.ticket', + 'target': 'new', + 'context': ctx, + } + + @api.one + def get_hr_holiday_managers(self): + self.holiday_managers = self.env.ref('hr_holidays.group_hr_holidays_manager').users + + def view_flight_ticket(self): + return { + 'name': _('Flight Ticket'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'hr.flight.ticket', + 'target': 'current', + 'res_id': self.flight_ticket[0].id, + } + + @api.model + def send_leave_reminder(self): + leave_request = self.env['hr.leave'].search([('state', '=', 'validate')]) + leave_reminder = self.env['ir.config_parameter'].sudo().get_param('leave_reminder') + reminder_day_before = int(self.env['ir.config_parameter'].sudo().get_param('reminder_day_before')) + mail_template = self.env.ref('hr_vacation_mngmt.email_template_hr_leave_reminder_mail') + holiday_managers = self.env.ref('hr_holidays.group_hr_holidays_manager').users + today = date.today() + if leave_reminder: + for request in leave_request: + if request.date_from: + from_date = request.date_from + if reminder_day_before == 0: + prev_reminder_day = request.date_from + else: + prev_reminder_day = from_date - timedelta(days=reminder_day_before) + if prev_reminder_day == today: + for manager in holiday_managers: + template = mail_template.sudo().with_context( + email_to=manager.email, + ) + template.send_mail(request.id, force_send=True) + + +class PendingTask(models.Model): + _name = 'pending.task' + + name = fields.Char(string='Task', required=True) + leave_id = fields.Many2one('hr.leave', string='Leave Request') + # print("leave_id",leave_id) + dept_id = fields.Many2one('hr.department', string='Department', related='leave_id.department_id') + project_id = fields.Many2one('project.project', string='Project', required=True) + description = fields.Text(string='Description') + assigned_to = fields.Many2one('hr.employee', string='Assigned to', + domain="[('department_id', '=', dept_id)]") + unavailable_employee = fields.Many2many('hr.employee', string='Unavailable Employees', + compute='get_unavailable_employee') + + @api.one + def get_unavailable_employee(self): + unavail_emp = [] + for leave in self.leave_id.overlapping_leaves: + unavail_emp.append(leave.employee_id.id) + self.update({'unavailable_employee': unavail_emp}) + + +class HrVacationConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + leave_reminder = fields.Boolean(string='Leave Reminder Email', help="Send leave remainder emails to hr managers") + reminder_day_before = fields.Integer(string='Reminder Day Before') + default_expense_account = fields.Many2one('account.account', string='Travel Expense Account', default_model='hr.leave') + + def get_values(self): + res = super(HrVacationConfigSettings, self).get_values() + res.update( + leave_reminder=self.env['ir.config_parameter'].sudo().get_param('leave_reminder'), + reminder_day_before=int(self.env['ir.config_parameter'].sudo().get_param('reminder_day_before')), + default_expense_account=int(self.env['ir.config_parameter'].sudo().get_param('travel_expense_account',)) + ) + return res + + def set_values(self): + super(HrVacationConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param('leave_reminder', self.leave_reminder) + self.env['ir.config_parameter'].sudo().set_param('reminder_day_before', self.reminder_day_before) + self.env['ir.config_parameter'].sudo().set_param('travel_expense_account', self.default_expense_account.id) diff --git a/hr_vacation_mngmt/security/hr_vacation_security.xml b/hr_vacation_mngmt/security/hr_vacation_security.xml new file mode 100644 index 00000000..a7bba429 --- /dev/null +++ b/hr_vacation_mngmt/security/hr_vacation_security.xml @@ -0,0 +1,11 @@ + + + + + Hr Flight Ticket Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + \ No newline at end of file diff --git a/hr_vacation_mngmt/security/ir.model.access.csv b/hr_vacation_mngmt/security/ir.model.access.csv new file mode 100644 index 00000000..f041952c --- /dev/null +++ b/hr_vacation_mngmt/security/ir.model.access.csv @@ -0,0 +1,12 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_flight_ticket_user,hr.flight.ticket.user,model_hr_flight_ticket,hr_holidays.group_hr_holidays_user,1,1,1,1 +access_hr_flight_ticket_employee,hr.flight.ticket.employee,model_hr_flight_ticket,base.group_user,1,1,1,1 +access_pending_task_user,pending.task.user,model_pending_task,hr_holidays.group_hr_holidays_user,1,1,1,1 +access_pending_task_employee,pending.task.employee,model_pending_task,base.group_user,1,1,1,1 +access_account_invoice,account.invoice.hr_manager,account.model_account_invoice,hr_holidays.group_hr_holidays_manager,1,0,0,0 +access_account_invoice_tax,account.invoice.tax.hr_manager,account.model_account_invoice_tax,hr_holidays.group_hr_holidays_manager,1,0,0,0 +access_account_move_line,account.move.line.hr_manager,account.model_account_move_line,hr_holidays.group_hr_holidays_manager,1,0,0,0 +access_task_reassign_user,task.reassign.user,model_task_reassign,hr_holidays.group_hr_holidays_user,1,1,1,1 +access_task_group_user,task.reassign.group.user,model_task_reassign,base.group_user,1,1,1,1 +acccess_task_manager,task.reassign.manager,model_task_reassign,hr_holidays.group_hr_holidays_manager,1,1,1,1 + diff --git a/hr_vacation_mngmt/static/description/HRMS-BUTTON.png b/hr_vacation_mngmt/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/hr_vacation_mngmt/static/description/HRMS-BUTTON.png differ diff --git a/hr_vacation_mngmt/static/description/banner.jpg b/hr_vacation_mngmt/static/description/banner.jpg new file mode 100644 index 00000000..beb870c2 Binary files /dev/null and b/hr_vacation_mngmt/static/description/banner.jpg differ diff --git a/hr_vacation_mngmt/static/description/cybro-service.png b/hr_vacation_mngmt/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/hr_vacation_mngmt/static/description/cybro-service.png differ diff --git a/hr_vacation_mngmt/static/description/cybro_logo.png b/hr_vacation_mngmt/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/hr_vacation_mngmt/static/description/cybro_logo.png differ diff --git a/hr_vacation_mngmt/static/description/icon.png b/hr_vacation_mngmt/static/description/icon.png new file mode 100644 index 00000000..cf3082e3 Binary files /dev/null and b/hr_vacation_mngmt/static/description/icon.png differ diff --git a/hr_vacation_mngmt/static/description/index.html b/hr_vacation_mngmt/static/description/index.html new file mode 100644 index 00000000..7ff5eb36 --- /dev/null +++ b/hr_vacation_mngmt/static/description/index.html @@ -0,0 +1,402 @@ +
    +
    +

    + VACATION MANAGEMENT +

    +

    + Manage Employee Vacation +

    +
    + Cybrosys Technologies +
    + +
    + cybrosys technologies +
    +
    +
    +
    + + +
    +
    +

    + Overview +

    +

    + This module extends Odoo default HR Holiday Management with extra features adaptable for managing employees vacation. +

    +
    +
    +

    + Configuration +

    +

    + No additional configuration is required. +

    +
    +
    + + +
    + +
    +

    + Features +

    +
    +
    + Approval of remaining leaves.
    + Overlapping leaves.
    + Leave notification.
    + Leave salary.
    + Pending task update and re-assign task.
    + Vacation travel expense
    + +
    +
    +
    +
    + +
    +
    +

    + Screenshots +

    +

    + + Remaining & Overlapping Leaves
    + While requesting leaves employee will be aware of balance legal leaves for him. +
    +

    +
    + +

    +

    + + Re-assign Pending Tasks of leave requested employee to other person of that department. +
    +

    +
    + +

    +

    + + On leave request approval it opens a wizard to re-assign tasks to available employees. +
    +

    +
    + +

    +

    + + HR managers can able to add the flight ticket details for the employee. +
    +

    +
    + +

    +
    + +

    +
    + +

    +
    + +

    +
    + +

    +

    + + Enabling Leave Salary in the payslip will add the salary for it. +
    +

    +
    + +

    +

    + + Configurations of leave salary can be computed in two ways. +
    +

    +
    + +

    + +
    +
    + +
    +
    +

    Open HRMS

    +

    Most advanced open source HR management software

    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + cybrosys technologies +
    +
    +
    +

    + Our Services +

    + +
    +
    +
    +
    +

    + Our Industries +

    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Trading + +

    +

    + Easily procure and sell your products. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Manufacturing +

    +

    + Plan, track and schedule your operations. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Restaurant +

    +

    + Run your bar or restaurant methodical. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + POS +

    +

    + Easy configuring and convivial selling. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + E-commerce & Website +

    +

    + Mobile friendly, awe-inspiring product pages. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Hotel Management +

    +

    + An all-inclusive hotel management application. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Education +

    +

    + A Collaborative platform for educational management. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Service Management +

    +

    + Keep track of services and invoice accordingly. +

    +
    +
    +
    +
    +
    +
    + +
    + + diff --git a/hr_vacation_mngmt/static/description/oh_icon.png b/hr_vacation_mngmt/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hr_vacation_mngmt/static/description/oh_icon.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-1.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-1.png new file mode 100644 index 00000000..260d5a8e Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-1.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-10.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-10.png new file mode 100644 index 00000000..95e39984 Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-10.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-2.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-2.png new file mode 100644 index 00000000..aa1fe5cb Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-2.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-3.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-3.png new file mode 100644 index 00000000..87b607f9 Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-3.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-4.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-4.png new file mode 100644 index 00000000..5ff28199 Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-4.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-5.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-5.png new file mode 100644 index 00000000..51f9bceb Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-5.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-6.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-6.png new file mode 100644 index 00000000..62470c0a Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-6.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-7.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-7.png new file mode 100644 index 00000000..d2ff95c6 Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-7.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-8.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-8.png new file mode 100644 index 00000000..fb19d62f Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-8.png differ diff --git a/hr_vacation_mngmt/static/description/open-hrms-vacation-management-9.png b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-9.png new file mode 100644 index 00000000..fb19f796 Binary files /dev/null and b/hr_vacation_mngmt/static/description/open-hrms-vacation-management-9.png differ diff --git a/hr_vacation_mngmt/views/hr_employee_ticket.xml b/hr_vacation_mngmt/views/hr_employee_ticket.xml new file mode 100644 index 00000000..21dfe6ee --- /dev/null +++ b/hr_vacation_mngmt/views/hr_employee_ticket.xml @@ -0,0 +1,116 @@ + + + + + hr.flight.ticket.form + hr.flight.ticket + + +
    +
    +
    + +
    + + +
    +
    +

    +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + hr.flight.ticket.form + hr.flight.ticket + + + + + + + + + + + + + + hr.flight.ticket.form + hr.flight.ticket + + +
    +
    +

    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + Flight Tickets + hr.flight.ticket + tree,form + form + + + +
    +
    \ No newline at end of file diff --git a/hr_vacation_mngmt/views/hr_payslip.xml b/hr_vacation_mngmt/views/hr_payslip.xml new file mode 100644 index 00000000..8f85c52d --- /dev/null +++ b/hr_vacation_mngmt/views/hr_payslip.xml @@ -0,0 +1,39 @@ + + + + + hr.payslip.form + hr.payslip + + + + + + + + + + Configure Payroll + res.config.settings + + + +

    Leaves

    +
    +
    +
    +

    Leave Salary

    +
    + Leave salary calculation +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/hr_vacation_mngmt/views/hr_reminder.xml b/hr_vacation_mngmt/views/hr_reminder.xml new file mode 100644 index 00000000..30a71976 --- /dev/null +++ b/hr_vacation_mngmt/views/hr_reminder.xml @@ -0,0 +1,20 @@ + + + + + Leave : Reminder + + + ${object.employee_id.company_id.email} + Reminder: ${object.display_name} + Hello ,

    +

    The employee ${object.employee_id.name} has taken ${object.no_of_days_temp} days leave starting from ${object.date_from} to ${object.date_to}.

    + +

    Kindly do the needful.

    + +

    Thank you!

    +]]>
    +
    +
    +
    \ No newline at end of file diff --git a/hr_vacation_mngmt/views/hr_vacation.xml b/hr_vacation_mngmt/views/hr_vacation.xml new file mode 100644 index 00000000..5ea4d5af --- /dev/null +++ b/hr_vacation_mngmt/views/hr_vacation.xml @@ -0,0 +1,117 @@ + + + + + Leave Request + hr.leave + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pending.task.form + pending.task + +
    + + + + + + + + + + + + + + + +
    +
    +
    + + Configure Leave + res.config.settings + + + +
    +
    + +
    +
    +

    Leaves Reminder

    +
    +

    Send leave remainder emails to holiday managers

    +
    +
    +
    +

    Days Before

    + +
    +
    +
    +
    +
    +
    +

    Flight Ticket

    +
    +
    +

    Expense Account

    + +
    +
    +
    +
    +
    +
    +
    + + hr holidays + hr.leave + + + + + + + +
    +
    \ No newline at end of file diff --git a/hr_vacation_mngmt/wizard/__init__.py b/hr_vacation_mngmt/wizard/__init__.py new file mode 100644 index 00000000..14c06bcd --- /dev/null +++ b/hr_vacation_mngmt/wizard/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import reassign_task diff --git a/hr_vacation_mngmt/wizard/reassign_task.py b/hr_vacation_mngmt/wizard/reassign_task.py new file mode 100644 index 00000000..728ed5b3 --- /dev/null +++ b/hr_vacation_mngmt/wizard/reassign_task.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class ReAssignTask(models.TransientModel): + _name = 'task.reassign' + + pending_tasks = fields.One2many('pending.task', related='leave_req_id.pending_tasks', string='Pending Tasks', readonly=False) + leave_req_id = fields.Many2one('hr.leave', string='Leave Request') + + @api.multi + def action_approve(self): + task_pending = False + e_unavail = False + emp_unavail = [] + for task in self.pending_tasks: + if not task.assigned_to: + task_pending = True + if task_pending: + raise UserError(_('Please assign pending task to employees.')) + else: + for task in self.pending_tasks: + if task.assigned_to in task.unavailable_employee: + emp_unavail.append(task.assigned_to.name) + e_unavail = True + emp_unavail = set(emp_unavail) + emp_unavail_count = len(emp_unavail) + if e_unavail: + if emp_unavail_count == 1: + raise UserError(_('Selected employee %s is not available') % (', '.join(emp_unavail),)) + else: + raise UserError(_('Selected employees %s are not available') % (', '.join(emp_unavail),)) + + else: + manager = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) + holiday = self.leave_req_id + tasks = self.env['project.task'] + for task in self.pending_tasks: + vals = { + 'name': task.name, + 'user_id': task.assigned_to.user_id.id, + 'project_id': task.project_id.id, + 'description': task.description, + } + tasks.sudo().create(vals) + if holiday.double_validation: + return holiday.write({'state': 'validate1', 'manager_id': manager.id if manager else False}) + else: + holiday.action_validate() + + @api.multi + def cancel(self): + for task in self.pending_tasks: + task.update({'assigned_to': False}) + return {'type': 'ir.actions.act_window_close'} diff --git a/hr_vacation_mngmt/wizard/reassign_task.xml b/hr_vacation_mngmt/wizard/reassign_task.xml new file mode 100644 index 00000000..150da87d --- /dev/null +++ b/hr_vacation_mngmt/wizard/reassign_task.xml @@ -0,0 +1,31 @@ + + + + + Re-Assign Task + task.reassign + +
    +

    Confirm leave request and reassign pending works of the employee.

    + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/hrms_dashboard/README.rst b/hrms_dashboard/README.rst new file mode 100644 index 00000000..f86d03bd --- /dev/null +++ b/hrms_dashboard/README.rst @@ -0,0 +1,47 @@ +HR Dashboard v12 +================ + +Keep your eyes on your whole Human resource analysis. + +Depends +======= +[hr] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install the dependency package Pandas using the following commands + + * sudo pip3 install pandas + or + * sudo apt-get install pandas + +- Install our custom addon + + + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Aswani PC, odoo@cybrosys.com + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.openhrms.com + diff --git a/hrms_dashboard/__init__.py b/hrms_dashboard/__init__.py new file mode 100644 index 00000000..f2509f47 --- /dev/null +++ b/hrms_dashboard/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Aswani PC () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models +from . import report diff --git a/hrms_dashboard/__manifest__.py b/hrms_dashboard/__manifest__.py new file mode 100644 index 00000000..3719d99e --- /dev/null +++ b/hrms_dashboard/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of Open HRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Aswani PC () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': "Open HRMS - HR Dashboard", + 'version': '12.0.1.0.2', + 'summary': """Open HRMS - HR Dashboard""", + 'description': """Open HRMS - HR Dashboard""", + 'category': 'Human Resources', + 'author': 'Cybrosys Techno solutions,Open HRMS', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['hr', 'hr_holidays', 'hr_timesheet', 'hr_payroll', 'hr_attendance', 'hr_timesheet_attendance', + 'hr_recruitment', 'hr_resignation', 'event', 'hr_reward_warning'], + 'external_dependencies': { + 'python': ['pandas'], + }, + 'data': [ + 'security/ir.model.access.csv', + 'report/broadfactor.xml', + 'views/dashboard_views.xml'], + 'qweb': ["static/src/xml/hrms_dashboard.xml"], + 'images': ["static/description/banner.gif"], + 'license': "AGPL-3", + 'installable': True, + 'application': True, +} diff --git a/hrms_dashboard/docs/RELEASE_NOTES.md b/hrms_dashboard/docs/RELEASE_NOTES.md new file mode 100644 index 00000000..d8495dbf --- /dev/null +++ b/hrms_dashboard/docs/RELEASE_NOTES.md @@ -0,0 +1,11 @@ +## Module + +#### 13.03.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Open HRMS Project + +#### 26.11.2020 +#### Version 12.0.1.0.1 +##### FIX +- Bug Fixed diff --git a/hrms_dashboard/models/__init__.py b/hrms_dashboard/models/__init__.py new file mode 100644 index 00000000..094dec1f --- /dev/null +++ b/hrms_dashboard/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import hrms_dashboard diff --git a/hrms_dashboard/models/hrms_dashboard.py b/hrms_dashboard/models/hrms_dashboard.py new file mode 100644 index 00000000..1dd3e7e7 --- /dev/null +++ b/hrms_dashboard/models/hrms_dashboard.py @@ -0,0 +1,419 @@ +# -*- coding: utf-8 -*- + +from collections import defaultdict +from datetime import timedelta, datetime, date +from dateutil.relativedelta import relativedelta +import pandas as pd +from pytz import utc +from odoo import models, fields, api, _ +from odoo.http import request +from odoo.tools import float_utils +ROUNDING_FACTOR = 16 + + +class Employee(models.Model): + _inherit = 'hr.employee' + + birthday = fields.Date('Date of Birth', groups="base.group_user") + + @api.model + def check_user_group(self): + uid = request.session.uid + user = self.env['res.users'].sudo().search([('id', '=', uid)], limit=1) + if user.has_group('hr.group_hr_manager'): + return True + else: + return False + + @api.model + def get_user_employee_details(self): + uid = request.session.uid + employee = self.env['hr.employee'].sudo().search_read([('user_id', '=', uid)], limit=1) + leaves_to_approve = self.env['hr.leave'].sudo().search_count([('state', 'in', ['confirm', 'validate1'])]) + today = datetime.strftime(datetime.today(), '%Y-%m-%d') + query = """ + select count(id) + from hr_leave + WHERE (hr_leave.date_from::DATE,hr_leave.date_to::DATE) OVERLAPS ('%s', '%s') and + state='validate'""" % (today, today) + cr = self._cr + cr.execute(query) + leaves_today = cr.fetchall() + first_day = date.today().replace(day=1) + last_day = (date.today() + relativedelta(months=1, day=1)) - timedelta(1) + query = """ + select count(id) + from hr_leave + WHERE (hr_leave.date_from::DATE,hr_leave.date_to::DATE) OVERLAPS ('%s', '%s') + and state='validate'""" % (first_day, last_day) + cr = self._cr + cr.execute(query) + leaves_this_month = cr.fetchall() + leaves_alloc_req = self.env['hr.leave.allocation'].sudo().search_count([('state', 'in', ['confirm', 'validate1'])]) + timesheet_count = self.env['account.analytic.line'].sudo().search_count( + [('project_id', '!=', False), ('user_id', '=', uid)]) + timesheet_view_id = self.env.ref('hr_timesheet.hr_timesheet_line_search') + job_applications = self.env['hr.applicant'].sudo().search_count([]) + if employee: + sql = """select broad_factor from hr_employee_broad_factor where id =%s""" + self.env.cr.execute(sql, (employee[0]['id'],)) + result = self.env.cr.dictfetchall() + broad_factor = result[0]['broad_factor'] + if employee[0]['birthday']: + diff = relativedelta(datetime.today(), employee[0]['birthday']) + age = diff.years + else: + age = False + if employee[0]['joining_date']: + diff = relativedelta(datetime.today(), employee[0]['joining_date']) + years = diff.years + months = diff.months + days = diff.days + experience = '{} years {} months {} days'.format(years, months, days) + else: + experience = False + if employee: + data = { + 'broad_factor': broad_factor if broad_factor else 0, + 'leaves_to_approve': leaves_to_approve, + 'leaves_today': leaves_today, + 'leaves_this_month':leaves_this_month, + 'leaves_alloc_req': leaves_alloc_req, + 'emp_timesheets': timesheet_count, + 'job_applications': job_applications, + 'timesheet_view_id': timesheet_view_id, + 'experience': experience, + 'age': age + } + employee[0].update(data) + return employee + else: + return False + + @api.model + def get_upcoming(self): + cr = self._cr + uid = request.session.uid + employee = self.env['hr.employee'].search([('user_id', '=', uid)], limit=1) + + cr.execute("""select *, + (to_char(dob,'ddd')::int-to_char(now(),'ddd')::int+total_days)%total_days as dif + from (select he.id, he.name, to_char(he.birthday, 'Month dd') as birthday, + hj.name as job_id , he.birthday as dob, + (to_char((to_char(now(),'yyyy')||'-12-31')::date,'ddd')::int) as total_days + FROM hr_employee he + join hr_job hj + on hj.id = he.job_id + ) birth + where (to_char(dob,'ddd')::int-to_char(now(),'DDD')::int+total_days)%total_days between 0 and 15 + order by dif;""") + birthday = cr.fetchall() + cr.execute("""select e.name, e.date_begin, e.date_end, rc.name as location , e.is_online + from event_event e + left join res_partner rp + on e.address_id = rp.id + left join res_country rc + on rc.id = rp.country_id + where e.state ='confirm' + and (e.date_begin >= now() + and e.date_begin <= now() + interval '15 day') + or (e.date_end >= now() + and e.date_end <= now() + interval '15 day') + order by e.date_begin """) + event = cr.fetchall() + announcement = [] + if employee: + department = employee.department_id + job_id = employee.job_id + sql = """select ha.name, ha.announcement_reason + from hr_announcement ha + left join hr_employee_announcements hea + on hea.announcement = ha.id + left join hr_department_announcements hda + on hda.announcement = ha.id + left join hr_job_position_announcements hpa + on hpa.announcement = ha.id + where ha.state = 'approved' and + ha.date_start <= now()::date and + ha.date_end >= now()::date and + (ha.is_announcement = True or + (ha.is_announcement = False + and ha.announcement_type = 'employee' + and hea.employee = %s)""" % employee.id + if department: + sql += """ or + (ha.is_announcement = False and + ha.announcement_type = 'department' + and hda.department = %s)""" % department.id + if job_id: + sql += """ or + (ha.is_announcement = False and + ha.announcement_type = 'job_position' + and hpa.job_position = %s)""" % job_id.id + sql += ')' + cr.execute(sql) + announcement = cr.fetchall() + return { + 'birthday': birthday, + 'event': event, + 'announcement': announcement + } + + @api.model + def get_dept_employee(self): + cr = self._cr + cr.execute("""select department_id, hr_department.name,count(*) +from hr_employee join hr_department on hr_department.id=hr_employee.department_id +group by hr_employee.department_id,hr_department.name""") + dat = cr.fetchall() + data = [] + for i in range(0, len(dat)): + data.append({'label': dat[i][1], 'value': dat[i][2]}) + return data + + # @api.model + # def get_broad_factor(self): + # emp_broad_factor = [] + # sql = """select * from hr_employee_broad_factor""" + # self.env.cr.execute(sql) + # results = self.env.cr.dictfetchall() + # for data in results: + # broad_factor = data['broad_factor'] if data['broad_factor'] else 0 + # if data['broad_factor']: + # vals = { + # 'id': data['id'], + # 'name': data['name'], + # 'broad_factor': broad_factor + # } + # emp_broad_factor.append(vals) + # return emp_broad_factor + + @api.model + def get_department_leave(self): + month_list = [] + graph_result = [] + for i in range(5, -1, -1): + last_month = datetime.now() - relativedelta(months=i) + text = format(last_month, '%B %Y') + month_list.append(text) + self.env.cr.execute("""select id, name from hr_department""") + departments = self.env.cr.dictfetchall() + department_list = [x['name'] for x in departments] + for month in month_list: + leave = {} + for dept in departments: + leave[dept['name']] = 0 + vals = { + 'l_month': month, + 'leave': leave + } + graph_result.append(vals) + sql = """ + SELECT h.id, h.employee_id,h.department_id + , extract('month' FROM y)::int AS leave_month + , to_char(y, 'Month YYYY') as month_year + , GREATEST(y , h.date_from) AS date_from + , LEAST (y + interval '1 month', h.date_to) AS date_to + FROM (select * from hr_leave where state = 'validate') h + , generate_series(date_trunc('month', date_from::timestamp) + , date_trunc('month', date_to::timestamp) + , interval '1 month') y + where date_trunc('month', GREATEST(y , h.date_from)) >= date_trunc('month', now()) - interval '6 month' and + date_trunc('month', GREATEST(y , h.date_from)) <= date_trunc('month', now()) + and h.department_id is not null + """ + self.env.cr.execute(sql) + results = self.env.cr.dictfetchall() + leave_lines = [] + for line in results: + employee = self.browse(line['employee_id']) + from_dt = fields.Datetime.from_string(line['date_from']) + to_dt = fields.Datetime.from_string(line['date_to']) + days = employee.get_work_days_dashboard(from_dt, to_dt) + line['days'] = days + vals = { + 'department': line['department_id'], + 'l_month': line['month_year'], + 'days': days + } + leave_lines.append(vals) + if leave_lines: + df = pd.DataFrame(leave_lines) + rf = df.groupby(['l_month', 'department']).sum() + result_lines = rf.to_dict('index') + for month in month_list: + for line in result_lines: + if month.replace(' ', '') == line[0].replace(' ', ''): + match = list(filter(lambda d: d['l_month'] in [month], graph_result))[0]['leave'] + dept_name = self.env['hr.department'].browse(line[1]).name + if match: + match[dept_name] = result_lines[line]['days'] + for result in graph_result: + result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] + " " + result['l_month'].split(' ')[1:2][0] + return graph_result, department_list + + def get_work_days_dashboard(self, from_datetime, to_datetime, compute_leaves=False, calendar=None, domain=None): + resource = self.resource_id + calendar = calendar or self.resource_calendar_id + + if not from_datetime.tzinfo: + from_datetime = from_datetime.replace(tzinfo=utc) + if not to_datetime.tzinfo: + to_datetime = to_datetime.replace(tzinfo=utc) + from_full = from_datetime - timedelta(days=1) + to_full = to_datetime + timedelta(days=1) + intervals = calendar._attendance_intervals(from_full, to_full, resource) + day_total = defaultdict(float) + for start, stop, meta in intervals: + day_total[start.date()] += (stop - start).total_seconds() / 3600 + if compute_leaves: + intervals = calendar._work_intervals(from_datetime, to_datetime, resource, domain) + else: + intervals = calendar._attendance_intervals(from_datetime, to_datetime, resource) + day_hours = defaultdict(float) + for start, stop, meta in intervals: + day_hours[start.date()] += (stop - start).total_seconds() / 3600 + days = sum( + float_utils.round(ROUNDING_FACTOR * day_hours[day] / day_total[day]) / ROUNDING_FACTOR + for day in day_hours + ) + return days + + @api.model + def employee_leave_trend(self): + leave_lines = [] + month_list = [] + graph_result = [] + for i in range(5, -1, -1): + last_month = datetime.now() - relativedelta(months=i) + text = format(last_month, '%B %Y') + month_list.append(text) + uid = request.session.uid + employee = self.env['hr.employee'].sudo().search_read([('user_id', '=', uid)], limit=1) + for month in month_list: + vals = { + 'l_month': month, + 'leave': 0 + } + graph_result.append(vals) + sql = """ + SELECT h.id, h.employee_id + , extract('month' FROM y)::int AS leave_month + , to_char(y, 'Month YYYY') as month_year + , GREATEST(y , h.date_from) AS date_from + , LEAST (y + interval '1 month', h.date_to) AS date_to + FROM (select * from hr_leave where state = 'validate') h + , generate_series(date_trunc('month', date_from::timestamp) + , date_trunc('month', date_to::timestamp) + , interval '1 month') y + where date_trunc('month', GREATEST(y , h.date_from)) >= date_trunc('month', now()) - interval '6 month' and + date_trunc('month', GREATEST(y , h.date_from)) <= date_trunc('month', now()) + and h.employee_id = %s + """ + self.env.cr.execute(sql, (employee[0]['id'],)) + results = self.env.cr.dictfetchall() + for line in results: + employee = self.browse(line['employee_id']) + from_dt = fields.Datetime.from_string(line['date_from']) + to_dt = fields.Datetime.from_string(line['date_to']) + days = employee.get_work_days_dashboard(from_dt, to_dt) + line['days'] = days + vals = { + 'l_month': line['month_year'], + 'days': days + } + leave_lines.append(vals) + if leave_lines: + df = pd.DataFrame(leave_lines) + rf = df.groupby(['l_month']).sum() + result_lines = rf.to_dict('index') + for line in result_lines: + match = list(filter(lambda d: d['l_month'].replace(' ', '') == line.replace(' ', ''), graph_result)) + if match: + match[0]['leave'] = result_lines[line]['days'] + for result in graph_result: + result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] + " " + result['l_month'].split(' ')[1:2][0] + return graph_result + + @api.model + def join_resign_trends(self): + cr = self._cr + month_list = [] + join_trend = [] + resign_trend = [] + for i in range(11, -1, -1): + last_month = datetime.now() - relativedelta(months=i) + text = format(last_month, '%B %Y') + month_list.append(text) + for month in month_list: + vals = { + 'l_month': month, + 'count': 0 + } + join_trend.append(vals) + for month in month_list: + vals = { + 'l_month': month, + 'count': 0 + } + resign_trend.append(vals) + cr.execute('''select to_char(joining_date, 'Month YYYY') as l_month, count(id) from hr_employee + WHERE joining_date BETWEEN CURRENT_DATE - INTERVAL '12 months' + AND CURRENT_DATE + interval '1 month - 1 day' + group by l_month;''') + join_data = cr.fetchall() + cr.execute('''select to_char(resign_date, 'Month YYYY') as l_month, count(id) from hr_employee + WHERE resign_date BETWEEN CURRENT_DATE - INTERVAL '12 months' + AND CURRENT_DATE + interval '1 month - 1 day' + group by l_month;''') + resign_data = cr.fetchall() + + for line in join_data: + match = list(filter(lambda d: d['l_month'].replace(' ', '') == line[0].replace(' ', ''), join_trend)) + if match: + match[0]['count'] = line[1] + for line in resign_data: + match = list(filter(lambda d: d['l_month'].replace(' ', '') == line[0].replace(' ', ''), resign_trend)) + if match: + match[0]['count'] = line[1] + for join in join_trend: + join['l_month'] = join['l_month'].split(' ')[:1][0].strip()[:3] + for resign in resign_trend: + resign['l_month'] = resign['l_month'].split(' ')[:1][0].strip()[:3] + graph_result = [{ + 'name': 'Join', + 'values': join_trend + }, { + 'name': 'Resign', + 'values': resign_trend + }] + return graph_result + + @api.model + def get_attrition_rate(self): + month_attrition = [] + monthly_join_resign = self.join_resign_trends() + month_join = monthly_join_resign[0]['values'] + month_resign = monthly_join_resign[1]['values'] + sql = """ + SELECT (date_trunc('month', CURRENT_DATE))::date - interval '1' month * s.a AS month_start + FROM generate_series(0,11,1) AS s(a);""" + self._cr.execute(sql) + month_start_list = self._cr.fetchall() + for month_date in month_start_list: + self._cr.execute("""select count(id), to_char(date '%s', 'Month YYYY') as l_month from hr_employee + where resign_date> date '%s' or resign_date is null and joining_date < date '%s' + """ % (month_date[0], month_date[0], month_date[0],)) + month_emp = self._cr.fetchone() + # month_emp = (month_emp[0], month_emp[1].split(' ')[:1][0].strip()[:3]) + match_join = list(filter(lambda d: d['l_month'] == month_emp[1].split(' ')[:1][0].strip()[:3], month_join))[0]['count'] + match_resign = list(filter(lambda d: d['l_month'] == month_emp[1].split(' ')[:1][0].strip()[:3], month_resign))[0]['count'] + month_avg = (month_emp[0]+match_join-match_resign+month_emp[0])/2 + attrition_rate = (match_resign/month_avg)*100 if month_avg != 0 else 0 + vals = { + # 'month': month_emp[1].split(' ')[:1][0].strip()[:3] + ' ' + month_emp[1].split(' ')[-1:][0], + 'month': month_emp[1].split(' ')[:1][0].strip()[:3], + 'attrition_rate': round(float(attrition_rate), 2) + } + month_attrition.append(vals) + return month_attrition diff --git a/hrms_dashboard/report/__init__.py b/hrms_dashboard/report/__init__.py new file mode 100644 index 00000000..c5b299d7 --- /dev/null +++ b/hrms_dashboard/report/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import broadfactor diff --git a/hrms_dashboard/report/broadfactor.py b/hrms_dashboard/report/broadfactor.py new file mode 100644 index 00000000..f40bb081 --- /dev/null +++ b/hrms_dashboard/report/broadfactor.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +from odoo import tools +from odoo import api, fields, models + + +class EmployeeBroadFactor(models.Model): + _name = "hr.employee.broad.factor" + _description = "Employee Broadfactor" + _auto = False + + name = fields.Char() + no_of_occurrence = fields.Integer() + no_of_days = fields.Integer() + broad_factor = fields.Integer() + + @api.model_cr + def init(self): + tools.drop_view_if_exists(self._cr, 'hr_employee_broad_factor') + self._cr.execute(""" + create or replace view hr_employee_broad_factor as ( + select + e.id, + e.name, + count(h.*) as no_of_occurrence, + sum(h.number_of_days) as no_of_days, + count(h.*)*count(h.*)*sum(h.number_of_days) as broad_factor + from hr_employee e + full join (select * from hr_leave where state = 'validate') h + on e.id =h.employee_id + group by e.id + )""") + + +class ReportOverdue(models.AbstractModel): + _name = 'report.hrms_dashboard.report_broadfactor' + + @api.model + def get_report_values(self, docids=None, data=None): + sql = """select * from hr_employee_broad_factor""" + self.env.cr.execute(sql) + lines = self.env.cr.dictfetchall() + return { + 'doc_model': 'hr.employee.broad_factor', + 'lines': lines, + 'Date': fields.date.today(), + } diff --git a/hrms_dashboard/report/broadfactor.xml b/hrms_dashboard/report/broadfactor.xml new file mode 100644 index 00000000..032a8dc1 --- /dev/null +++ b/hrms_dashboard/report/broadfactor.xml @@ -0,0 +1,47 @@ + + + + + + diff --git a/hrms_dashboard/security/ir.model.access.csv b/hrms_dashboard/security/ir.model.access.csv new file mode 100644 index 00000000..70aedfb5 --- /dev/null +++ b/hrms_dashboard/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_employee_broad_factor,access_hr_employee_broad_factor,model_hr_employee_broad_factor,base.group_user,1,0,0,0 +access_hr_employee_payslip,access_hr_employee_payslip,hr_payroll.model_hr_payslip,base.group_user,1,0,0,0 +access_hr_models,access_hr_employee_model,base.model_ir_module_module,base.group_user,1,0,0,0 diff --git a/hrms_dashboard/static/description/HRMS-BUTTON.png b/hrms_dashboard/static/description/HRMS-BUTTON.png new file mode 100644 index 00000000..0f1b65be Binary files /dev/null and b/hrms_dashboard/static/description/HRMS-BUTTON.png differ diff --git a/hrms_dashboard/static/description/banner.gif b/hrms_dashboard/static/description/banner.gif new file mode 100644 index 00000000..f5cac4e1 Binary files /dev/null and b/hrms_dashboard/static/description/banner.gif differ diff --git a/hrms_dashboard/static/description/cybro-service.png b/hrms_dashboard/static/description/cybro-service.png new file mode 100644 index 00000000..252929a8 Binary files /dev/null and b/hrms_dashboard/static/description/cybro-service.png differ diff --git a/hrms_dashboard/static/description/cybro_logo.png b/hrms_dashboard/static/description/cybro_logo.png new file mode 100644 index 00000000..bb309114 Binary files /dev/null and b/hrms_dashboard/static/description/cybro_logo.png differ diff --git a/hrms_dashboard/static/description/dashboard_icon.png b/hrms_dashboard/static/description/dashboard_icon.png new file mode 100644 index 00000000..d9f73813 Binary files /dev/null and b/hrms_dashboard/static/description/dashboard_icon.png differ diff --git a/hrms_dashboard/static/description/icon.png b/hrms_dashboard/static/description/icon.png new file mode 100644 index 00000000..91ef06c5 Binary files /dev/null and b/hrms_dashboard/static/description/icon.png differ diff --git a/hrms_dashboard/static/description/index.html b/hrms_dashboard/static/description/index.html new file mode 100644 index 00000000..24d160d8 --- /dev/null +++ b/hrms_dashboard/static/description/index.html @@ -0,0 +1,379 @@ + +
    +
    +

    + Open HRMS +

    +

    + Most advanced open source HR management software +

    +
    + Cybrosys Technologies +
    + +
    + cybrosys technologies +
    +
    +
    +
    + +
    +
    +

    + Overview +

    +

    + Human Resource Departments have a lot to manage and volume to track with reports ever growing. + Fortunately, technologies provide elegant solutions to track and monitor every essential Human Resource activities. +
    + Open HRMS HR Dashboard provides a visually engaging palate for seamless management of Human Resource functions. + It provides executives and employees the information they need. Open HRMS Dashboard comes intuitive and + interactive connecting every dots of your data like never before. With Open HRMS HR dashboard, + facilitates with various metrics helping easy to view, understand, and share data. + Experience the new kind of responsiveness with Open HRMS Dashboard. +

    +
    +
    +

    + Configuration +

    +

    + Need to install the external python dependency 'pandas'. +

    +
    +
    + +
    +
    +

    + Features +

    +

    + + Provides all essential tools to deliver real-time informations. +

    +

    + + Employees quick access to their timesheets, company contracts and their board factor for analyzing their leave. +

    + + Managers to view employee division by departments from department wise employee graph. +

    +

    + + Manager to view leave allocation requests, leaves for the day and month, job applications and finally approval of leaves after verification.

    +
    +
    +
    +
    +

    + Screenshots +

    +

    + + Open HRMS HR Dashboard provides you with all essential tools to deliver real-time information’s. +

    +
    + +
    +

    + + Open HRMS HR Dashboard gets you with monthly leave analysis of employees from various departments. Open HRMS HR Dashboard showcases the + department wise leave percentage for quick and easy understanding. +

    +
    + +
    +

    + + You will also able to see the monthly join/resign analysis and attrition rate analysis. +

    +
    + +
    +

    + + The HR Dashboard also gives a glimpse of the upcoming birthdays of employees creating the mood for celebration. + Also the upcoming events and announcements. + Open HRMS HR Dashboard facilitates each employee to log in and conduct their own leave analysis for the past six months. + +

    +
    + +
    +
    +
    +
    +
    +

    Open HRMS

    +

    Most advanced open source HR management software

    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + cybrosys technologies +
    + +
    +
    +

    + Our Services +

    + +
    +
    +
    +
    +

    + Our Industries +

    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Trading + +

    +

    + Easily procure and sell your products. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Manufacturing +

    +

    + Plan, track and schedule your operations. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Restaurant +

    +

    + Run your bar or restaurant methodical. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + POS +

    +

    + Easy configuring and convivial selling. +

    +
    + +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + E-commerce & Website +

    +

    + Mobile friendly, awe-inspiring product pages. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Hotel Management +

    +

    + An all-inclusive hotel management application. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Education +

    +

    + A Collaborative platform for educational management. +

    +
    +
    +
    + +
    +
    + + Odoo Industry + +
    +
    +
    +

    + + Service Management +

    +

    + Keep track of services and invoice accordingly. +

    +
    +
    +
    +
    +
    +
    + +
    + + diff --git a/hrms_dashboard/static/description/oh_icon.png b/hrms_dashboard/static/description/oh_icon.png new file mode 100644 index 00000000..37ae6286 Binary files /dev/null and b/hrms_dashboard/static/description/oh_icon.png differ diff --git a/hrms_dashboard/static/description/open-hrms-dashboard-1.png b/hrms_dashboard/static/description/open-hrms-dashboard-1.png new file mode 100644 index 00000000..cd1b2121 Binary files /dev/null and b/hrms_dashboard/static/description/open-hrms-dashboard-1.png differ diff --git a/hrms_dashboard/static/description/open-hrms-dashboard-2.png b/hrms_dashboard/static/description/open-hrms-dashboard-2.png new file mode 100644 index 00000000..7bd49b35 Binary files /dev/null and b/hrms_dashboard/static/description/open-hrms-dashboard-2.png differ diff --git a/hrms_dashboard/static/description/open-hrms-dashboard-3.png b/hrms_dashboard/static/description/open-hrms-dashboard-3.png new file mode 100644 index 00000000..37e9d985 Binary files /dev/null and b/hrms_dashboard/static/description/open-hrms-dashboard-3.png differ diff --git a/hrms_dashboard/static/description/open-hrms-dashboard-4.png b/hrms_dashboard/static/description/open-hrms-dashboard-4.png new file mode 100644 index 00000000..c3decdd1 Binary files /dev/null and b/hrms_dashboard/static/description/open-hrms-dashboard-4.png differ diff --git a/hrms_dashboard/static/src/css/hrms_dashboard.css b/hrms_dashboard/static/src/css/hrms_dashboard.css new file mode 100644 index 00000000..889d5db4 --- /dev/null +++ b/hrms_dashboard/static/src/css/hrms_dashboard.css @@ -0,0 +1,980 @@ +.oh_dashboards{ + padding-top :15px; + background-color: #f8faff !important; +} + +.oh-card h4 { + font-size: 1.1rem; +} +.breadcrumbs { + margin-top: 0; +} + +.buttons button { + margin: 2px 0; } + +/* Button Reset */ +.btn, .button { + display: inline-block; + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + transition: all .15s ease-in-out; + border-radius: 0; + cursor: pointer; } + + +/* Widget One +---------------------------*/ +.stat-content { + display: inline-block; + width: 66%; +} +.stat-icon{ + display: inline-block; +} + +.stat-widget-one .stat-icon { + vertical-align: top; + margin: auto; + width: 100%; + color: #01c490; +} + +.stat-widget-one .stat-icon i { + font-size: 30px; + font-weight: 900; + display: inline-block; + color: #01c490;} + +.stat-widget-one .stat-text { + font-size: 14px; + color: #868e96; + font-weight: bold; +} + +.stat-widget-one .stat-digit { + font-size: 24px; + color: #02448b; } + +.stat-count { + font-size: 20px; + text-align: center; + color: #00438b;} + +.stat-title { + font-size: 17px; + text-align: center; + color: #00438b; } + +.mb-0{ + font-size: 20px; + position: relative; + text-align: center; +} +.mb-0 .dash-title { + font-size: 20px; + text-align: center; + color: rgba(255, 255, 255, 0.81); +} +.hr_birthday { + font-size: 28px; + text-align: center; + padding: 20px 0; + color: #00438b; + font-weight: 600; +} +body .text-color { + color: #00438b; +} +.slice { + stroke: #fff; + stroke-width: 0px; +} + +/* Leave graph */ + +path { stroke: #fff; } +path:hover { opacity:0.9; } +rect:hover { fill:#934da5; } +.axis { font: 10px sans-serif; } +.legend tr{ border-bottom:1px solid grey; } +.legend tr:first-child{ border-top:1px solid grey; } + +.axis path, +.axis line { + fill: none; + stroke: #000; + shape-rendering: crispEdges; +} + +.x.axis path { display: none; } +.legend{ + border-collapse: collapse; + border-spacing: 0px; + display: inline-block; +} +.legend td, .legend .legend_col{ + padding:4px 5px; + vertical-align:bottom; +} +.legendFreq, .legendPerc{ + align:right; + width:50px; +} + +/* Leave broadfactor graph */ + +.broad_factor_graph .axis path, +.broad_factor_graph .axis line { + fill: none; + stroke: black; + shape-rendering: crispEdges; +} +.broad_factor_graph .axis text { + font-family: sans-serif; + font-size: 11px; +} + +.broad_factor_graph rect { + -moz-transition: all 0.3s; + -webkit-transition: all 0.3s; + -o-transition: all 0.3s; + transition: all 0.3s; +} +.broad_factor_graph rect:hover{ + fill: #ff618a; +} + +#broad_factor_pdf { + background-color: #ffffff; + border: 0; + color : #000000; + float: right; +} +#broad_factor_pdf i { + color: red; +} + +.leave_broad_factor{ + overflow-x: auto !important; + overflow-y: hidden !important; + height: auto; +} + +/*=====================New Dashboard===========================*/ + +.oh_dashboards { + background-color: #f8faff !important; + padding: 0px !important; + +} +.container-fluid.o_hr_dashboard { + padding: 0px !important; +} +.employee-prof { + + padding: 0px; + height: 100%; + background-color: #3e6282; + /*background-image: linear-gradient(180deg, #3e6282, #41666f);*/ + position: fixed; + z-index: 999; +} +.employee-prof .oh-card:hover { + + transform:none !important; + box-shadow: none !important; + +} + +/*.dummy{ + height:130vh; +}*/ +.oh-card { + + padding-top: 0px; + padding: 0px; + margin-bottom: 1.5rem; + border-radius: 0px; + box-shadow: none; + background: none; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + +} +.oh-card:hover { + + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; + +} +.employee-prof .employee-icon { + + float: left; + padding-right: 0px; + width: 100%; + height: 185px; + overflow: hidden; + background: #fff; + +} +.employee-prof .employee-icon img{ + width: 100%; + background: #fff; +} + +.employee-prof .employee-name h2 { + + text-align: center; + font-weight: 300; + text-transform: uppercase; + font-size: 17px; + margin-top: 12px; + margin-bottom: 2px; + color: #fff; + +} +.media-body.employee-name { + + background: #466b8d; + float: left; + margin: 0; + width: 100% + +} +.employee-prof .employee-name p { + + margin: 0 0 9px; + text-align: center; + font-size: 12px; + color: #f3f3f3; + +} +.employee-prof p { + margin: 0 0 9px; + color: #fff; +} +.employee-gender { + width: 40%; + margin-left: 10%; + padding: 8% 10% 4%; + text-align: center; + border-right: 1px solid #4d769b; + margin-top: 14%; + float: left; + border-bottom: 1px solid #4d769b; +} +.employee-gender p { + margin: 0px 0 4px !important; + color: #fff; +} +.employee-age { + width: 40%; + margin-right: 10%; + padding: 4% 10% 7%; + text-align: center; + margin-top: 18%; + float: left; + border-bottom: 1px solid #4d769b; +} +.employee-age p { + margin: 0 0 1px; + color: #fff; +} +.employee-experience { + + width: 100%; + text-align: center; + padding-top: 8%; + float: left; + padding-bottom: 3%; + +} +.employee-country { + width: 40%; + margin-left: 10%; + padding: 9% 0% 4%; + text-align: center; + border-right: 1px solid #4d769b; + margin-top: 2%; + float: left; + border-top: 1px solid #4d769b; + +} +.employee-country p { + margin: 0px 0 1px !important; + color: #fff; +} +.employee-mobile { + width: 40%; + margin-right: 10%; + padding: 9% 0% 7%; + text-align: center; + margin-top: 2%; + float: left; + border-top: 1px solid #4d769b; +} +.employee-mobile p { + margin: 0 0 1px; + color: #fff; +} +.oh-payslip { + + margin-top: 1.5%; + +} +.oh-payslip .stat-icon { + + width: 30%; + height: 85px; + text-align: center; + padding-top: 15%; + background: #ff8762; + color: #fff; + +} +.oh-payslip .oh-card { + + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + +} +.stat-widget-one .stat-text { + + font-size: 14px; + color: #ff8762; + margin-top: 2.3rem; + margin-left: 1rem; + +} +.stat-widget-one .stat-digit { + + font-size: 17px; + color: #000; + margin-left: 1rem; + +} + +.stat-widget-one .stat-icon i { + + font-size: 25px; + font-weight: 900; + display: inline-block; + color: #fff; + +} +.stat-widget-one { + + background-color: white; + text-align: left; + +} +.stat-widget-one { + width: 100%; +} +.oh-payslip .stat-icon { + + width: 30%; + height: 85px; + text-align: center; + padding-top: 15%; + +} +.oh-timesheets .stat-icon{ + background: #5ebade !important; +} +.oh-contracts .stat-icon{ + background: #b298e1 !important; +} +.oh-broad-factor .stat-icon{ + background: #70cac1 !important; +} +.oh-timesheets .stat-widget-one .stat-text { + color: #5ebade; +} +.oh-contracts .stat-widget-one .stat-text { + color: #b298e1; +} +.oh-broad-factor .stat-widget-one .stat-text { + color: #70cac1; +} +.leave-manager { + + background-color: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding: 0px; + margin: 15px; + +} +.hr_leave_request_approve { + padding: 0; + padding-bottom: 0em; + padding-top: 0em; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; +} +.leaves_request_month { + padding: 0; + padding-top: 0px; + padding-bottom: 0px; + padding-bottom: 0em; + padding-top: 0em; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + border-bottom: 1px solid #f1f1f133; +} +.leaves_request_today{ + padding: 0; + padding-bottom: 0em; + padding-top: 0em; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + +} +.hr_leave_request_approve:hover, .leaves_request_month:hover, .leaves_request_today:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} +.hr_leave_request_approve p { + font-size: 14px; + color: #ff8762; + margin-left: 1rem; + margin-bottom: 0px; + text-align: left; + width: 64%; + font-weight: bold; + float: left; +} +.leaves_request_today p { + font-size: 14px; + color: #5ebade; + margin-left: 1rem; + margin-bottom: 0px; + text-align: left; + width:64%; + float:left; + font-weight: bold; +} +.leaves_request_month p{ + font-size: 14px; + color: #b298e1; + margin-left: 1rem; + margin-bottom:0px; + text-align: left; + width:64%; + float:left; + font-weight: bold; +} +h4 .stat-count { + font-size: 17px; + text-align: center; + color: #000 !important; + margin-top: 0px; + width: 100%; + float: left; + margin: 0; +} +.leave-manager h4 { + float: left; + width: 23%; + +} +.hr_leave_request_approve h4 { + + padding: 5.2rem 0; + margin: 0; + background: #ff8762; + color: #fff; + +} +.leaves_request_today h4 { + + padding: 2.2rem 0; + margin: 0 !important; + background: #5ebade; + color: #fff; + +} +.leaves_request_month h4 { + + padding: 2.1rem 0; + margin: 0 !important; + background: #b298e1; + color: #fff; + +} +.leaves_request_today h4 .stat-count ,.leaves_request_month h4 .stat-count , .hr_leave_request_approve h4 .stat-count +{ + color:#fff !important; +} +.graph_view .legend { + margin-bottom: 27px; + display: inline-block; + border-collapse: collapse; + border-spacing: 0px; + margin-left: 29px; +} +.hr-chart-1{ + margin: 15px 0px; + background: #fff; + padding: 0px !important; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); +} +.hr-chart-1:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} +.stat-head { + text-align: left !important; + font-weight: 300; + font-size: 15px; + margin-bottom: 25px; + margin-left: 24px; + width: 100%; +} +.emp_graph { + padding-left: 90px; + height: auto; + padding-bottom: 65px; + text-align: center !important; +} +.hr_leave_allocations_approve p { + font-size: 14px; + color: #ff8762; + margin-left: 1rem; + margin-bottom: 0px; + text-align: left; + width: 70%; + float: left; + font-weight: bold; +} +.hr_leave_allocations_approve h4 { + + padding: 2.5rem 0; + margin: 0; + background: #ff8762; + color: #fff; + width: 26%; + float: left; +} +.hr_leave_allocations_approve .stat-count { + + font-size: 17px; + text-align: center; + color: #fff !important; + margin-top: 0px; + width: 100%; + float: left; + margin: 0; + +} +.hr_leave_allocations_approve { + + padding: 0; + padding-top: 0px; + padding-bottom: 0px; + padding-bottom: 0em; + padding-top: 0em; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + background: #fff; + height: 80px; + +} +.hr_leave_allocations_approve:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} +.leave-manager { + + background-color: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding: 0px; + margin: 15px; + margin-right: 15px; + margin-right: 0px; + width: 95% !important; + padding: 0; + +} +.hr_job_application_approve { + padding: 0; + padding-top: 0px; + padding-bottom: 0px; + padding-top: 0px; + padding-bottom: 0px; + padding-top: 0px; + padding-bottom: 0px; + padding-bottom: 0em; + padding-top: 0em; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + background: #fff; + margin-top: 15px; + height: 80px; + +} +.hr_job_application_approve p { + font-size: 14px; + color: #70cac1; + margin-left: 1rem; + margin-bottom: 0px; + text-align: left; + width: 70%; + float: left; + font-weight: bold; +} +.hr_job_application_approve h4 { + + padding: 2.5rem 0; + margin: 0; + background: #70cac1; + color: #fff; + width: 26%; + float: left; + +} +.hr_job_application_approve .stat-count { + + font-size: 17px !important; + color: #fff !important; + margin-top: 0px !important; + width: 100%; + float: left; + margin: 0; + margin: 0px !important; + text-align: center !important; + width: 100% !important; + +} +.hr_job_application_approve:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} +.hr_attendance_login .oh-card { + margin: 0; + margin-bottom: 0px; + margin-bottom: 0px; + background: #134c8a; + padding-bottom: 7px; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); +} +.hr_attendance_login .stat-widget-one { + background: none; +} +.hr_attendance_login .stat-widget-one .stat-icon { + text-align: center; + padding-top: 9px; +} +.hr_attendance_login .stat-content { + width: 100%; + color: #fff !important; +} +.hr_attendance_login .stat-widget-one .stat-text { + margin: 0; + text-align: center; + width: 100% !important; + padding: 0; + color: #fff; +} +.hr_attendance_login .stat-widget-one .stat-icon .fa { + font-size: 50px; +} +.hr_attendance_login .stat-widget-one .stat-icon .fa { + font-size: 50px; + margin: 0px; + box-shadow: none; +} +.hr_attendance_login { + margin-top: 1.5%; +} +.monthly_leave_graph_view .oh-card { + background: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding: 15px; +} +.broad_factor_graph .oh-card { + padding: 15px !important; + background: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding: 15px; +} +.leave_broad_factor { + overflow-x: auto !important; + overflow-y: hidden !important; + height: 336px; + padding: 0px; + padding-left: 0px; +} +#broad_factor_pdf { + + background-color: #ffffff; + float: right; + border-radius: 30px; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + border: 1px solid #4ec3b7; + color: #757575; + padding-top: 9px; + color: #4ec3b7; + +} +#broad_factor_pdf:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} +.hr_birthday { + font-size: 17px; + text-align: center; + padding: 20px 0; + color: #00438b; + font-weight: 300; +} +.hr_notification img { + width: 40px; + height: 40px; + border-radius: 100%; +} +.hr_notification { + background: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + height: 316px; + overflow-y: auto; + margin-bottom: 15px; +} +.hr_notification .media { + border-bottom: 1px solid #e6e6e6; + padding-bottom: 6px; + margin-bottom: 10px; +} +.hr_notification .text-color.display-6 { + margin: 0px 0 3px; + color: #2d2d2d; +} +.hr_notification p { + margin: 0 0 1px; + color: #666; + font-size: 10px; +} +.hr_notification_head { + font-size: 17px; + text-align: center; + padding: 12px 0; + color: #fff; + font-weight: 300; + background: #5ebade; + margin-bottom: 9px; +} +.monthly_leave_trend .oh-card{ + background: #fff; + transition: none !important; + will-change: none !important; + box-shadow: none !important; + margin-bottom: 5px; +} + +.monthly_leave_trend path { + stroke: #70cac1; + stroke-width: 2; + fill: none; +} + +.monthly_leave_trend .axis path, +.monthly_leave_trend .axis line { + fill: none; + stroke: grey; + stroke-width: 1; + shape-rendering: crispEdges; +} +.monthly_leave_trend circle{ + fill: #ffffff; + stroke: #44b7ac; + stroke-width: 1.5; +} +.hr-chart-1 { + margin: 15px 0px; + background: #fff; + padding: 0px !important; + padding-top: 0px; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding-top: 3px !important; +} +.monthly_leave_trend { + background: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); +} +.monthly_leave_trend:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} + + +/*----------------------*/ +.monthly_join_resign_trend{ + padding-right: 0px !important; +} + +.monthly_join_resign_trend .oh-card { + background: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding: 15px; +} + +.monthly_join_resign_trend .axis path, +.monthly_join_resign_trend .axis line { + fill: none; + shape-rendering: crispEdges; + } + +.monthly_join_resign_trend .line { + fill: none; + stroke-width: 3px; + + } + +.monthly_join_resign_trend .area { + fill: steelblue; + opacity: 0.5; + } + +.monthly_join_resign_trend .dot { + fill: steelblue; + stroke: steelblue; + stroke-width: 1.5px; + } + +/*----------------------------------------*/ + + +.monthly_attrition_rate path { + stroke: #70cac1; + stroke-width: 2; + fill: none; +} + +.monthly_attrition_rate .axis path, +.monthly_attrition_rate .axis line { + fill: none; + stroke: grey; + stroke-width: 1; + shape-rendering: crispEdges; +} +.monthly_attrition_rate circle{ + fill: #ffffff; + stroke: #44b7ac; + stroke-width: 1.5; +} + +.monthly_attrition_rate .oh-card { + background: #fff; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + padding: 15px; +} + +.monthly_attrition_rate .oh-card:hover{ + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; +} + + +.row.main-section { + margin-right: 0px; !important; +} +/* width */ +.hr_notification::-webkit-scrollbar { + width: 4px; +} + +/* Track */ +.hr_notification::-webkit-scrollbar-track { + background: #f1f1f1; +} + +/* Handle */ +.hr_notification::-webkit-scrollbar-thumb { + background: #5ebade; +} + +/* Handle on hover */ +.hr_notification::-webkit-scrollbar-thumb:hover { + background: #598da1; +} + +.oh-card-body { + display: flex; + justify-content: space-between; + align-items: center; +} + +.oh-ribbon { + position: absolute; + left: -5px; top: -5px; + z-index: 1; + overflow: hidden; + width: 150px; height: 150px; + text-align: right; +} +.oh-ribbon span { + font-size: 10px; + font-weight: bold; + color: #FFF; + text-transform: uppercase; + text-align: center; + line-height: 20px; + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); + width: 200px; + display: block; + background: #79A70A; + background: linear-gradient(#2989d8 0%, #1e5799 100%); + box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 1); + position: absolute; + top: 56px; + left: -35px; +} +.oh-ribbon span::before { + content: ""; + position: absolute; left: 0px; top: 100%; + z-index: -1; + border-left: 3px solid #1e5799; + border-right: 3px solid transparent; + border-bottom: 3px solid transparent; + border-top: 3px solid #1e5799; +} +.oh-ribbon span::after { + content: ""; + position: absolute; right: 0px; top: 100%; + z-index: -1; + border-left: 3px solid transparent; + border-right: 3px solid #1e5799; + border-bottom: 3px solid transparent; + border-top: 3px solid #1e5799; +} diff --git a/hrms_dashboard/static/src/js/hrms_dashboard.js b/hrms_dashboard/static/src/js/hrms_dashboard.js new file mode 100644 index 00000000..f0638ae5 --- /dev/null +++ b/hrms_dashboard/static/src/js/hrms_dashboard.js @@ -0,0 +1,910 @@ +odoo.define('hrms_dashboard.Dashboard', function (require) { +"use strict"; + +var AbstractAction = require('web.AbstractAction'); +var ajax = require('web.ajax'); +var ControlPanelMixin = require('web.ControlPanelMixin'); +var core = require('web.core'); +var rpc = require('web.rpc'); +var session = require('web.session'); +var web_client = require('web.web_client'); + +var _t = core._t; +var QWeb = core.qweb; + +var HrDashboard = AbstractAction.extend(ControlPanelMixin, { + template: 'HrDashboardMain', + cssLibs: [ + '/web/static/lib/nvd3/nv.d3.css' + ], + jsLibs: [ + '/web/static/lib/nvd3/d3.v3.js', + '/web/static/lib/nvd3/nv.d3.js', + '/web/static/src/js/libs/nvd3.js' + ], + events: { + 'click .hr_leave_request_approve': 'leaves_to_approve', + 'click .hr_leave_allocations_approve': 'leave_allocations_to_approve', + 'click .hr_timesheets': 'hr_timesheets', + 'click .hr_job_application_approve': 'job_applications_to_approve', + 'click .hr_payslip':'hr_payslip', + 'click .hr_contract':'hr_contract', + 'click .hr_employee':'hr_employee', + 'click .leaves_request_month':'leaves_request_month', + 'click .leaves_request_today':'leaves_request_today', + "click .o_hr_attendance_sign_in_out_icon": function() { + this.$('.o_hr_attendance_sign_in_out_icon').attr("disabled", "disabled"); + this.update_attendance(); + }, + 'click #broad_factor_pdf': 'generate_broad_factor_report', + }, + + init: function(parent, context) { + this._super(parent, context); + + this.date_range = 'week'; // possible values : 'week', 'month', year' + this.date_from = moment().subtract(1, 'week'); + this.date_to = moment(); + this.dashboards_templates = ['LoginEmployeeDetails', 'ManagerDashboard', 'EmployeeDashboard']; + this.employee_birthday = []; + this.upcoming_events = []; + this.announcements = []; + }, + + willStart: function() { + var self = this; + return $.when(ajax.loadLibs(this), this._super()).then(function() { + return self.fetch_data(); + }); + }, + + start: function() { + var self = this; + this.set("title", 'Dashboard'); + return this._super().then(function() { + self.update_cp(); + self.render_dashboards(); + self.render_graphs(); + self.$el.parent().addClass('oe_background_grey'); + }); + }, + + fetch_data: function() { + var self = this; + var def0 = self._rpc({ + model: 'hr.employee', + method: 'check_user_group' + }).then(function(result) { + if (result == true){ + self.is_manager = true; + } + else{ + self.is_manager = false; + } + }); + var def1 = this._rpc({ + model: 'hr.employee', + method: 'get_user_employee_details' + }).done(function(result) { + self.login_employee = result[0]; + }); + var def2 = self._rpc({ + model: "hr.employee", + method: "get_upcoming", + }) + .done(function (res) { + self.employee_birthday = res['birthday']; + self.upcoming_events = res['event']; + self.announcements = res['announcement']; + }); + return $.when(def0, def1, def2); + }, + + render_dashboards: function() { + var self = this; + if (this.login_employee){ + var templates = [] + if( self.is_manager == true){templates = ['LoginEmployeeDetails','ManagerDashboard', 'EmployeeDashboard'];} + else{ templates = ['LoginEmployeeDetails', 'EmployeeDashboard'];} + _.each(templates, function(template) { + self.$('.o_hr_dashboard').append(QWeb.render(template, {widget: self})); + }); + } + else{ + self.$('.o_hr_dashboard').append(QWeb.render('EmployeeWarning', {widget: self})); + } + }, + + render_graphs: function(){ + var self = this; + if (this.login_employee){ + self.render_department_employee(); + self.render_leave_graph(); + self.update_join_resign_trends(); + self.update_monthly_attrition(); + self.update_leave_trend(); + } + }, + + on_reverse_breadcrumb: function() { + var self = this; + web_client.do_push_state({}); + this.update_cp(); + this.fetch_data().then(function() { + self.$('.o_hr_dashboard').empty(); + self.render_dashboards(); + self.render_graphs(); + }); + }, + + update_cp: function() { + var self = this; + this.update_control_panel( + {breadcrumbs: self.breadcrumbs}, {clear: true} + ); + }, + + get_emp_image_url: function(employee){ + return window.location.origin + '/web/image?model=hr.employee&field=image&id='+employee; + }, + + update_attendance: function () { + var self = this; + this._rpc({ + model: 'hr.employee', + method: 'attendance_manual', + args: [[self.login_employee.id], 'hr_attendance.hr_attendance_action_my_attendances'], + }) + .then(function(result) { + var attendance_state =self.login_employee.attendance_state; + var message = '' + var action_client = { + type: "ir.actions.client", + name: _t('Dashboard '), + tag: 'hr_dashboard', + }; + self.do_action(action_client, {clear_breadcrumbs: true}); + if (attendance_state == 'checked_in'){ + message = 'Checked Out' + } + else if (attendance_state == 'checked_out'){ + message = 'Checked In' + } + self.trigger_up('show_effect', { + message: _t("Successfully " + message), + type: 'rainbow_man' + }); + }); + + }, + + hr_payslip: function(e){ + var self = this; + e.stopPropagation(); + e.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + this.do_action({ + name: _t("Employee Payslips"), + type: 'ir.actions.act_window', + res_model: 'hr.payslip', + view_mode: 'tree,form,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'form']], + domain: [['employee_id','=', this.login_employee.id]], + target: 'current' + }, options) + }, + + hr_contract: function(e){ + var self = this; + e.stopPropagation(); + e.preventDefault(); + session.user_has_group('hr.group_hr_manager').then(function(has_group){ + if(has_group){ + var options = { + on_reverse_breadcrumb: self.on_reverse_breadcrumb, + }; + self.do_action({ + name: _t("Contracts"), + type: 'ir.actions.act_window', + res_model: 'hr.contract', + view_mode: 'tree,form,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'form']], + context: { + 'search_default_employee_id': self.login_employee.id, + }, + target: 'current' + }, options) + } + }); + + }, + + leaves_request_month: function(e) { + var self = this; + e.stopPropagation(); + e.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + var date = new Date(); + var firstDay = new Date(date.getFullYear(), date.getMonth(), 1); + var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0); + var fday = firstDay.toJSON().slice(0,10).replace(/-/g,'-'); + var lday = lastDay.toJSON().slice(0,10).replace(/-/g,'-'); + this.do_action({ + name: _t("This Month Leaves"), + type: 'ir.actions.act_window', + res_model: 'hr.leave', + view_mode: 'tree,form,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'form']], + domain: [['date_from','>', fday],['state','=','validate'],['date_from','<', lday]], + target: 'current' + }, options) + }, + + leaves_request_today: function(e) { + var self = this; + var date = new Date(); + e.stopPropagation(); + e.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + this.do_action({ + name: _t("Leaves Today"), + type: 'ir.actions.act_window', + res_model: 'hr.leave', + view_mode: 'tree,form,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'form']], + domain: [['date_from','<=', date], ['date_to', '>=', date], ['state','=','validate']], + target: 'current' + }, options) + }, + leaves_to_approve: function(e) { + var self = this; + e.stopPropagation(); + e.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + this.do_action({ + name: _t("Leave Request"), + type: 'ir.actions.act_window', + res_model: 'hr.leave', + view_mode: 'tree,form,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'form']], + domain: [['state','in',['confirm','validate1']]], + target: 'current' + }, options) + }, + leave_allocations_to_approve: function(e) { + var self = this; + e.stopPropagation(); + e.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + this.do_action({ + name: _t("Leave Allocation Request"), + type: 'ir.actions.act_window', + res_model: 'hr.leave.allocation', + view_mode: 'tree,form,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'form']], + domain: [['state','in',['confirm', 'validate1']]], + target: 'current' + }, options) + }, + + hr_timesheets: function(e) { + var self = this; + e.stopPropagation(); + e.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + this.do_action({ + name: _t("Timesheets"), + type: 'ir.actions.act_window', + res_model: 'account.analytic.line', + view_mode: 'tree,form', + view_type: 'form', + views: [[false, 'list'], [false, 'form']], + context: { + 'search_default_month': true, + }, + domain: [['employee_id','=', this.login_employee.id]], + target: 'current' + }, options) + }, + job_applications_to_approve: function(event){ + var self = this; + event.stopPropagation(); + event.preventDefault(); + var options = { + on_reverse_breadcrumb: this.on_reverse_breadcrumb, + }; + this.do_action({ + name: _t("Applications"), + type: 'ir.actions.act_window', + res_model: 'hr.applicant', + view_mode: 'tree,kanban,form,pivot,graph,calendar', + view_type: 'form', + views: [[false, 'list'],[false, 'kanban'],[false, 'form'], + [false, 'pivot'],[false, 'graph'],[false, 'calendar']], + context: {}, + target: 'current' + }, options) + }, + + render_department_employee:function(){ + var self = this; + var w = 200; + var h = 200; + var r = h/2; + var elem = this.$('.emp_graph'); +// var colors = ['#ff8762', '#5ebade', '#b298e1', '#70cac1', '#cf2030']; + var colors = ['#70cac1', '#659d4e', '#208cc2', '#4d6cb1', '#584999', '#8e559e', '#cf3650', '#f65337', '#fe7139', + '#ffa433', '#ffc25b', '#f8e54b']; + var color = d3.scale.ordinal().range(colors); + rpc.query({ + model: "hr.employee", + method: "get_dept_employee", + }).then(function (data) { + var segColor = {}; + var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")"); + var pie = d3.layout.pie().value(function(d){return d.value;}); + var arc = d3.svg.arc().outerRadius(r); + var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice"); + arcs.append("svg:path") + .attr("fill", function(d, i){ + return color(i); + }) + .attr("d", function (d) { + return arc(d); + }); + + var legend = d3.select(elem[0]).append("table").attr('class','legend'); + + // create one row per segment. + var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr"); + + // create the first column for each segment. + tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") + .attr("width", '16').attr("height", '16') + .attr("fill",function(d, i){ return color(i) }); + + // create the second column for each segment. + tr.append("td").text(function(d){ return d.label;}); + + // create the third column for each segment. + tr.append("td").attr("class",'legendFreq') + .text(function(d){ return d.value;}); + + + + }); + + }, + update_join_resign_trends: function(){ + var elem = this.$('.join_resign_trend'); + var colors = ['#70cac1', '#659d4e', '#208cc2', '#4d6cb1', '#584999', '#8e559e', '#cf3650', '#f65337', '#fe7139', + '#ffa433', '#ffc25b', '#f8e54b']; + var color = d3.scale.ordinal().range(colors); + rpc.query({ + model: "hr.employee", + method: "join_resign_trends", + }).then(function (data) { + data.forEach(function(d) { + d.values.forEach(function(d) { + d.l_month = d.l_month; + d.count = +d.count; + }); + }); + var margin = {top: 30, right: 10, bottom: 30, left: 30}, + width = 400 - margin.left - margin.right, + height = 250 - margin.top - margin.bottom; + + // Set the ranges + var x = d3.scale.ordinal() + .rangeRoundBands([0, width], 1); + + var y = d3.scale.linear() + .range([height, 0]); + + // Define the axes + var xAxis = d3.svg.axis().scale(x) + .orient("bottom"); + + var yAxis = d3.svg.axis().scale(y) + .orient("left").ticks(5); + + x.domain(data[0].values.map(function(d) { return d.l_month; })); + y.domain([0, d3.max(data[0].values, d => d.count)]) + + var svg = d3.select(elem[0]).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + // Add the X Axis + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + // Add the Y Axis + svg.append("g") + .attr("class", "y axis") + .call(yAxis); + + + var line = d3.svg.line() + .x(function(d) {return x(d.l_month); }) + .y(function(d) {return y(d.count); }); + + let lines = svg.append('g') + .attr('class', 'lines'); + + lines.selectAll('.line-group') + .data(data).enter() + .append('g') + .attr('class', 'line-group') + .append('path') + .attr('class', 'line') + .attr('d', function(d) { return line(d.values); }) + .style('stroke', (d, i) => color(i)); + + lines.selectAll("circle-group") + .data(data).enter() + .append("g") + .selectAll("circle") + .data(function(d) { return d.values;}).enter() + .append("g") + .attr("class", "circle") + .append("circle") + .attr("cx", function(d) { return x(d.l_month)}) + .attr("cy", function(d) { return y(d.count)}) + .attr("r", 3); + + var legend = d3.select(elem[0]).append("div").attr('class','legend'); + + var tr = legend.selectAll("div").data(data).enter().append("div"); + + tr.append("span").attr('class','legend_col').append("svg").attr("width", '16').attr("height", '16').append("rect") + .attr("width", '16').attr("height", '16') + .attr("fill",function(d, i){ return color(i) }); + + tr.append("span").attr('class','legend_col').text(function(d){ return d.name;}); + }); + }, + + update_monthly_attrition: function(){ + var elem = this.$('.attrition_rate'); + var colors = ['#70cac1', '#659d4e', '#208cc2', '#4d6cb1', '#584999', '#8e559e', '#cf3650', '#f65337', '#fe7139', + '#ffa433', '#ffc25b', '#f8e54b']; + var color = d3.scale.ordinal().range(colors); + rpc.query({ + model: "hr.employee", + method: "get_attrition_rate", + }).then(function (data) { + var margin = {top: 30, right: 20, bottom: 30, left: 80}, + width = 500 - margin.left - margin.right, + height = 250 - margin.top - margin.bottom; + + // Set the ranges + var x = d3.scale.ordinal() + .rangeRoundBands([0, width], 1); + + var y = d3.scale.linear() + .range([height, 0]); + + // Define the axes + var xAxis = d3.svg.axis().scale(x) + .orient("bottom"); + + var yAxis = d3.svg.axis().scale(y) + .orient("left").ticks(5); + + var valueline = d3.svg.line() + .x(function(d) { return x(d.month); }) + .y(function(d) { return y(d.attrition_rate); }); + + + var svg = d3.select(elem[0]).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + x.domain(data.map(function(d) { return d.month; })); + y.domain([0, d3.max(data, function(d) { return d.attrition_rate; })]); + + // Add the X Axis + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + // Add the Y Axis + svg.append("g") + .attr("class", "y axis") + .call(yAxis); + + svg.append("path") + .attr("class", "line") + .attr("d", valueline(data)); + + // Add the scatterplot + svg.selectAll("dot") + .data(data) + .enter().append("circle") + .attr("r", 3) + .attr("cx", function(d) { return x(d.month); }) + .attr("cy", function(d) { return y(d.attrition_rate); }) + .on("mouseover", function() { tooltip.style("display", null); + d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2) + }) + .on("mouseout", function() { tooltip.style("display", "none"); + d3.select(this).transition().duration(500).ease("in-out").attr('r', 3) + }) + .on("mousemove", function(d) { + var xPosition = d3.mouse(this)[0] - 15; + var yPosition = d3.mouse(this)[1] - 25; + tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); + tooltip.select("text").text(d.attrition_rate); + }); + + var tooltip = svg.append("g") + .attr("class", "tooltip") + .style("display", "none"); + + tooltip.append("rect") + .attr("width", 30) + .attr("height", 20) + .attr("fill", "black") + .style("opacity", 0.5); + + tooltip.append("text") + .attr("x", 15) + .attr("dy", "1.2em") + .style("text-anchor", "middle") + .attr("font-size", "12px") + .attr("font-weight", "bold"); + + }); + + }, + + update_leave_trend: function(){ + var self = this; + rpc.query({ + model: "hr.employee", + method: "employee_leave_trend", + }).then(function (data) { + var elem = self.$('.leave_trend'); + var margin = {top: 30, right: 20, bottom: 30, left: 80}, + width = 500 - margin.left - margin.right, + height = 250 - margin.top - margin.bottom; + + // Set the ranges + var x = d3.scale.ordinal() + .rangeRoundBands([0, width], 1); + + var y = d3.scale.linear() + .range([height, 0]); + + // Define the axes + var xAxis = d3.svg.axis().scale(x) + .orient("bottom"); + + var yAxis = d3.svg.axis().scale(y) + .orient("left").ticks(5); + + var valueline = d3.svg.line() + .x(function(d) { return x(d.l_month); }) + .y(function(d) { return y(d.leave); }); + + + var svg = d3.select(elem[0]).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + x.domain(data.map(function(d) { return d.l_month; })); + y.domain([0, d3.max(data, function(d) { return d.leave; })]); + + // Add the X Axis + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + // Add the Y Axis + svg.append("g") + .attr("class", "y axis") + .call(yAxis); + + svg.append("path") + .attr("class", "line") + .attr("d", valueline(data)); + + // Add the scatterplot + svg.selectAll("dot") + .data(data) + .enter().append("circle") + .attr("r", 3) + .attr("cx", function(d) { return x(d.l_month); }) + .attr("cy", function(d) { return y(d.leave); }) +// .on('mouseover', function() { d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2) }) +// .on('mouseout', function() { d3.select(this).transition().duration(500).ease("in-out").attr('r', 3) }); + .on("mouseover", function() { tooltip.style("display", null); + d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2) + }) + .on("mouseout", function() { tooltip.style("display", "none"); + d3.select(this).transition().duration(500).ease("in-out").attr('r', 3) + }) + .on("mousemove", function(d) { + var xPosition = d3.mouse(this)[0] - 15; + var yPosition = d3.mouse(this)[1] - 25; + tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); + tooltip.select("text").text(d.leave); + }); + + var tooltip = svg.append("g") + .attr("class", "tooltip") + .style("display", "none"); + + tooltip.append("rect") + .attr("width", 30) + .attr("height", 20) + .attr("fill", "black") + .style("opacity", 0.5); + + tooltip.append("text") + .attr("x", 15) + .attr("dy", "1.2em") + .style("text-anchor", "middle") + .attr("font-size", "12px") + .attr("font-weight", "bold"); + + }); + }, + + render_leave_graph:function(){ + var self = this; +// var color = d3.scale.category10(); + var colors = ['#70cac1', '#659d4e', '#208cc2', '#4d6cb1', '#584999', '#8e559e', '#cf3650', '#f65337', '#fe7139', + '#ffa433', '#ffc25b', '#f8e54b']; + var color = d3.scale.ordinal().range(colors); + rpc.query({ + model: "hr.employee", + method: "get_department_leave", + }).then(function (data) { + var fData = data[0]; + var dept = data[1]; + var id = self.$('.leave_graph')[0]; + var barColor = '#ff618a'; + // compute total for each state. + fData.forEach(function(d){ + var total = 0; + for (var dpt in dept){ + total += d.leave[dept[dpt]]; + } + d.total=total; + }); + + // function to handle histogram. + function histoGram(fD){ + var hG={}, hGDim = {t: 60, r: 0, b: 30, l: 0}; + hGDim.w = 350 - hGDim.l - hGDim.r, + hGDim.h = 200 - hGDim.t - hGDim.b; + + //create svg for histogram. + var hGsvg = d3.select(id).append("svg") + .attr("width", hGDim.w + hGDim.l + hGDim.r) + .attr("height", hGDim.h + hGDim.t + hGDim.b).append("g") + .attr("transform", "translate(" + hGDim.l + "," + hGDim.t + ")"); + + // create function for x-axis mapping. + var x = d3.scale.ordinal().rangeRoundBands([0, hGDim.w], 0.1) + .domain(fD.map(function(d) { return d[0]; })); + + // Add x-axis to the histogram svg. + hGsvg.append("g").attr("class", "x axis") + .attr("transform", "translate(0," + hGDim.h + ")") + .call(d3.svg.axis().scale(x).orient("bottom")); + + // Create function for y-axis map. + var y = d3.scale.linear().range([hGDim.h, 0]) + .domain([0, d3.max(fD, function(d) { return d[1]; })]); + + // Create bars for histogram to contain rectangles and freq labels. + var bars = hGsvg.selectAll(".bar").data(fD).enter() + .append("g").attr("class", "bar"); + + //create the rectangles. + bars.append("rect") + .attr("x", function(d) { return x(d[0]); }) + .attr("y", function(d) { return y(d[1]); }) + .attr("width", x.rangeBand()) + .attr("height", function(d) { return hGDim.h - y(d[1]); }) + .attr('fill',barColor) + .on("mouseover",mouseover)// mouseover is defined below. + .on("mouseout",mouseout);// mouseout is defined below. + + //Create the frequency labels above the rectangles. + bars.append("text").text(function(d){ return d3.format(",")(d[1])}) + .attr("x", function(d) { return x(d[0])+x.rangeBand()/2; }) + .attr("y", function(d) { return y(d[1])-5; }) + .attr("text-anchor", "middle"); + + function mouseover(d){ // utility function to be called on mouseover. + // filter for selected state. + var st = fData.filter(function(s){ return s.l_month == d[0];})[0], + nD = d3.keys(st.leave).map(function(s){ return {type:s, leave:st.leave[s]};}); + + // call update functions of pie-chart and legend. + pC.update(nD); + leg.update(nD); + } + + function mouseout(d){ // utility function to be called on mouseout. + // reset the pie-chart and legend. + pC.update(tF); + leg.update(tF); + } + + // create function to update the bars. This will be used by pie-chart. + hG.update = function(nD, color){ + // update the domain of the y-axis map to reflect change in frequencies. + y.domain([0, d3.max(nD, function(d) { return d[1]; })]); + + // Attach the new data to the bars. + var bars = hGsvg.selectAll(".bar").data(nD); + + // transition the height and color of rectangles. + bars.select("rect").transition().duration(500) + .attr("y", function(d) {return y(d[1]); }) + .attr("height", function(d) { return hGDim.h - y(d[1]); }) + .attr("fill", color); + + // transition the frequency labels location and change value. + bars.select("text").transition().duration(500) + .text(function(d){ return d3.format(",")(d[1])}) + .attr("y", function(d) {return y(d[1])-5; }); + } + return hG; + } + + // function to handle pieChart. + function pieChart(pD){ + var pC ={}, pieDim ={w:250, h: 250}; + pieDim.r = Math.min(pieDim.w, pieDim.h) / 2; + + // create svg for pie chart. + var piesvg = d3.select(id).append("svg") + .attr("width", pieDim.w).attr("height", pieDim.h).append("g") + .attr("transform", "translate("+pieDim.w/2+","+pieDim.h/2+")"); + + // create function to draw the arcs of the pie slices. + var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0); + + // create a function to compute the pie slice angles. + var pie = d3.layout.pie().sort(null).value(function(d) { return d.leave; }); + + // Draw the pie slices. + piesvg.selectAll("path").data(pie(pD)).enter().append("path").attr("d", arc) + .each(function(d) { this._current = d; }) + .attr("fill", function(d, i){return color(i);}) + .on("mouseover",mouseover).on("mouseout",mouseout); + + // create function to update pie-chart. This will be used by histogram. + pC.update = function(nD){ + piesvg.selectAll("path").data(pie(nD)).transition().duration(500) + .attrTween("d", arcTween); + } + // Utility function to be called on mouseover a pie slice. + function mouseover(d, i){ + // call the update function of histogram with new data. + hG.update(fData.map(function(v){ + return [v.l_month,v.leave[d.data.type]];}),color(i)); + } + //Utility function to be called on mouseout a pie slice. + function mouseout(d){ + // call the update function of histogram with all data. + hG.update(fData.map(function(v){ + return [v.l_month,v.total];}), barColor); + } + // Animating the pie-slice requiring a custom function which specifies + // how the intermediate paths should be drawn. + function arcTween(a) { + var i = d3.interpolate(this._current, a); + this._current = i(0); + return function(t) { return arc(i(t)); }; + } + return pC; + } + + // function to handle legend. + function legend(lD){ + var leg = {}; + + // create table for legend. + var legend = d3.select(id).append("table").attr('class','legend'); + + // create one row per segment. + var tr = legend.append("tbody").selectAll("tr").data(lD).enter().append("tr"); + + // create the first column for each segment. + tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") + .attr("width", '16').attr("height", '16') + .attr("fill", function(d, i){return color(i);}) + + // create the second column for each segment. + tr.append("td").text(function(d){ return d.type;}); + + // create the third column for each segment. + tr.append("td").attr("class",'legendFreq') + .text(function(d){ return d.l_month;}); + + // create the fourth column for each segment. + tr.append("td").attr("class",'legendPerc') + .text(function(d){ return getLegend(d,lD);}); + + // Utility function to be used to update the legend. + leg.update = function(nD){ + // update the data attached to the row elements. + var l = legend.select("tbody").selectAll("tr").data(nD); + + // update the frequencies. + l.select(".legendFreq").text(function(d){ return d3.format(",")(d.leave);}); + + // update the percentage column. + l.select(".legendPerc").text(function(d){ return getLegend(d,nD);}); + } + + function getLegend(d,aD){ // Utility function to compute percentage. + var perc = (d.leave/d3.sum(aD.map(function(v){ return v.leave; }))); + if (isNaN(perc)){ + return d3.format("%")(0); + } + else{ + return d3.format("%")(d.leave/d3.sum(aD.map(function(v){ return v.leave; }))); + } + } + + return leg; + } + // calculate total frequency by segment for all state. + var tF = dept.map(function(d){ + return {type:d, leave: d3.sum(fData.map(function(t){ return t.leave[d];}))}; + }); + + // calculate total frequency by state for all segment. + var sF = fData.map(function(d){return [d.l_month,d.total];}); + + var hG = histoGram(sF), // create the histogram. + pC = pieChart(tF), // create the pie-chart. + leg= legend(tF); // create the legend. + }); + }, + + +}); + + +core.action_registry.add('hr_dashboard', HrDashboard); + +return HrDashboard; + +}); diff --git a/hrms_dashboard/static/src/xml/hrms_dashboard.xml b/hrms_dashboard/static/src/xml/hrms_dashboard.xml new file mode 100644 index 00000000..534dd395 --- /dev/null +++ b/hrms_dashboard/static/src/xml/hrms_dashboard.xml @@ -0,0 +1,423 @@ + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +

    + + +

    +
    + +

    Add job title

    +
    +
    +
    +
    + +

    +

    Male

    +
    + +

    +

    Female

    +
    + + Other +

    Other

    +
    + +

    Gender

    +

    ---

    +
    + +
    +
    + +

    +

    Age

    +
    + +

    DOB

    +

    --/--/----

    +
    +
    +
    + +

    Joined

    +

    +

    Ago

    +
    + +

    Joined

    +

    Date

    +

    --/--/----

    +
    +
    +
    + +

    +

    Nationality

    +
    + +

    Nationality

    +

    - - -

    +
    +
    +
    + +

    +

    Mobile

    +
    + +

    Mobile

    +

    - - -

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    Payslips
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    Timesheets
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    Contracts
    +
    +
    +
    +
    +
    +
    + +