Merge lp:~savoirfairelinux-openerp/openerp-hr/7.0-skill into lp:openerp-hr
- 7.0-skill
- Merge into 7.0
Proposed by
El Hadji Dem (http://www.savoirfairelinux.com)
Status: | Merged |
---|---|
Merged at revision: | 68 |
Proposed branch: | lp:~savoirfairelinux-openerp/openerp-hr/7.0-skill |
Merge into: | lp:openerp-hr |
Diff against target: |
339 lines (+306/-0) 6 files modified
hr_skill/__init__.py (+22/-0) hr_skill/__openerp__.py (+42/-0) hr_skill/hr_skill.py (+48/-0) hr_skill/hr_skill_view.xml (+99/-0) hr_skill/i18n/hr_skill.pot (+92/-0) hr_skill/security/ir.model.access.csv (+3/-0) |
To merge this branch: | bzr merge lp:~savoirfairelinux-openerp/openerp-hr/7.0-skill |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maxime Chambreuil (http://www.savoirfairelinux.com) | code review | Approve | |
Daniel Reis | Approve | ||
Review via email:
|
Commit message
Description of the change
[ADD] adds hr_skill module
To post a comment you must log in.
Revision history for this message

Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote : | # |
review:
Needs Fixing
(code review)
Revision history for this message

El Hadji Dem (http://www.savoirfairelinux.com) (eh-dem) wrote : | # |
> El Hadji,
>
> l81: Please fix the copyright.
>
> l144, 122: You don't need to instantiate a class in 7.0.
>
> Translation needs to be updated to reflect the new fields and views.
Ok maxime
Revision history for this message

Daniel Reis (dreis-pt) wrote : | # |
Looks good to me.
One remark: the domain for the employee skill_ids is defined on the form; wouldn't be better to have it on the model instead?
review:
Approve
- 72. By EL HADJI DEM <email address hidden>
-
[IMP] the domain for the employee skill ids is defined on the model instead on the form
Revision history for this message

Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
review:
Approve
(code review)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'hr_skill' |
2 | === added file 'hr_skill/__init__.py' |
3 | --- hr_skill/__init__.py 1970-01-01 00:00:00 +0000 |
4 | +++ hr_skill/__init__.py 2013-11-15 16:53:22 +0000 |
5 | @@ -0,0 +1,22 @@ |
6 | +# -*- encoding: utf-8 -*- |
7 | +############################################################################### |
8 | +# |
9 | +# OpenERP, Open Source Management Solution |
10 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
11 | +# |
12 | +# This program is free software: you can redistribute it and/or modify |
13 | +# it under the terms of the GNU Affero General Public License as |
14 | +# published by the Free Software Foundation, either version 3 of the |
15 | +# License, or (at your option) any later version. |
16 | +# |
17 | +# This program is distributed in the hope that it will be useful, |
18 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | +# GNU Affero General Public License for more details. |
21 | +# |
22 | +# You should have received a copy of the GNU Affero General Public License |
23 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | +# |
25 | +############################################################################### |
26 | +import hr_skill |
27 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
28 | |
29 | === added file 'hr_skill/__openerp__.py' |
30 | --- hr_skill/__openerp__.py 1970-01-01 00:00:00 +0000 |
31 | +++ hr_skill/__openerp__.py 2013-11-15 16:53:22 +0000 |
32 | @@ -0,0 +1,42 @@ |
33 | +# -*- encoding: utf-8 -*- |
34 | +############################################################################### |
35 | +# |
36 | +# OpenERP, Open Source Management Solution |
37 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
38 | +# |
39 | +# This program is free software: you can redistribute it and/or modify |
40 | +# it under the terms of the GNU Affero General Public License as |
41 | +# published by the Free Software Foundation, either version 3 of the |
42 | +# License, or (at your option) any later version. |
43 | +# |
44 | +# This program is distributed in the hope that it will be useful, |
45 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
46 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
47 | +# GNU Affero General Public License for more details. |
48 | +# |
49 | +# You should have received a copy of the GNU Affero General Public License |
50 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
51 | +# |
52 | +############################################################################### |
53 | + |
54 | +{ |
55 | + "name": "Skill Management", |
56 | + "version": "0.1", |
57 | + "category": "Human Resources", |
58 | + "license": "AGPL-3", |
59 | + "description": """ |
60 | + This module allows you to manage your company and employees skills. |
61 | + """, |
62 | + "author": "Savoir-faire Linux", |
63 | + "website": "http://www.savoirfairelinux.com", |
64 | + "depends": ["hr"], |
65 | + 'data': ["security/ir.model.access.csv", |
66 | + "hr_skill_view.xml", |
67 | + ], |
68 | + "demo": [], |
69 | + "test": [], |
70 | + "installable": True, |
71 | + "auto_install": False, |
72 | + "images": [], |
73 | +} |
74 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
75 | |
76 | === added file 'hr_skill/hr_skill.py' |
77 | --- hr_skill/hr_skill.py 1970-01-01 00:00:00 +0000 |
78 | +++ hr_skill/hr_skill.py 2013-11-15 16:53:22 +0000 |
79 | @@ -0,0 +1,48 @@ |
80 | +# -*- encoding: utf-8 -*- |
81 | +############################################################################### |
82 | +# |
83 | +# OpenERP, Open Source Management Solution |
84 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
85 | +# |
86 | +# This program is free software: you can redistribute it and/or modify |
87 | +# it under the terms of the GNU Affero General Public License as |
88 | +# published by the Free Software Foundation, either version 3 of the |
89 | +# License, or (at your option) any later version. |
90 | +# |
91 | +# This program is distributed in the hope that it will be useful, |
92 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
93 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
94 | +# GNU Affero General Public License for more details. |
95 | +# |
96 | +# You should have received a copy of the GNU Affero General Public License |
97 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
98 | +# |
99 | +############################################################################### |
100 | +from openerp.osv import fields, orm |
101 | + |
102 | +class hr_skill(orm.Model): |
103 | + _name = 'hr.skill' |
104 | + _columns = { |
105 | + 'name': fields.char('Name', size=64, required=True, translate=True), |
106 | + 'active': fields.boolean('Active'), |
107 | + 'parent_id': fields.many2one('hr.skill', 'Parent', ondelete='cascade'), |
108 | + 'child_ids': fields.one2many('hr.skill', 'parent_id', 'Children'), |
109 | + 'view': fields.selection([('view', 'View'), ('skill', 'Skill')], 'Skill', required=True), |
110 | + 'employee_ids': fields.many2many('hr.employee', 'skill_employee_rel', 'skill_id', 'employee_id', 'Employee(s)'), |
111 | + } |
112 | + _defaults = { |
113 | + 'view': lambda self, cr, uid, context: 'view', |
114 | + 'active': lambda self, cr, uid, context: 1 |
115 | + } |
116 | + |
117 | +class hr_employee(orm.Model): |
118 | + _inherit = 'hr.employee' |
119 | + _columns = { |
120 | + 'skill_ids': fields.many2many('hr.skill', |
121 | + 'skill_employee_rel', |
122 | + 'employee_id', |
123 | + 'skill_id', |
124 | + 'Skills', |
125 | + domain="[('view', '=', 'skill')]"), |
126 | + } |
127 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
128 | \ No newline at end of file |
129 | |
130 | === added file 'hr_skill/hr_skill_view.xml' |
131 | --- hr_skill/hr_skill_view.xml 1970-01-01 00:00:00 +0000 |
132 | +++ hr_skill/hr_skill_view.xml 2013-11-15 16:53:22 +0000 |
133 | @@ -0,0 +1,99 @@ |
134 | +<openerp> |
135 | + <data> |
136 | + |
137 | + <menuitem name="Skills Management" |
138 | + parent="hr.menu_hr_configuration" |
139 | + id="menu_hr_skill_mgt"/> |
140 | + |
141 | + <!-- Employee --> |
142 | + |
143 | + <record model="ir.ui.view" id="view_employee_skill_form"> |
144 | + <field name="name">hr.employee.skill.form</field> |
145 | + <field name="model">hr.employee</field> |
146 | + <field name="inherit_id" ref="hr.view_employee_form"/> |
147 | + <field name="type">form</field> |
148 | + <field name="arch" type="xml"> |
149 | + <notebook position="inside"> |
150 | + <page string="Skills"> |
151 | + <field name="skill_ids" nolabel="1"> |
152 | + <tree> |
153 | + <field name="name"/> |
154 | + </tree> |
155 | + </field> |
156 | + </page> |
157 | + </notebook> |
158 | + </field> |
159 | + </record> |
160 | + |
161 | + <!-- Skill --> |
162 | + |
163 | + <record model="ir.ui.view" id="view_skill_form"> |
164 | + <field name="name">hr.skill.form</field> |
165 | + <field name="model">hr.skill</field> |
166 | + <field name="type">form</field> |
167 | + <field name="arch" type="xml"> |
168 | + <form string="Skill"> |
169 | + <field name="name" select="1" colspan="1"/> |
170 | + <field name="active" select="1" /> |
171 | + <newline/> |
172 | + <field name="parent_id" select="1"/> |
173 | + <field name="view" select="1"/> |
174 | + </form> |
175 | + </field> |
176 | + </record> |
177 | + |
178 | + <record model="ir.actions.act_window" id="open_view_skill_form"> |
179 | + <field name="res_model">hr.skill</field> |
180 | + <field name="view_type">form</field> |
181 | + <field name="view_mode">tree,form</field> |
182 | + </record> |
183 | + |
184 | + <menuitem name="Skills" |
185 | + parent="menu_hr_skill_mgt" |
186 | + id="menu_open_view_skill_form" |
187 | + action="open_view_skill_form"/> |
188 | + |
189 | + <record model="ir.ui.view" id="view_hr_skill_tree"> |
190 | + <field name="name">hr.skill.tree</field> |
191 | + <field name="model">hr.skill</field> |
192 | + <field name="type">tree</field> |
193 | + <field name="field_parent">child_ids</field> |
194 | + <field name="arch" type="xml"> |
195 | + <tree string="Skills"> |
196 | + <field name="name"/> |
197 | + <field name="view"/> |
198 | + </tree> |
199 | + </field> |
200 | + </record> |
201 | + |
202 | + <record model="ir.actions.act_window" id="open_view_skill_tree"> |
203 | + <field name="name">Skills structure</field> |
204 | + <field name="res_model">hr.skill</field> |
205 | + <field name="view_type">tree</field> |
206 | + <field name="view_id" ref="view_hr_skill_tree"/> |
207 | + <field name="domain">[('parent_id','=',False)]</field> |
208 | + </record> |
209 | + |
210 | + <record id="hr_employee_normal_action_tree" model="ir.actions.act_window"> |
211 | + <field name="name">Employees</field> |
212 | + <field name="type">ir.actions.act_window</field> |
213 | + <field name="res_model">hr.employee</field> |
214 | + <field name="view_type">form</field> |
215 | + <field name="view_mode">tree,form</field> |
216 | + <field name="domain">[('skill_ids','=', active_ids)]</field> |
217 | + </record> |
218 | + |
219 | + <record id="hr_employee_skill_open" model="ir.values"> |
220 | + <field eval="'tree_but_open'" name="key2"/> |
221 | + <field eval="'hr.skill'" name="model"/> |
222 | + <field name="name">Employees by Skills</field> |
223 | + <field eval="'ir.actions.act_window,%d'%hr_employee_normal_action_tree" name="value"/> |
224 | + </record> |
225 | + |
226 | + <menuitem name="Skills Structure" |
227 | + parent="menu_hr_skill_mgt" |
228 | + id="menu_open_view_skill_tree" |
229 | + action="open_view_skill_tree"/> |
230 | + |
231 | + </data> |
232 | +</openerp> |
233 | |
234 | === added directory 'hr_skill/i18n' |
235 | === added file 'hr_skill/i18n/hr_skill.pot' |
236 | --- hr_skill/i18n/hr_skill.pot 1970-01-01 00:00:00 +0000 |
237 | +++ hr_skill/i18n/hr_skill.pot 2013-11-15 16:53:22 +0000 |
238 | @@ -0,0 +1,92 @@ |
239 | +# Translation of OpenERP Server. |
240 | +# This file contains the translation of the following modules: |
241 | +# * hr_skill |
242 | +# |
243 | +msgid "" |
244 | +msgstr "" |
245 | +"Project-Id-Version: OpenERP Server 7.0\n" |
246 | +"Report-Msgid-Bugs-To: \n" |
247 | +"POT-Creation-Date: 2013-11-14 22:11+0000\n" |
248 | +"PO-Revision-Date: 2013-11-14 22:11+0000\n" |
249 | +"Last-Translator: <>\n" |
250 | +"Language-Team: \n" |
251 | +"MIME-Version: 1.0\n" |
252 | +"Content-Type: text/plain; charset=UTF-8\n" |
253 | +"Content-Transfer-Encoding: \n" |
254 | +"Plural-Forms: \n" |
255 | + |
256 | +#. module: hr_skill |
257 | +#: field:hr.skill,name:0 |
258 | +msgid "Name" |
259 | +msgstr "" |
260 | + |
261 | +#. module: hr_skill |
262 | +#: field:hr.skill,parent_id:0 |
263 | +msgid "Parent" |
264 | +msgstr "" |
265 | + |
266 | +#. module: hr_skill |
267 | +#: model:ir.model,name:hr_skill.model_hr_skill |
268 | +msgid "hr.skill" |
269 | +msgstr "" |
270 | + |
271 | +#. module: hr_skill |
272 | +#: view:hr.employee:0 |
273 | +#: field:hr.employee,skill_ids:0 |
274 | +#: view:hr.skill:0 |
275 | +#: model:ir.ui.menu,name:hr_skill.menu_open_view_skill_form |
276 | +msgid "Skills" |
277 | +msgstr "" |
278 | + |
279 | +#. module: hr_skill |
280 | +#: model:ir.actions.act_window,name:hr_skill.hr_employee_normal_action_tree |
281 | +msgid "Employees" |
282 | +msgstr "" |
283 | + |
284 | +#. module: hr_skill |
285 | +#: model:ir.ui.menu,name:hr_skill.menu_open_view_skill_tree |
286 | +msgid "Skills Structure" |
287 | +msgstr "" |
288 | + |
289 | +#. module: hr_skill |
290 | +#: model:ir.model,name:hr_skill.model_hr_employee |
291 | +msgid "Employee" |
292 | +msgstr "" |
293 | + |
294 | +#. module: hr_skill |
295 | +#: model:ir.actions.act_window,name:hr_skill.open_view_skill_tree |
296 | +msgid "Skills structure" |
297 | +msgstr "" |
298 | + |
299 | +#. module: hr_skill |
300 | +#: field:hr.skill,employee_ids:0 |
301 | +msgid "Employee(s)" |
302 | +msgstr "" |
303 | + |
304 | +#. module: hr_skill |
305 | +#: model:ir.ui.menu,name:hr_skill.menu_hr_skill_mgt |
306 | +msgid "Skills Management" |
307 | +msgstr "" |
308 | + |
309 | +#. module: hr_skill |
310 | +#: field:hr.skill,active:0 |
311 | +msgid "Active" |
312 | +msgstr "" |
313 | + |
314 | +#. module: hr_skill |
315 | +#: view:hr.skill:0 |
316 | +#: field:hr.skill,view:0 |
317 | +#: selection:hr.skill,view:0 |
318 | +msgid "Skill" |
319 | +msgstr "" |
320 | + |
321 | +#. module: hr_skill |
322 | +#: field:hr.skill,child_ids:0 |
323 | +msgid "Children" |
324 | +msgstr "" |
325 | + |
326 | +#. module: hr_skill |
327 | +#: selection:hr.skill,view:0 |
328 | +msgid "View" |
329 | +msgstr "" |
330 | + |
331 | |
332 | === added directory 'hr_skill/security' |
333 | === added file 'hr_skill/security/ir.model.access.csv' |
334 | --- hr_skill/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
335 | +++ hr_skill/security/ir.model.access.csv 2013-11-15 16:53:22 +0000 |
336 | @@ -0,0 +1,3 @@ |
337 | +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
338 | +"access_hr_skill","hr.skill","model_hr_skill",base.group_hr_user,1,0,0,0 |
339 | +"access_hr_skill","hr.skill","model_hr_skill",base.group_hr_manager,1,1,1,1 |
El Hadji,
l81: Please fix the copyright.
l144, 122: You don't need to instantiate a class in 7.0.
Translation needs to be updated to reflect the new fields and views.