1 # -*- encoding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ##############################################################################
24 from osv import fields, osv
27 class hr_employee_marital_status(osv.osv):
28 _name = "hr.employee.marital.status"
29 _description = "Employee Marital Status"
31 'name' : fields.char('Marital Status', size=30, required=True),
32 'description' : fields.text('Status Description'),
34 hr_employee_marital_status()
36 class hr_employee(osv.osv):
38 _description = "Employee"
39 _inherit = "hr.employee"
41 'manager' : fields.boolean('Manager'),
42 'medic_exam' : fields.date('Medical examination date'),
43 'audiens_num' : fields.char('AUDIENS Number', size=30),
44 'place_of_birth' : fields.char('Place of Birth', size=30),
45 'marital_status' : fields.many2one('hr.employee.marital.status', 'Marital Status'),
46 'children' : fields.integer('Number of children'),
47 'contract_ids' : fields.one2many('hr.contract', 'employee_id', 'Contracts'),
51 #Contract wage type period name
52 class hr_contract_wage_type_period(osv.osv):
53 _name='hr.contract.wage.type.period'
54 _description='Wage Period'
56 'name' : fields.char('Period Name', size=50, required=True, select=True),
57 'factor_days': fields.float('Hours in the period', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the price of an hour of work wased on the contract of the employee')
60 'factor_days': lambda *args: 168.0
62 hr_contract_wage_type_period()
64 #Contract wage type (hourly, daily, monthly, ...)
65 class hr_contract_wage_type(osv.osv):
66 _name = 'hr.contract.wage.type'
67 _description = 'Wage Type'
69 'name' : fields.char('Wage Type Name', size=50, required=True, select=True),
70 'period_id' : fields.many2one('hr.contract.wage.type.period', 'Wage Period', required=True),
71 'type' : fields.selection([('gross','Gross'), ('net','Net')], 'Type', required=True),
72 'factor_type': fields.float('Factor for hour cost', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the price of an hour of work wased on the contract of the employee')
75 'type' : lambda *a : 'gross',
76 'factor_type': lambda *args: 1.8
78 hr_contract_wage_type()
80 class hr_contract(osv.osv):
82 _description = 'Contract'
84 'name' : fields.char('Contract Name', size=30, required=True),
85 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True),
86 'function' : fields.many2one('res.partner.function', 'Function'),
87 'date_start' : fields.date('Start Date', required=True),
88 'date_end' : fields.date('End Date'),
89 'working_hours_per_day' : fields.integer('Working hours per day'),
90 'wage_type_id' : fields.many2one('hr.contract.wage.type', 'Wage Type', required=True),
91 'wage' : fields.float('Wage', required=True),
92 'notes' : fields.text('Notes'),
95 'date_start' : lambda *a : time.strftime("%Y-%m-%d"),
96 'working_hours_per_day' : lambda *a : 8,
101 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: