Skip to content

Commit

Permalink
Merge pull request #378 from leemannd/fix-jlaloux-migration_hr_skill
Browse files Browse the repository at this point in the history
[ADD][10.0]Fix jlaloux migration hr skill
  • Loading branch information
pedrobaeza committed Oct 12, 2017
2 parents 01e2fa3 + ae5699d commit 2b1fe8c
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 88 deletions.
1 change: 1 addition & 0 deletions hr_skill/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Contributors
* Savoir-faire Linux
* Daniel Reis
* Ivan Yelizariev
* Julien Laloux

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

from . import models
24 changes: 4 additions & 20 deletions hr_skill/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
#
###############################################################################
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Skill Management",
"version": "8.0.1.1.0",
"version": "10.0.1.0.0",
"category": "Human Resources",
"license": "AGPL-3",
"author": "Savoir-faire Linux,Odoo Community Association (OCA)",
Expand All @@ -31,5 +15,5 @@
"views/hr_employee.xml",
"security/ir.model.access.csv",
],
'installable': False,
'installable': True,
}
4 changes: 4 additions & 0 deletions hr_skill/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# -*- 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
22 changes: 3 additions & 19 deletions hr_skill/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
#
###############################################################################
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import fields, models
from odoo import fields, models


class Employee(models.Model):
Expand Down
22 changes: 3 additions & 19 deletions hr_skill/models/hr_skill.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>.
#
###############################################################################
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

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


class Skill(models.Model):
Expand Down
4 changes: 2 additions & 2 deletions hr_skill/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_skill","hr.skill","model_hr_skill",base.group_hr_user,1,0,0,0
"access_hr_skill_manager","hr.skill","model_hr_skill",base.group_hr_manager,1,1,1,1
"access_hr_skill","hr.skill","model_hr_skill","base.group_user",1,0,0,0
"access_hr_skill_manager","hr.skill","model_hr_skill","hr.group_hr_manager",1,1,1,1
5 changes: 5 additions & 0 deletions hr_skill/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2013 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

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

from odoo.tests.common import TransactionCase


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({
'name': 'Leadership',
'parent_id': soft_skill_id.id
})

self.assertEqual(
leadership_skill_id.name_get(),
[(leadership_skill_id.id, u'Soft skill / Leadership')])
8 changes: 3 additions & 5 deletions hr_skill/views/hr_employee.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<openerp>
<data>
<odoo>

<record id="view_employee_skill_form" model="ir.ui.view">
<field name="name">hr.employee.skill.form</field>
Expand All @@ -8,7 +7,7 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Skills">
<field name="skill_ids" />
<field name="skill_ids" widget="many2many_tags"/>
</page>
</notebook>
</field>
Expand All @@ -30,5 +29,4 @@
<field eval="'ir.actions.act_window,%d'%hr_employee_normal_action_tree" name="value"/>
</record>

</data>
</openerp>
</odoo>
28 changes: 5 additions & 23 deletions hr_skill/views/hr_skill.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<openerp>
<data>
<odoo>

<record id="view_hr_skill_tree" model="ir.ui.view">
<field name="name">hr.skill.tree</field>
Expand Down Expand Up @@ -34,10 +33,6 @@

<!-- Menu and Actions -->

<menuitem name="Skills Management"
parent="hr.menu_hr_configuration"
id="menu_hr_skill_mgt"/>

<record id="open_view_skill_form" model="ir.actions.act_window">
<field name="name">Skills</field>
<field name="res_model">hr.skill</field>
Expand All @@ -46,22 +41,9 @@
</record>

<menuitem name="Skills"
parent="menu_hr_skill_mgt"
parent="hr.menu_human_resources_configuration"
id="menu_open_view_skill_form"
action="open_view_skill_form"/>

<record id="open_view_skill_tree" model="ir.actions.act_window">
<field name="name">Skills Structure</field>
<field name="res_model">hr.skill</field>
<field name="view_type">tree</field>
<field name="view_id" ref="view_hr_skill_tree"/>
<field name="domain">[('parent_id','=',False)]</field>
</record>

<menuitem name="Skills Structure"
parent="menu_hr_skill_mgt"
id="menu_open_view_skill_tree"
action="open_view_skill_tree"/>
action="open_view_skill_form"
groups="base.group_no_one"/>

</data>
</openerp>
</odoo>

0 comments on commit 2b1fe8c

Please sign in to comment.