Browse Source

[ADD] Initial Commit

pull/30/merge
SHEREEF PT 8 years ago
parent
commit
c60d7d4fb6
  1. 24
      employee_check_list/__init__.py
  2. 45
      employee_check_list/__manifest__.py
  3. 26
      employee_check_list/models/__init__.py
  4. 86
      employee_check_list/models/employee_master_inherit.py
  5. 19
      employee_check_list/models/settings.py
  6. 2
      employee_check_list/security/ir.model.access.csv
  7. BIN
      employee_check_list/static/description/banner.jpg
  8. BIN
      employee_check_list/static/description/cybro_logo.png
  9. BIN
      employee_check_list/static/description/entry_checklist.png
  10. BIN
      employee_check_list/static/description/exit_checklist.png
  11. BIN
      employee_check_list/static/description/form_view.png
  12. BIN
      employee_check_list/static/description/icon.png
  13. 140
      employee_check_list/static/description/index.html
  14. BIN
      employee_check_list/static/description/kanban_view.png
  15. BIN
      employee_check_list/static/description/settings.png
  16. BIN
      employee_check_list/static/description/tree_view.png
  17. 37
      employee_check_list/views/checklist_view.xml
  18. 62
      employee_check_list/views/employee_form_inherit_view.xml
  19. 33
      employee_check_list/views/settings_view.xml

24
employee_check_list/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import models

45
employee_check_list/__manifest__.py

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Employee Checklist',
'version': '10.0.1.0.0',
'summary': """Manages Employee's Entry & Exit Process""",
'description': """This module is used to remembering the employee's entry and exit progress.""",
'category': "Human Resources",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'depends': ['base', 'employee_documents_expiry'],
'data': [
'security/ir.model.access.csv',
'views/employee_form_inherit_view.xml',
'views/checklist_view.xml',
'views/settings_view.xml',
],
'demo': [],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

26
employee_check_list/models/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import employee_master_inherit
import settings

86
employee_check_list/models/employee_master_inherit.py

@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields, api
class EmployeeMasterInherit(models.Model):
_inherit = 'hr.employee'
@api.depends('exit_checklist')
def exit_progress(self):
for each in self:
total_len = self.env['employee.checklist'].search_count([('document_type', '=', 'exit')])
entry_len = len(each.exit_checklist)
if total_len != 0:
each.exit_progress = (entry_len * 100) / total_len
@api.depends('entry_checklist')
def entry_progress(self):
for each in self:
total_len = self.env['employee.checklist'].search_count([('document_type', '=', 'entry')])
entry_len = len(each.entry_checklist)
if total_len != 0:
each.entry_progress = (entry_len*100) / total_len
entry_checklist = fields.Many2many('employee.checklist', 'entry_obj', 'check_hr_rel', 'hr_check_rel',
string='Entry Process',
domain=[('document_type', '=', 'entry')])
exit_checklist = fields.Many2many('employee.checklist', 'exit_obj', 'exit_hr_rel', 'hr_exit_rel',
string='Exit Process',
domain=[('document_type', '=', 'exit')])
entry_progress = fields.Float(compute=entry_progress, string='Entry Progress', store=True, default=0.0)
exit_progress = fields.Float(compute=exit_progress, string='Exit Progress', store=True, default=0.0)
maximum_rate = fields.Integer(default=100)
check_list_enable = fields.Boolean(invisible=True, copy=False)
class EmployeeDocumentInherit(models.Model):
_inherit = 'hr.employee.document'
@api.model
def create(self, vals):
result = super(EmployeeDocumentInherit, self).create(vals)
if result.document_name.document_type == 'entry':
result.employee_ref.write({'entry_checklist': [(4, result.document_name.id)]})
if result.document_name.document_type == 'exit':
result.employee_ref.write({'exit_checklist': [(4, result.document_name.id)]})
return result
@api.multi
def unlink(self):
for result in self:
if result.document_name.document_type == 'entry':
result.employee_ref.write({'entry_checklist': [(5, result.document_name.id)]})
if result.document_name.document_type == 'exit':
result.employee_ref.write({'exit_checklist': [(5, result.document_name.id)]})
res = super(EmployeeDocumentInherit, self).unlink()
return res
class EmployeeChecklistInherit(models.Model):
_inherit = 'employee.checklist'
entry_obj = fields.Many2many('hr.employee', 'entry_checklist', 'hr_check_rel', 'check_hr_rel',
invisible=1)
exit_obj = fields.Many2many('hr.employee', 'exit_checklist', 'hr_exit_rel', 'exit_hr_rel',
invisible=1)

19
employee_check_list/models/settings.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class MenuThemes(models.Model):
_name = 'hr.settings'
_inherit = 'res.config.settings'
enable_checklist = fields.Boolean(string='Enable Checklist Progress in Kanban?')
@api.multi
def set_enable_checklist(self):
ir_values = self.env['ir.values']
enable_checklist = self.enable_checklist
ir_values.set_default('hr.settings', 'enable_checklist', enable_checklist)
emp_obj = self.env['hr.employee'].search([])
for each in emp_obj:
each.write({'check_list_enable': enable_checklist})

2
employee_check_list/security/ir.model.access.csv

@ -0,0 +1,2 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_hr.settings_manager,hr.settings.manager,model_hr_settings,hr.group_hr_manager,1,1,1,1
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink
2 access_hr.settings_manager hr.settings.manager model_hr_settings hr.group_hr_manager 1 1 1 1

