Merge lp:~savoirfairelinux-openerp/openerp-hr/experience into lp:openerp-hr/6.1
- experience
- Merge into 6.1
Status: | Rejected |
---|---|
Rejected by: | Sandy Carter (http://www.savoirfairelinux.com) |
Proposed branch: | lp:~savoirfairelinux-openerp/openerp-hr/experience |
Merge into: | lp:openerp-hr/6.1 |
Diff against target: |
771 lines (+709/-0) 12 files modified
hr_experience/__init__.py (+26/-0) hr_experience/__openerp__.py (+59/-0) hr_experience/hr_academic.py (+52/-0) hr_experience/hr_academic_view.xml (+61/-0) hr_experience/hr_certification.py (+50/-0) hr_experience/hr_certification_view.xml (+59/-0) hr_experience/hr_experience_view.xml (+24/-0) hr_experience/hr_professional.py (+49/-0) hr_experience/hr_professional_view.xml (+55/-0) hr_experience/i18n/hr_experience.pot (+208/-0) hr_experience/security/hr_experience_security.xml (+62/-0) hr_experience/security/ir.model.access.csv (+4/-0) |
To merge this branch: | bzr merge lp:~savoirfairelinux-openerp/openerp-hr/experience |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Yannick Vaucher @ Camptocamp | code review, no tests | Needs Fixing | |
Joël Grand-Guillaume @ camptocamp | code review, no tests | Needs Fixing | |
Joao Alfredo Gama Batista | Needs Fixing | ||
Maxime Chambreuil (http://www.savoirfairelinux.com) | code review | Approve | |
Review via email: mp+194926@code.launchpad.net |
Commit message
Description of the change
[ADD] add hr_experience module.It adds a new menu in hr module and inherits the employee view form
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
Joao Alfredo Gama Batista (joao-gama) wrote : | # |
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
Hi,
Thanks for the contrib. A few remarks:
* Line 27-29 use from . import XY
* From a security point of view, is the hr_user the right person to create and delete the hr.academic, hr.professionnal, hr.certification object ? I would may be suggest hr_manager instead for that while keeping hr_user the read right, what do you think ?
Regards,
Joël
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote : | # |
Hello Joêl,
We want employees to be able to create and manage their own resume, including academic and professional experiences and certifications.
Our next step is to integrate with LinkedIn to allow the employee to import its LinkedIn data :
https:/
El Hadji Dem (http://www.savoirfairelinux.com) (eh-dem) wrote : | # |
Thnaks maxime
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
Looks good.
Just one thing about security, I think you just need some ir.rule to make sure hr_user1 can't modify hr_user2 experience data.
You might need a user_id field on all those objects.
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
1 month without activity, I set this as WIP
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote : | # |
Port of https:/
Unmerged revisions
- 313. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[ADD] Security rules
- 312. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Use specific term instead of partner.
- 311. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Update translation file
- 310. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[FIX] Based on MP reviews. Improve XML readability
- 309. By El Hadji Dem (http://www.savoirfairelinux.com)
-
[IMP] separate academic, certification and professional experiences, pep8
- 308. By El Hadji Dem (http://www.savoirfairelinux.com)
-
[IMP] separate academic, certification and professional experience, pep8
- 307. By EL HADJI DEM <email address hidden>
-
[IMP] add pot file
- 306. By EL HADJI DEM <email address hidden>
-
[ADD] add hr_experience module
Preview Diff
1 | === added directory 'hr_experience' | |||
2 | === added file 'hr_experience/__init__.py' | |||
3 | --- hr_experience/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ hr_experience/__init__.py 2014-04-21 15:39:45 +0000 | |||
5 | @@ -0,0 +1,26 @@ | |||
6 | 1 | # -*- encoding: utf-8 -*- | ||
7 | 2 | ############################################################################### | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
11 | 6 | # | ||
12 | 7 | # This program is free software: you can redistribute it and/or modify | ||
13 | 8 | # it under the terms of the GNU Affero General Public License as | ||
14 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
15 | 10 | # License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU Affero General Public License for more details. | ||
21 | 16 | # | ||
22 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
23 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 19 | # | ||
25 | 20 | ############################################################################### | ||
26 | 21 | |||
27 | 22 | from . import hr_academic | ||
28 | 23 | from . import hr_professional | ||
29 | 24 | from . import hr_certification | ||
30 | 25 | |||
31 | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
32 | 0 | 27 | ||
33 | === added file 'hr_experience/__openerp__.py' | |||
34 | --- hr_experience/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
35 | +++ hr_experience/__openerp__.py 2014-04-21 15:39:45 +0000 | |||
36 | @@ -0,0 +1,59 @@ | |||
37 | 1 | # -*- encoding: utf-8 -*- | ||
38 | 2 | ############################################################################### | ||
39 | 3 | # | ||
40 | 4 | # OpenERP, Open Source Management Solution | ||
41 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
42 | 6 | # | ||
43 | 7 | # This program is free software: you can redistribute it and/or modify | ||
44 | 8 | # it under the terms of the GNU Affero General Public License as | ||
45 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
46 | 10 | # License, or (at your option) any later version. | ||
47 | 11 | # | ||
48 | 12 | # This program is distributed in the hope that it will be useful, | ||
49 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
50 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
51 | 15 | # GNU Affero General Public License for more details. | ||
52 | 16 | # | ||
53 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
54 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
55 | 19 | # | ||
56 | 20 | ############################################################################### | ||
57 | 21 | |||
58 | 22 | { | ||
59 | 23 | "name": "Experience Management", | ||
60 | 24 | "version": "0.1", | ||
61 | 25 | "author": "Savoir-faire Linux", | ||
62 | 26 | "maintainer": 'Savoir-faire Linux', | ||
63 | 27 | "website": "http://www.savoirfairelinux.com", | ||
64 | 28 | "category": "Human Resources", | ||
65 | 29 | "description": """ | ||
66 | 30 | Experience Management | ||
67 | 31 | ===================== | ||
68 | 32 | |||
69 | 33 | This module allows you to manage your employee experiences: | ||
70 | 34 | * Professional | ||
71 | 35 | * Academic | ||
72 | 36 | * Certification | ||
73 | 37 | |||
74 | 38 | Contributors | ||
75 | 39 | ------------ | ||
76 | 40 | * El Hadji DEM <elhaji.dem@savoirfairelinux.com> | ||
77 | 41 | * Maxime Chambreuil <maxime.chambreuil@savoirfairelinux.com> | ||
78 | 42 | """, | ||
79 | 43 | |||
80 | 44 | "depends": ["hr"], | ||
81 | 45 | 'external_dependencies': {}, | ||
82 | 46 | 'data': [ | ||
83 | 47 | "security/ir.model.access.csv", | ||
84 | 48 | "security/hr_experience_security.xml", | ||
85 | 49 | "hr_experience_view.xml", | ||
86 | 50 | "hr_academic_view.xml", | ||
87 | 51 | "hr_professional_view.xml", | ||
88 | 52 | "hr_certification_view.xml", | ||
89 | 53 | ], | ||
90 | 54 | "demo": [], | ||
91 | 55 | "test": [], | ||
92 | 56 | "installable": True, | ||
93 | 57 | "active": False, | ||
94 | 58 | } | ||
95 | 59 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
96 | 0 | 60 | ||
97 | === added file 'hr_experience/hr_academic.py' | |||
98 | --- hr_experience/hr_academic.py 1970-01-01 00:00:00 +0000 | |||
99 | +++ hr_experience/hr_academic.py 2014-04-21 15:39:45 +0000 | |||
100 | @@ -0,0 +1,52 @@ | |||
101 | 1 | # -*- encoding: utf-8 -*- | ||
102 | 2 | ############################################################################### | ||
103 | 3 | # | ||
104 | 4 | # OpenERP, Open Source Management Solution | ||
105 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
106 | 6 | # | ||
107 | 7 | # This program is free software: you can redistribute it and/or modify | ||
108 | 8 | # it under the terms of the GNU Affero General Public License as | ||
109 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
110 | 10 | # License, or (at your option) any later version. | ||
111 | 11 | # | ||
112 | 12 | # This program is distributed in the hope that it will be useful, | ||
113 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
114 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
115 | 15 | # GNU Affero General Public License for more details. | ||
116 | 16 | # | ||
117 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
118 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
119 | 19 | # | ||
120 | 20 | ############################################################################### | ||
121 | 21 | |||
122 | 22 | from openerp.osv import fields, orm | ||
123 | 23 | |||
124 | 24 | |||
125 | 25 | class hr_academic(orm.Model): | ||
126 | 26 | _name = 'hr.academic' | ||
127 | 27 | _columns = { | ||
128 | 28 | 'name': fields.char('Name', size=64, required=True, translate=True), | ||
129 | 29 | 'employee_id': fields.many2one('hr.employee', 'Employee', required=True), | ||
130 | 30 | 'start_date': fields.date('Start date'), | ||
131 | 31 | 'end_date': fields.date('End date'), | ||
132 | 32 | 'description': fields.text('Description', translate=True), | ||
133 | 33 | 'partner_id': fields.many2one('res.partner', 'School or University'), | ||
134 | 34 | 'location': fields.char('Location', size=64, translate=True), | ||
135 | 35 | 'diploma': fields.char('Diploma', size=64, translate=True), | ||
136 | 36 | 'study_field': fields.char('Field of study', size=64, translate=True), | ||
137 | 37 | 'activities': fields.text('Activities and associations', translate=True), | ||
138 | 38 | 'expire': fields.boolean('Expire'), | ||
139 | 39 | } | ||
140 | 40 | |||
141 | 41 | _defaults = { | ||
142 | 42 | 'expire': True, | ||
143 | 43 | } | ||
144 | 44 | |||
145 | 45 | |||
146 | 46 | class hr_employee(orm.Model): | ||
147 | 47 | _inherit = 'hr.employee' | ||
148 | 48 | _columns = { | ||
149 | 49 | 'academic_ids': fields.one2many('hr.academic', 'employee_id', 'Academic experiences'), | ||
150 | 50 | } | ||
151 | 51 | |||
152 | 52 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
153 | 0 | 53 | ||
154 | === added file 'hr_experience/hr_academic_view.xml' | |||
155 | --- hr_experience/hr_academic_view.xml 1970-01-01 00:00:00 +0000 | |||
156 | +++ hr_experience/hr_academic_view.xml 2014-04-21 15:39:45 +0000 | |||
157 | @@ -0,0 +1,61 @@ | |||
158 | 1 | <openerp> | ||
159 | 2 | <data> | ||
160 | 3 | |||
161 | 4 | <!-- academic tree--> | ||
162 | 5 | <record model="ir.ui.view" id="view_academic_tree"> | ||
163 | 6 | <field name="name">hr.academic.tree</field> | ||
164 | 7 | <field name="model">hr.academic</field> | ||
165 | 8 | <field name="type">tree</field> | ||
166 | 9 | <field name="arch" type="xml"> | ||
167 | 10 | <tree string="Academic experiences"> | ||
168 | 11 | <field name="name"/> | ||
169 | 12 | <field name="employee_id"/> | ||
170 | 13 | <field name="partner_id"/> | ||
171 | 14 | <field name="start_date"/> | ||
172 | 15 | <field name="end_date"/> | ||
173 | 16 | </tree> | ||
174 | 17 | </field> | ||
175 | 18 | </record> | ||
176 | 19 | |||
177 | 20 | <!-- academic form--> | ||
178 | 21 | <record model="ir.ui.view" id="view_academic_form"> | ||
179 | 22 | <field name="name">hr.academic.form</field> | ||
180 | 23 | <field name="model">hr.academic</field> | ||
181 | 24 | <field name="type">form</field> | ||
182 | 25 | <field name="arch" type="xml"> | ||
183 | 26 | <form string="Academic experience"> | ||
184 | 27 | <field name="name"/> | ||
185 | 28 | <field name="employee_id"/> | ||
186 | 29 | <separator string="Dates" colspan="4"/> | ||
187 | 30 | <field name="start_date"/> | ||
188 | 31 | <field name="expire"/> | ||
189 | 32 | <field name="end_date" attrs="{'invisible':[('expire', '=', False)]}"/> | ||
190 | 33 | <separator string="Partner information" colspan="4"/> | ||
191 | 34 | <field name="partner_id"/> | ||
192 | 35 | <field name="location"/> | ||
193 | 36 | <group colspan="4"> | ||
194 | 37 | <separator string="Academic information" colspan="4"/> | ||
195 | 38 | <field name="diploma" /> | ||
196 | 39 | <field name="study_field"/> | ||
197 | 40 | <field name="activities"/> | ||
198 | 41 | </group> | ||
199 | 42 | <separator string="Description" colspan="4"/> | ||
200 | 43 | <field name="description" colspan="4" nolabel="1"/> | ||
201 | 44 | </form> | ||
202 | 45 | </field> | ||
203 | 46 | </record> | ||
204 | 47 | |||
205 | 48 | <!-- Menu --> | ||
206 | 49 | <record model="ir.actions.act_window" id="open_view_academic_form"> | ||
207 | 50 | <field name="res_model">hr.academic</field> | ||
208 | 51 | <field name="view_type">form</field> | ||
209 | 52 | <field name="view_mode">tree,form</field> | ||
210 | 53 | </record> | ||
211 | 54 | |||
212 | 55 | <menuitem name="Academic Experiences" | ||
213 | 56 | parent="hr.menu_hr_configuration" | ||
214 | 57 | id="menu_open_view_academic_form" | ||
215 | 58 | action="open_view_academic_form"/> | ||
216 | 59 | |||
217 | 60 | </data> | ||
218 | 61 | </openerp> | ||
219 | 0 | 62 | ||
220 | === added file 'hr_experience/hr_certification.py' | |||
221 | --- hr_experience/hr_certification.py 1970-01-01 00:00:00 +0000 | |||
222 | +++ hr_experience/hr_certification.py 2014-04-21 15:39:45 +0000 | |||
223 | @@ -0,0 +1,50 @@ | |||
224 | 1 | # -*- encoding: utf-8 -*- | ||
225 | 2 | ############################################################################### | ||
226 | 3 | # | ||
227 | 4 | # OpenERP, Open Source Management Solution | ||
228 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
229 | 6 | # | ||
230 | 7 | # This program is free software: you can redistribute it and/or modify | ||
231 | 8 | # it under the terms of the GNU Affero General Public License as | ||
232 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
233 | 10 | # License, or (at your option) any later version. | ||
234 | 11 | # | ||
235 | 12 | # This program is distributed in the hope that it will be useful, | ||
236 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
237 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
238 | 15 | # GNU Affero General Public License for more details. | ||
239 | 16 | # | ||
240 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
241 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
242 | 19 | # | ||
243 | 20 | ############################################################################### | ||
244 | 21 | |||
245 | 22 | from openerp.osv import fields, orm | ||
246 | 23 | |||
247 | 24 | |||
248 | 25 | class hr_certification(orm.Model): | ||
249 | 26 | _name = 'hr.certification' | ||
250 | 27 | _columns = { | ||
251 | 28 | 'name': fields.char('Name', size=64, required=True, translate=True), | ||
252 | 29 | 'employee_id': fields.many2one('hr.employee', 'Employee', required=True), | ||
253 | 30 | 'start_date': fields.date('Start date'), | ||
254 | 31 | 'end_date': fields.date('End date'), | ||
255 | 32 | 'description': fields.text('Description', translate=True), | ||
256 | 33 | 'partner_id': fields.many2one('res.partner', 'Certification Authority'), | ||
257 | 34 | 'location': fields.char('Location', size=64, translate=True), | ||
258 | 35 | 'certification': fields.char('Certification Number', size=64), | ||
259 | 36 | 'expire': fields.boolean('Expire'), | ||
260 | 37 | } | ||
261 | 38 | |||
262 | 39 | _defaults = { | ||
263 | 40 | 'expire': True, | ||
264 | 41 | } | ||
265 | 42 | |||
266 | 43 | |||
267 | 44 | class hr_employee(orm.Model): | ||
268 | 45 | _inherit = 'hr.employee' | ||
269 | 46 | _columns = { | ||
270 | 47 | 'certification_ids': fields.one2many('hr.certification', 'employee_id', 'Certifications'), | ||
271 | 48 | } | ||
272 | 49 | |||
273 | 50 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
274 | 0 | 51 | ||
275 | === added file 'hr_experience/hr_certification_view.xml' | |||
276 | --- hr_experience/hr_certification_view.xml 1970-01-01 00:00:00 +0000 | |||
277 | +++ hr_experience/hr_certification_view.xml 2014-04-21 15:39:45 +0000 | |||
278 | @@ -0,0 +1,59 @@ | |||
279 | 1 | <openerp> | ||
280 | 2 | <data> | ||
281 | 3 | |||
282 | 4 | <!-- certification tree --> | ||
283 | 5 | <record model="ir.ui.view" id="view_certification_tree"> | ||
284 | 6 | <field name="name">hr.certification.tree</field> | ||
285 | 7 | <field name="model">hr.certification</field> | ||
286 | 8 | <field name="type">tree</field> | ||
287 | 9 | <field name="arch" type="xml"> | ||
288 | 10 | <tree string="certifications"> | ||
289 | 11 | <field name="name"/> | ||
290 | 12 | <field name="employee_id"/> | ||
291 | 13 | <field name="partner_id"/> | ||
292 | 14 | <field name="start_date"/> | ||
293 | 15 | <field name="end_date"/> | ||
294 | 16 | </tree> | ||
295 | 17 | </field> | ||
296 | 18 | </record> | ||
297 | 19 | |||
298 | 20 | <!-- certification tree --> | ||
299 | 21 | <record model="ir.ui.view" id="view_certification_form"> | ||
300 | 22 | <field name="name">hr.certification.form</field> | ||
301 | 23 | <field name="model">hr.certification</field> | ||
302 | 24 | <field name="type">form</field> | ||
303 | 25 | <field name="arch" type="xml"> | ||
304 | 26 | <form string="Certification"> | ||
305 | 27 | <field name="name"/> | ||
306 | 28 | <field name="employee_id"/> | ||
307 | 29 | <separator string="Dates" colspan="4"/> | ||
308 | 30 | <field name="start_date"/> | ||
309 | 31 | <field name="expire"/> | ||
310 | 32 | <field name="end_date" attrs="{'invisible':[('expire', '=', False)]}"/> | ||
311 | 33 | <separator string="Partner information" colspan="4"/> | ||
312 | 34 | <field name="partner_id"/> | ||
313 | 35 | <field name="location"/> | ||
314 | 36 | <group colspan="4"> | ||
315 | 37 | <separator string="Certification information" colspan="4"/> | ||
316 | 38 | <field name="certification"/> | ||
317 | 39 | </group> | ||
318 | 40 | <separator string="Description" colspan="4"/> | ||
319 | 41 | <field name="description" colspan="4" nolabel="1"/> | ||
320 | 42 | </form> | ||
321 | 43 | </field> | ||
322 | 44 | </record> | ||
323 | 45 | |||
324 | 46 | <!-- Menu --> | ||
325 | 47 | <record model="ir.actions.act_window" id="open_view_certification_form"> | ||
326 | 48 | <field name="res_model">hr.certification</field> | ||
327 | 49 | <field name="view_type">form</field> | ||
328 | 50 | <field name="view_mode">tree,form</field> | ||
329 | 51 | </record> | ||
330 | 52 | |||
331 | 53 | <menuitem name="Certifications" | ||
332 | 54 | parent="hr.menu_hr_configuration" | ||
333 | 55 | id="menu_open_view_certification_form" | ||
334 | 56 | action="open_view_certification_form"/> | ||
335 | 57 | |||
336 | 58 | </data> | ||
337 | 59 | </openerp> | ||
338 | 0 | 60 | ||
339 | === added file 'hr_experience/hr_experience_view.xml' | |||
340 | --- hr_experience/hr_experience_view.xml 1970-01-01 00:00:00 +0000 | |||
341 | +++ hr_experience/hr_experience_view.xml 2014-04-21 15:39:45 +0000 | |||
342 | @@ -0,0 +1,24 @@ | |||
343 | 1 | <openerp> | ||
344 | 2 | <data> | ||
345 | 3 | <!-- inheritEmployee --> | ||
346 | 4 | <record model="ir.ui.view" id="view_employee_form_inherit"> | ||
347 | 5 | <field name="name">hr.experience.employee.form</field> | ||
348 | 6 | <field name="model">hr.employee</field> | ||
349 | 7 | <field name="inherit_id" ref="hr.view_employee_form"/> | ||
350 | 8 | <field name="type">form</field> | ||
351 | 9 | <field name="arch" type="xml"> | ||
352 | 10 | <notebook position="inside"> | ||
353 | 11 | <page string="Academic"> | ||
354 | 12 | <field name="academic_ids" nolabel="1" colspan="4"/> | ||
355 | 13 | </page> | ||
356 | 14 | <page string="Professional"> | ||
357 | 15 | <field name="professional_ids" nolabel="1" colspan="4"/> | ||
358 | 16 | </page> | ||
359 | 17 | <page string="Certification"> | ||
360 | 18 | <field name="certification_ids" nolabel="1" colspan="4"/> | ||
361 | 19 | </page> | ||
362 | 20 | </notebook> | ||
363 | 21 | </field> | ||
364 | 22 | </record> | ||
365 | 23 | </data> | ||
366 | 24 | </openerp> | ||
367 | 0 | 25 | ||
368 | === added file 'hr_experience/hr_professional.py' | |||
369 | --- hr_experience/hr_professional.py 1970-01-01 00:00:00 +0000 | |||
370 | +++ hr_experience/hr_professional.py 2014-04-21 15:39:45 +0000 | |||
371 | @@ -0,0 +1,49 @@ | |||
372 | 1 | # -*- encoding: utf-8 -*- | ||
373 | 2 | ############################################################################### | ||
374 | 3 | # | ||
375 | 4 | # OpenERP, Open Source Management Solution | ||
376 | 5 | # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
377 | 6 | # | ||
378 | 7 | # This program is free software: you can redistribute it and/or modify | ||
379 | 8 | # it under the terms of the GNU Affero General Public License as | ||
380 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
381 | 10 | # License, or (at your option) any later version. | ||
382 | 11 | # | ||
383 | 12 | # This program is distributed in the hope that it will be useful, | ||
384 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
385 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
386 | 15 | # GNU Affero General Public License for more details. | ||
387 | 16 | # | ||
388 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
389 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
390 | 19 | # | ||
391 | 20 | ############################################################################### | ||
392 | 21 | |||
393 | 22 | from openerp.osv import fields, orm | ||
394 | 23 | |||
395 | 24 | |||
396 | 25 | class hr_professional(orm.Model): | ||
397 | 26 | _name = 'hr.professional' | ||
398 | 27 | _columns = { | ||
399 | 28 | 'name': fields.char('Name', size=64, required=True, translate=True), | ||
400 | 29 | 'employee_id': fields.many2one('hr.employee', 'Employee', required=True), | ||
401 | 30 | 'start_date': fields.date('Start date'), | ||
402 | 31 | 'end_date': fields.date('End date'), | ||
403 | 32 | 'description': fields.text('Description', translate=True), | ||
404 | 33 | 'partner_id': fields.many2one('res.partner', 'Employer'), | ||
405 | 34 | 'location': fields.char('Location', size=64, translate=True), | ||
406 | 35 | 'expire': fields.boolean('Expire'), | ||
407 | 36 | } | ||
408 | 37 | |||
409 | 38 | _defaults = { | ||
410 | 39 | 'expire': True, | ||
411 | 40 | } | ||
412 | 41 | |||
413 | 42 | |||
414 | 43 | class hr_employee(orm.Model): | ||
415 | 44 | _inherit = 'hr.employee' | ||
416 | 45 | _columns = { | ||
417 | 46 | 'professional_ids': fields.one2many('hr.professional', 'employee_id', ' Professional Experiences'), | ||
418 | 47 | } | ||
419 | 48 | |||
420 | 49 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
421 | 0 | 50 | ||
422 | === added file 'hr_experience/hr_professional_view.xml' | |||
423 | --- hr_experience/hr_professional_view.xml 1970-01-01 00:00:00 +0000 | |||
424 | +++ hr_experience/hr_professional_view.xml 2014-04-21 15:39:45 +0000 | |||
425 | @@ -0,0 +1,55 @@ | |||
426 | 1 | <openerp> | ||
427 | 2 | <data> | ||
428 | 3 | |||
429 | 4 | <!-- professional tree --> | ||
430 | 5 | <record model="ir.ui.view" id="view_professional_tree"> | ||
431 | 6 | <field name="name">hr.professional.tree</field> | ||
432 | 7 | <field name="model">hr.professional</field> | ||
433 | 8 | <field name="type">tree</field> | ||
434 | 9 | <field name="arch" type="xml"> | ||
435 | 10 | <tree string="Professional Experiences"> | ||
436 | 11 | <field name="name"/> | ||
437 | 12 | <field name="employee_id"/> | ||
438 | 13 | <field name="partner_id"/> | ||
439 | 14 | <field name="start_date"/> | ||
440 | 15 | <field name="end_date"/> | ||
441 | 16 | </tree> | ||
442 | 17 | </field> | ||
443 | 18 | </record> | ||
444 | 19 | |||
445 | 20 | <!-- professional form --> | ||
446 | 21 | <record model="ir.ui.view" id="view_professional_form"> | ||
447 | 22 | <field name="name">hr.professional.form</field> | ||
448 | 23 | <field name="model">hr.professional</field> | ||
449 | 24 | <field name="type">form</field> | ||
450 | 25 | <field name="arch" type="xml"> | ||
451 | 26 | <form string="Professional Experience"> | ||
452 | 27 | <field name="name"/> | ||
453 | 28 | <field name="employee_id"/> | ||
454 | 29 | <separator string="Dates" colspan="4"/> | ||
455 | 30 | <field name="start_date"/> | ||
456 | 31 | <field name="expire"/> | ||
457 | 32 | <field name="end_date" attrs="{'invisible':[('expire', '=', False)]}"/> | ||
458 | 33 | <separator string="Partner information" colspan="4"/> | ||
459 | 34 | <field name="partner_id"/> | ||
460 | 35 | <field name="location"/> | ||
461 | 36 | <separator string="Description" colspan="4"/> | ||
462 | 37 | <field name="description" colspan="4" nolabel="1"/> | ||
463 | 38 | </form> | ||
464 | 39 | </field> | ||
465 | 40 | </record> | ||
466 | 41 | |||
467 | 42 | <!-- Menu --> | ||
468 | 43 | <record model="ir.actions.act_window" id="open_view_professional_form"> | ||
469 | 44 | <field name="res_model">hr.professional</field> | ||
470 | 45 | <field name="view_type">form</field> | ||
471 | 46 | <field name="view_mode">tree,form</field> | ||
472 | 47 | </record> | ||
473 | 48 | |||
474 | 49 | <menuitem name="Professional Experiences" | ||
475 | 50 | parent="hr.menu_hr_configuration" | ||
476 | 51 | id="menu_open_view_professional_form" | ||
477 | 52 | action="open_view_professional_form"/> | ||
478 | 53 | |||
479 | 54 | </data> | ||
480 | 55 | </openerp> | ||
481 | 0 | 56 | ||
482 | === added directory 'hr_experience/i18n' | |||
483 | === added file 'hr_experience/i18n/hr_experience.pot' | |||
484 | --- hr_experience/i18n/hr_experience.pot 1970-01-01 00:00:00 +0000 | |||
485 | +++ hr_experience/i18n/hr_experience.pot 2014-04-21 15:39:45 +0000 | |||
486 | @@ -0,0 +1,208 @@ | |||
487 | 1 | # Translation of OpenERP Server. | ||
488 | 2 | # This file contains the translation of the following modules: | ||
489 | 3 | # * hr_experience | ||
490 | 4 | # | ||
491 | 5 | msgid "" | ||
492 | 6 | msgstr "" | ||
493 | 7 | "Project-Id-Version: OpenERP Server 6.1\n" | ||
494 | 8 | "Report-Msgid-Bugs-To: \n" | ||
495 | 9 | "POT-Creation-Date: 2013-12-31 21:26+0000\n" | ||
496 | 10 | "PO-Revision-Date: 2013-12-31 21:26+0000\n" | ||
497 | 11 | "Last-Translator: <>\n" | ||
498 | 12 | "Language-Team: \n" | ||
499 | 13 | "MIME-Version: 1.0\n" | ||
500 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
501 | 15 | "Content-Transfer-Encoding: \n" | ||
502 | 16 | "Plural-Forms: \n" | ||
503 | 17 | |||
504 | 18 | #. module: hr_experience | ||
505 | 19 | #: field:hr.certification,certification:0 | ||
506 | 20 | msgid "Certification Number" | ||
507 | 21 | msgstr "" | ||
508 | 22 | |||
509 | 23 | #. module: hr_experience | ||
510 | 24 | #: field:hr.professional,partner_id:0 | ||
511 | 25 | msgid "Employer" | ||
512 | 26 | msgstr "" | ||
513 | 27 | |||
514 | 28 | #. module: hr_experience | ||
515 | 29 | #: view:hr.academic:0 | ||
516 | 30 | #: view:hr.certification:0 | ||
517 | 31 | #: view:hr.professional:0 | ||
518 | 32 | msgid "Partner information" | ||
519 | 33 | msgstr "" | ||
520 | 34 | |||
521 | 35 | #. module: hr_experience | ||
522 | 36 | #: field:hr.academic,location:0 | ||
523 | 37 | #: field:hr.certification,location:0 | ||
524 | 38 | #: field:hr.professional,location:0 | ||
525 | 39 | msgid "Location" | ||
526 | 40 | msgstr "" | ||
527 | 41 | |||
528 | 42 | #. module: hr_experience | ||
529 | 43 | #: field:hr.academic,employee_id:0 | ||
530 | 44 | #: field:hr.certification,employee_id:0 | ||
531 | 45 | #: field:hr.professional,employee_id:0 | ||
532 | 46 | #: model:ir.model,name:hr_experience.model_hr_employee | ||
533 | 47 | msgid "Employee" | ||
534 | 48 | msgstr "" | ||
535 | 49 | |||
536 | 50 | #. module: hr_experience | ||
537 | 51 | #: field:hr.academic,start_date:0 | ||
538 | 52 | #: field:hr.certification,start_date:0 | ||
539 | 53 | #: field:hr.professional,start_date:0 | ||
540 | 54 | msgid "Start date" | ||
541 | 55 | msgstr "" | ||
542 | 56 | |||
543 | 57 | #. module: hr_experience | ||
544 | 58 | #: field:hr.academic,activities:0 | ||
545 | 59 | msgid "Activities and associations" | ||
546 | 60 | msgstr "" | ||
547 | 61 | |||
548 | 62 | #. module: hr_experience | ||
549 | 63 | #: view:hr.academic:0 | ||
550 | 64 | #: field:hr.academic,description:0 | ||
551 | 65 | #: view:hr.certification:0 | ||
552 | 66 | #: field:hr.certification,description:0 | ||
553 | 67 | #: view:hr.professional:0 | ||
554 | 68 | #: field:hr.professional,description:0 | ||
555 | 69 | msgid "Description" | ||
556 | 70 | msgstr "" | ||
557 | 71 | |||
558 | 72 | #. module: hr_experience | ||
559 | 73 | #: field:hr.academic,study_field:0 | ||
560 | 74 | msgid "Field of study" | ||
561 | 75 | msgstr "" | ||
562 | 76 | |||
563 | 77 | #. module: hr_experience | ||
564 | 78 | #: model:ir.ui.menu,name:hr_experience.menu_open_view_academic_form | ||
565 | 79 | msgid "Academic Experiences" | ||
566 | 80 | msgstr "" | ||
567 | 81 | |||
568 | 82 | #. module: hr_experience | ||
569 | 83 | #: view:hr.certification:0 | ||
570 | 84 | msgid "Certification information" | ||
571 | 85 | msgstr "" | ||
572 | 86 | |||
573 | 87 | #. module: hr_experience | ||
574 | 88 | #: field:hr.academic,expire:0 | ||
575 | 89 | #: field:hr.certification,expire:0 | ||
576 | 90 | #: field:hr.professional,expire:0 | ||
577 | 91 | msgid "Expire" | ||
578 | 92 | msgstr "" | ||
579 | 93 | |||
580 | 94 | #. module: hr_experience | ||
581 | 95 | #: field:hr.academic,partner_id:0 | ||
582 | 96 | msgid "School or University" | ||
583 | 97 | msgstr "" | ||
584 | 98 | |||
585 | 99 | #. module: hr_experience | ||
586 | 100 | #: view:hr.professional:0 | ||
587 | 101 | msgid "Professional Experience" | ||
588 | 102 | msgstr "" | ||
589 | 103 | |||
590 | 104 | #. module: hr_experience | ||
591 | 105 | #: constraint:hr.employee:0 | ||
592 | 106 | msgid "Error ! You cannot create recursive Hierarchy of Employees." | ||
593 | 107 | msgstr "" | ||
594 | 108 | |||
595 | 109 | #. module: hr_experience | ||
596 | 110 | #: view:hr.academic:0 | ||
597 | 111 | msgid "Academic information" | ||
598 | 112 | msgstr "" | ||
599 | 113 | |||
600 | 114 | #. module: hr_experience | ||
601 | 115 | #: view:hr.academic:0 | ||
602 | 116 | #: view:hr.certification:0 | ||
603 | 117 | #: view:hr.professional:0 | ||
604 | 118 | msgid "Dates" | ||
605 | 119 | msgstr "" | ||
606 | 120 | |||
607 | 121 | #. module: hr_experience | ||
608 | 122 | #: field:hr.employee,certification_ids:0 | ||
609 | 123 | #: model:ir.ui.menu,name:hr_experience.menu_open_view_certification_form | ||
610 | 124 | msgid "Certifications" | ||
611 | 125 | msgstr "" | ||
612 | 126 | |||
613 | 127 | #. module: hr_experience | ||
614 | 128 | #: field:hr.academic,name:0 | ||
615 | 129 | #: field:hr.certification,name:0 | ||
616 | 130 | #: field:hr.professional,name:0 | ||
617 | 131 | msgid "Name" | ||
618 | 132 | msgstr "" | ||
619 | 133 | |||
620 | 134 | #. module: hr_experience | ||
621 | 135 | #: view:hr.academic:0 | ||
622 | 136 | #: field:hr.employee,academic_ids:0 | ||
623 | 137 | msgid "Academic experiences" | ||
624 | 138 | msgstr "" | ||
625 | 139 | |||
626 | 140 | #. module: hr_experience | ||
627 | 141 | #: field:hr.employee,professional_ids:0 | ||
628 | 142 | msgid " Professional Experiences" | ||
629 | 143 | msgstr "" | ||
630 | 144 | |||
631 | 145 | #. module: hr_experience | ||
632 | 146 | #: view:hr.employee:0 | ||
633 | 147 | msgid "Academic" | ||
634 | 148 | msgstr "" | ||
635 | 149 | |||
636 | 150 | #. module: hr_experience | ||
637 | 151 | #: view:hr.certification:0 | ||
638 | 152 | msgid "certifications" | ||
639 | 153 | msgstr "" | ||
640 | 154 | |||
641 | 155 | #. module: hr_experience | ||
642 | 156 | #: field:hr.certification,partner_id:0 | ||
643 | 157 | msgid "Certification Authority" | ||
644 | 158 | msgstr "" | ||
645 | 159 | |||
646 | 160 | #. module: hr_experience | ||
647 | 161 | #: view:hr.employee:0 | ||
648 | 162 | msgid "Professional" | ||
649 | 163 | msgstr "" | ||
650 | 164 | |||
651 | 165 | #. module: hr_experience | ||
652 | 166 | #: view:hr.academic:0 | ||
653 | 167 | msgid "Academic experience" | ||
654 | 168 | msgstr "" | ||
655 | 169 | |||
656 | 170 | #. module: hr_experience | ||
657 | 171 | #: field:hr.academic,end_date:0 | ||
658 | 172 | #: field:hr.certification,end_date:0 | ||
659 | 173 | #: field:hr.professional,end_date:0 | ||
660 | 174 | msgid "End date" | ||
661 | 175 | msgstr "" | ||
662 | 176 | |||
663 | 177 | #. module: hr_experience | ||
664 | 178 | #: model:ir.model,name:hr_experience.model_hr_academic | ||
665 | 179 | msgid "hr.academic" | ||
666 | 180 | msgstr "" | ||
667 | 181 | |||
668 | 182 | #. module: hr_experience | ||
669 | 183 | #: field:hr.academic,diploma:0 | ||
670 | 184 | msgid "Diploma" | ||
671 | 185 | msgstr "" | ||
672 | 186 | |||
673 | 187 | #. module: hr_experience | ||
674 | 188 | #: view:hr.certification:0 | ||
675 | 189 | #: view:hr.employee:0 | ||
676 | 190 | msgid "Certification" | ||
677 | 191 | msgstr "" | ||
678 | 192 | |||
679 | 193 | #. module: hr_experience | ||
680 | 194 | #: model:ir.model,name:hr_experience.model_hr_certification | ||
681 | 195 | msgid "hr.certification" | ||
682 | 196 | msgstr "" | ||
683 | 197 | |||
684 | 198 | #. module: hr_experience | ||
685 | 199 | #: model:ir.model,name:hr_experience.model_hr_professional | ||
686 | 200 | msgid "hr.professional" | ||
687 | 201 | msgstr "" | ||
688 | 202 | |||
689 | 203 | #. module: hr_experience | ||
690 | 204 | #: view:hr.professional:0 | ||
691 | 205 | #: model:ir.ui.menu,name:hr_experience.menu_open_view_professional_form | ||
692 | 206 | msgid "Professional Experiences" | ||
693 | 207 | msgstr "" | ||
694 | 208 | |||
695 | 0 | 209 | ||
696 | === added directory 'hr_experience/security' | |||
697 | === added file 'hr_experience/security/hr_experience_security.xml' | |||
698 | --- hr_experience/security/hr_experience_security.xml 1970-01-01 00:00:00 +0000 | |||
699 | +++ hr_experience/security/hr_experience_security.xml 2014-04-21 15:39:45 +0000 | |||
700 | @@ -0,0 +1,62 @@ | |||
701 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
702 | 2 | <openerp> | ||
703 | 3 | <data noupdate="1"> | ||
704 | 4 | |||
705 | 5 | <!-- Employee rules --> | ||
706 | 6 | <record id="hr_academic_employee_rule" model="ir.rule"> | ||
707 | 7 | <field name="name">Personal academic experiences</field> | ||
708 | 8 | <field name="model_id" ref="hr.model_hr_academic"/> | ||
709 | 9 | <field name="domain_force">[('employee_id.user_id.id', '=', user.id)]</field> | ||
710 | 10 | <field name="groups" eval="[(4, ref('base.group_user'))]"/> | ||
711 | 11 | <field name="perm_read">False</field> | ||
712 | 12 | <field name="perm_create">True</field> | ||
713 | 13 | <field name="perm_write">True</field> | ||
714 | 14 | <field name="perm_unlink">True</field> | ||
715 | 15 | </record> | ||
716 | 16 | |||
717 | 17 | <record id="hr_professional_employee_rule" model="ir.rule"> | ||
718 | 18 | <field name="name">Personal professional experiences</field> | ||
719 | 19 | <field name="model_id" ref="hr.model_hr_professional"/> | ||
720 | 20 | <field name="domain_force">[('employee_id.user_id.id', '=', user.id)]</field> | ||
721 | 21 | <field name="groups" eval="[(4, ref('base.group_user'))]"/> | ||
722 | 22 | <field name="perm_read">False</field> | ||
723 | 23 | <field name="perm_create">True</field> | ||
724 | 24 | <field name="perm_write">True</field> | ||
725 | 25 | <field name="perm_unlink">True</field> | ||
726 | 26 | </record> | ||
727 | 27 | |||
728 | 28 | <record id="hr_certification_employee_rule" model="ir.rule"> | ||
729 | 29 | <field name="name">Personal certifications</field> | ||
730 | 30 | <field name="model_id" ref="model_hr_certification"/> | ||
731 | 31 | <field name="domain_force">[('employee_id.user_id.id', '=', user.id)]</field> | ||
732 | 32 | <field name="groups" eval="[(4, ref('base.group_user'))]"/> | ||
733 | 33 | <field name="perm_read">False</field> | ||
734 | 34 | <field name="perm_create">True</field> | ||
735 | 35 | <field name="perm_write">True</field> | ||
736 | 36 | <field name="perm_unlink">True</field> | ||
737 | 37 | </record> | ||
738 | 38 | |||
739 | 39 | <!-- HR User rules --> | ||
740 | 40 | <record id="hr_academic_hruser_rule" model="ir.rule"> | ||
741 | 41 | <field name="name">All academic experiences</field> | ||
742 | 42 | <field name="model_id" ref="hr.model_hr_academic"/> | ||
743 | 43 | <field name="domain_force">[(1, '=', 1)]</field> | ||
744 | 44 | <field name="groups" eval="[(4, ref('base.group_hr_user'))]"/> | ||
745 | 45 | </record> | ||
746 | 46 | |||
747 | 47 | <record id="hr_professional_hruser_rule" model="ir.rule"> | ||
748 | 48 | <field name="name">All professional experiences</field> | ||
749 | 49 | <field name="model_id" ref="hr.model_hr_professional"/> | ||
750 | 50 | <field name="domain_force">[(1, '=', 1)]</field> | ||
751 | 51 | <field name="groups" eval="[(4, ref('base.group_hr_user'))]"/> | ||
752 | 52 | </record> | ||
753 | 53 | |||
754 | 54 | <record id="hr_certification_hruser_rule" model="ir.rule"> | ||
755 | 55 | <field name="name">All certifications</field> | ||
756 | 56 | <field name="model_id" ref="model_hr_certification"/> | ||
757 | 57 | <field name="domain_force">[(1, '=', 1)]</field> | ||
758 | 58 | <field name="groups" eval="[(4, ref('base.group_hr_user'))]"/> | ||
759 | 59 | </record> | ||
760 | 60 | |||
761 | 61 | </data> | ||
762 | 62 | </openerp> | ||
763 | 0 | 63 | ||
764 | === added file 'hr_experience/security/ir.model.access.csv' | |||
765 | --- hr_experience/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 | |||
766 | +++ hr_experience/security/ir.model.access.csv 2014-04-21 15:39:45 +0000 | |||
767 | @@ -0,0 +1,4 @@ | |||
768 | 1 | "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" | ||
769 | 2 | "access_hr_academic","hr.academic","model_hr_academic",base.group_hr_user,1,1,1,1 | ||
770 | 3 | "access_hr_professional","hr.professional","model_hr_professional",base.group_hr_user,1,1,1,1 | ||
771 | 4 | "access_hr_certification","hr.certification","model_hr_certification",base.group_hr_user,1,1,1,1 |
Hi El Hadji,
Thanks for your contribution. As for the review I have this 2 points that you can improve.
l.100.103.132: Even in 6.1 the osv is considered deprecated (osv.osv actually points to orm.Model) so for the import is better to use "from openerp.osv import orm, fields" and for the models it's better to inherit from orm.Model istead of osv.osv.
l.129.137: In 6.1 we don't need to instantiate the model after defining it.