~vauxoo/addons-vauxoo/7.0-account_move_folio-dev-hbto

791.4.1 by Luis Ernesto García Medina
[ADD][hr_childrens] add module with model hr_children and add fields in hr_employee (date_start, ssnid and children_ids)
1
# -*- coding: utf-8 -*-
2
###########################################################################
3
#    Module Writen to OpenERP, Open Source Management Solution
4
#
5
#    Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
6
#    All Rights Reserved.
7
#    info@vauxoo.com
8
############################################################################
9
#    Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
10
############################################################################
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
from openerp.osv import osv, fields
27
28
class hr_employee(osv.Model):
29
    _inherit = "hr.employee"
30
31
    _columns = {
32
        'date_start': fields.date('Date Start'),
33
        'children_ids' : fields.one2many('hr.children', 'employee_id', 'Childrens')
34
    }
35
36
class hr_children(osv.Model):
37
    _name = "hr.children"
38
    
39
    _order = 'name'
40
    
41
    _columns = {
42
        'name' : fields.char('Name', size=64),
43
        'date_of_birth' : fields.date('Date of birth'),
44
        'schooling' : fields.selection([('elementary', 'Elementary'),
45
            ('high_school', 'High School'), ('preparatory', 'Preparatory'),
46
            ('university', 'University')], 'Schooling'),
47
        'employee_id' : fields.many2one('hr.employee', 'Employee')
48
    }