Skip to content

Commit

Permalink
[MIG] hr_skill: Migration to 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Duc Dao committed Nov 8, 2017
1 parent d8c9eee commit 5f68bac
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 50 deletions.
32 changes: 25 additions & 7 deletions hr_skill/README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

Employee Skills
===============

This module allows you to manage your company and employees skills.

Installation
============

Configuration
=============

Just install

Usage
=====

Known issues / Roadmap
======================
Expand All @@ -15,22 +26,29 @@ Contributions welcome.
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/hr/issues/new?body=module:%20hr_skill%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/hr/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.

Contributors
------------

* Savoir-faire Linux
* Daniel Reis
* Ivan Yelizariev
* Julien Laloux
* Duc, Dao Dong <duc.dd@komit-consulting.com> (https://komit-consulting.com)

Do not contact contributors directly about support or help with technical issues.

Maintainer
----------
Expand All @@ -45,4 +63,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
To contribute to this module, please visit https://odoo-community.org.
1 change: 0 additions & 1 deletion hr_skill/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

Expand Down
3 changes: 1 addition & 2 deletions hr_skill/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Skill Management",
"version": "10.0.1.0.0",
"version": "11.0.1.0.0",
"category": "Human Resources",
"license": "AGPL-3",
"author": "Savoir-faire Linux,Odoo Community Association (OCA)",
Expand Down
4 changes: 1 addition & 3 deletions hr_skill/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_skill
from . import hr_employee
from . import hr_skill
12 changes: 5 additions & 7 deletions hr_skill/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class Employee(models.Model):
_inherit = 'hr.employee'

skill_ids = fields.Many2many(
'hr.skill',
'skill_employee_rel',
'employee_id',
'skill_id',
'Skills',
comodel_name='hr.skill',
relation='skill_employee_rel',
column1='employee_id',
column2='skill_id',
string='Skills',
domain="[('child_ids', '=', False)]",
)
30 changes: 16 additions & 14 deletions hr_skill/models/hr_skill.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models, api
from odoo import api, fields, models


class Skill(models.Model):
_name = 'hr.skill'
_parent_store = True
_order = 'parent_left'

name = fields.Char('Name', required=True, translate=True)
active = fields.Boolean('Active', default=True)
parent_id = fields.Many2one('hr.skill', 'Parent', ondelete='cascade')
parent_left = fields.Integer('Parent Left', index=True)
parent_right = fields.Integer('Parent Right', index=True)
child_ids = fields.One2many('hr.skill', 'parent_id', 'Children')
name = fields.Char(string='Name', required=True, translate=True)
active = fields.Boolean(string='Active', default=True)
parent_id = fields.Many2one(comodel_name='hr.skill',
string='Parent',
ondelete='cascade')
parent_left = fields.Integer(string='Parent Left', index=True)
parent_right = fields.Integer(string='Parent Right', index=True)
child_ids = fields.One2many(comodel_name='hr.skill',
inverse_name='parent_id',
string='Children')
employee_ids = fields.Many2many(
'hr.employee',
'skill_employee_rel',
'skill_id',
'employee_id',
'Employee(s)')
comodel_name='hr.employee',
relation='skill_employee_rel',
column1='skill_id',
column2='employee_id',
string='Employee(s)')

@api.multi
def name_get(self):
Expand Down
1 change: 0 additions & 1 deletion hr_skill/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

Expand Down
13 changes: 6 additions & 7 deletions hr_skill/tests/test_hr_skill.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

Expand All @@ -8,13 +7,13 @@
class TestHrSkill(TransactionCase):

def test_name_get(self):
hr_skill_model = self.env['hr.skill']
soft_skill_id = hr_skill_model.create({'name': 'Soft skill'})
leadership_skill_id = hr_skill_model.create({
hr_skill_env = self.env['hr.skill']
soft_skill = hr_skill_env.create({'name': 'Soft skill'})
leadership_skill = hr_skill_env.create({
'name': 'Leadership',
'parent_id': soft_skill_id.id
'parent_id': soft_skill.id
})

self.assertEqual(
leadership_skill_id.name_get(),
[(leadership_skill_id.id, u'Soft skill / Leadership')])
leadership_skill.name_get(),
[(leadership_skill.id, 'Soft skill / Leadership')])
11 changes: 3 additions & 8 deletions hr_skill/views/hr_employee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Skills">
<field name="skill_ids" widget="many2many_tags"/>
<group>
<field name="skill_ids" widget="many2many_tags"/>
</group>
</page>
</notebook>
</field>
Expand All @@ -22,11 +24,4 @@
<field name="domain">[('skill_ids','child_of', active_ids)]</field>
</record>

<record id="hr_employee_skill_open" model="ir.values">
<field eval="'tree_but_open'" name="key2"/>
<field eval="'hr.skill'" name="model"/>
<field name="name">Employees by Skills</field>
<field eval="'ir.actions.act_window,%d'%hr_employee_normal_action_tree" name="value"/>
</record>

</odoo>

0 comments on commit 5f68bac

Please sign in to comment.