Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] Migration module hr_language in 10.0 #380

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hr_language/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Usage
=====

To use this module, you need to go to
*Human Resources* / *Configuration* / *Languages*.
*Employees* / *Configuration* / *Languages*.
Languages are also available on the employee form
(*Human Resources* / *Human Resources* / *Employees*).

Expand All @@ -25,6 +25,7 @@ Contributors
------------

* Savoir-faire Linux (http://www.savoirfairelinux.com)
* François Honoré <francois.honore@acsone.eu>

Maintainer
----------
Expand Down
36 changes: 8 additions & 28 deletions hr_language/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,21 @@
# -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# 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/>.
#
###############################################################################

# -*- coding: utf-8 -*-
# Copyright (C) 2017-Today: Odoo Community Association (OCA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Language Management",
"version": "8.0.0.1.0",
"version": "10.0.0.1.0",
"category": "Human Resources",
"license": "AGPL-3",
"author": "Savoir-faire Linux,Odoo Community Association (OCA)",
"author": "Savoir-faire Linux, Acsone, Odoo Community Association (OCA)",
"website": "http://www.savoirfairelinux.com",
"depends": [
"hr",
],
'data': [
'security/ir.model.access.csv',
'views/hr_language_view.xml',
'views/hr_employee.xml',
'views/hr_language.xml',
],
"demo": [],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

demo is empty and could be removed.

"test": [],
'installable': False,
"auto_install": False,
"images": [],
'installable': True,
}
12 changes: 9 additions & 3 deletions hr_language/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#
# Translators:
# Yannick Vaucher <yannick.vaucher@camptocamp.com>, 2015
# François Honoré <francois.honore@acsone.eu>, 2017
msgid ""
msgstr ""
"Project-Id-Version: hr (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-27 10:43+0000\n"
"PO-Revision-Date: 2015-10-06 14:06+0000\n"
"Last-Translator: Yannick Vaucher <yannick.vaucher@camptocamp.com>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-hr-8-0/language/fr/)\n"
"PO-Revision-Date: 2017-10-10 08:00+0000\n"
"Last-Translator: Yannick Vaucher <francois.honore@acsone.eu>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-hr-10-0/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
Expand Down Expand Up @@ -249,6 +250,11 @@ msgstr "Langue"
msgid "Languages"
msgstr "Langues"

#. module: hr_language
#: help:hr.employee,language_ids:0
msgid "Languages of this employee"
msgstr "Languages de cet employé"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Langues de cet employé".

"Language" translates to "Langue" in french, as "Langage" (and not "Language") has a different meaning.

So this should be fixed everythere in the french translation.


#. module: hr_language
#: selection:hr.language,name:0
msgid "Lao / ພາສາລາວ"
Expand Down
25 changes: 4 additions & 21 deletions hr_language/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# 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/>.
#
###############################################################################

# -*- coding: utf-8 -*-
# Copyright (C) 2017-Today: Odoo Community Association (OCA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import hr_language
from . import hr_employee
15 changes: 15 additions & 0 deletions hr_language/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2017-Today: Odoo Community Association (OCA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports should be alphabetically sorted



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

language_ids = fields.One2many(
'hr.language',
'employee_id',
"Languages",
help="Languages of this employee",
)
68 changes: 31 additions & 37 deletions hr_language/models/hr_language.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
# -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# 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/>.
#
###############################################################################
# -*- coding: utf-8 -*-
# Copyright (C) 2017-Today: Odoo Community Association (OCA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports should be alphabetically sorted


from openerp import tools
from openerp import models, fields


class hr_language(models.Model):
class HrLanguage(models.Model):
_name = 'hr.language'

name = fields.Selection(
tools.scan_languages(),
string=u"Language", required=True)
"Language",
required=True,
)
description = fields.Char(
string=u"Description", size=64, required=True)
"Description",
size=64,
required=True,
)
employee_id = fields.Many2one(
'hr.employee', string=u"Employee", required=True)
can_read = fields.Boolean(u"Read", default=True, oldname='read')
can_write = fields.Boolean(u"Write", default=True, oldname='write')
can_speak = fields.Boolean(u"Speak", default=True, oldname='speak')


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

language_ids = fields.One2many(
'hr.language', 'employee_id', u"Languages")
'hr.employee',
"Employee",
required=True,
)
can_read = fields.Boolean(
"Read",
default=True,
oldname='read',
)
can_write = fields.Boolean(
"Write",
default=True,
oldname='write',
)
can_speak = fields.Boolean(
"Speak",
default=True,
oldname='speak',
)
2 changes: 1 addition & 1 deletion hr_language/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_language_base_user","hr.language_base_user","model_hr_language",base.group_user,1,0,0,0
"access_hr_language","hr.language","model_hr_language",base.group_hr_user,1,1,1,1
"access_hr_language","hr.language","model_hr_language",hr.group_hr_user,1,1,1,1
Binary file modified hr_language/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions hr_language/views/hr_employee.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="hr_employee_form">
<field name="name">hr.employee.form (in hr_language)</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Languages" name="languages" groups="hr.group_hr_user">
<field name="language_ids" nolabel="1" colspan="4">
<tree string="Language" editable="bottom">
<field name="name"/>
<field name="description"/>
<field name="can_read"/>
<field name="can_write"/>
<field name="can_speak"/>
</tree>
</field>
</page>
</notebook>
</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
<openerp>
<data>
<!-- Employee -->
<record model="ir.ui.view" id="view_employee_form">
<field name="name">hr.language.employee.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Languages" groups="base.group_hr_user">
<field name="language_ids" nolabel="1" colspan="4">
<tree string="Language" editable="bottom">
<field name="name"/>
<field name="description"/>
<field name="can_read"/>
<field name="can_write"/>
<field name="can_speak"/>
</tree>
</field>
</page>
</notebook>
</field>
</record>

<odoo>
<!-- Language -->

<record model="ir.ui.view" id="view_language_tree">
<field name="name">hr.language.tree</field>
<field name="model">hr.language</field>
Expand Down Expand Up @@ -68,9 +44,7 @@
</record>

<menuitem name="Languages"
parent="hr.menu_hr_configuration"
parent="hr.menu_human_resources_configuration"
id="menu_open_view_language_form"
action="open_view_language_form"/>

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