BIN
employee_check_list/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
employee_check_list/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
employee_check_list/static/description/entry_checklist.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
employee_check_list/static/description/exit_checklist.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
employee_check_list/static/description/form_view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
employee_check_list/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

140
employee_check_list/static/description/index.html

@ -0,0 +1,140 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Employee Exit/Entry Checklist</h2>
<h3 class="oe_slogan">Manages Employees Entry & Exit Process</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced" style="padding-left:65px;">
<h4>Features:</h4>
<div>
<span style="color:green;"> &#9745; </span> Managing entry/exit process.<br/>
<span style="color:green;"> &#9745; </span> Automatic process on document attachments.<br/>
<span style="color:green;"> &#9745; </span> Option to enable Gauge widget for employee kanban.<br/>
<span style="color:green;"> &#9745; </span> Entry/Exit Percentpie in employee form view.<br/>
<span style="color:green;"> &#9745; </span> Entry Progressbar in employee tree view.<br/>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32 text-justify" style="text-align: center;">
A well functioning human resource department will lay down a number procedure and process before an employee during joining/resigning time. It may be submission/Return of a certificate or attending a conference etc.
A person has to undergo all these checklist items before being admitted/resigned. The module simplifies the process by providing you a checklist to mark the proceedings. It will also display the PercentPie of an individual completed in the checklist entries.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div style="text-align: center">
<p>
<h4>Entry/Exit Checklist</h4>
<p>
</div>
<div style="text-align: center">
<a href="https://www.cybrosys.com">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="entry_checklist.png">
</div>
</a>
</div>
<div style="text-align: center">
<a href="https://www.cybrosys.com">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="exit_checklist.png">
</div>
</a>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div style="text-align: center">
<p>
<h4>Employee From View With PercentPie</h4>
</p>
</div>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="form_view.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div style="text-align: center">
<p>
<h4>Employee Tree View With Progressbar</h4>
</p>
</div>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="tree_view.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div style="text-align: center">
<p>
<h4>Employee Kanban View with Gauge</h4>
</p>
</div>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="kanban_view.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div style="text-align: center">
<p>
<h4>Configuration</h4>
</p>
</div>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="settings.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
employee_check_list/static/description/kanban_view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
employee_check_list/static/description/settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
employee_check_list/static/description/tree_view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

37
employee_check_list/views/checklist_view.xml

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="action_entry_checklist" model="ir.actions.act_window">
<field name="name">Entry Checklist</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">employee.checklist</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('document_type', '=', 'entry')]</field>
<field name="context">{"default_document_type":'entry'}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a New Entry Checklist
</p>
</field>
</record>
<record id="action_exit_checklist" model="ir.actions.act_window">
<field name="name">Exit Checklist</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">employee.checklist</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('document_type', '=', 'exit')]</field>
<field name="context">{"default_document_type":'exit'}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a New Exit Checklist
</p>
</field>
</record>
<menuitem id="employee_entry_checklist_menu" name="Entry Checklist" parent="hr.menu_human_resources_configuration" sequence="3"
action="action_entry_checklist"/>
<menuitem id="employee_exit_checklist_menu" name="Exit Checklist" parent="hr.menu_human_resources_configuration" sequence="4"
action="action_exit_checklist"/>
</odoo>

62
employee_check_list/views/employee_form_inherit_view.xml

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="hr_employee_inherit_form_view">
<field name="name">hr.employee.form.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="category_ids" position="after">
<div>
<field name="entry_progress" widget="percentpie"/>
<field name="exit_progress" widget="percentpie" class="oe_inline"/>
</div>
</field>
<page name="hr_settings" position="after">
<page name="checklist" string="Checklist">
<group>
<group name="entry_checklist" string="Entry Checklist">
<field name="entry_checklist" widget="many2many_checkboxes"/>
<field name="check_list_enable" invisible="1"/>
</group>
<group name="exit_checklist" string="Exit Checklist">
<field name="exit_checklist" widget="many2many_checkboxes"/>
</group>
</group>
</page>
</page>
</field>
</record>
<record model="ir.ui.view" id="hr_employee_inherit_tree_view">
<field name="name">hr.employee.tree.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<field name="message_needaction" position="after">
<field name="entry_progress" widget="progressbar"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="hr_employee_inherit_kanban_view">
<field name="name">hr.employee.kanban.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="entry_progress"/>
<field name="maximum_rate"/>
<field name="check_list_enable" invisible="1"/>
</xpath>
<xpath expr="//ul/li[6]" position="after">
<li t-if="record.check_list_enable.raw_value==1">
<field name="entry_progress" widget="gauge" style="width:120px;height:90px;cursor:pointer;"
options="{'max_field': 'maximum_rate'}">
Entry Progress
</field>
</li>
</xpath>
</field>
</record>
</odoo>

33
employee_check_list/views/settings_view.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="form_hr_settings" model="ir.ui.view">
<field name="name">hr.settings.form</field>
<field name="model">hr.settings</field>
<field name="arch" type="xml">
<form string="Hr Settings" class="oe_form_configuration">
<header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
or
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
<separator string="Entry Checklist"/>
<group>
<field name="enable_checklist"/>
</group>
</form>
</field>
</record>
<record id="action_hr_settings" model="ir.actions.act_window">
<field name="name">Hr Settings</field>
<field name="res_model">hr.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
</record>
<menuitem action="action_hr_settings" id="menu_settings" parent="hr.menu_human_resources_configuration"
groups="hr.group_hr_manager"
sequence="-1" name="Settings"/>
</data>
</odoo>
Loading…
Cancel
Save