2009-10-13 05:58:37 +00:00
# -*- coding: utf-8 -*-
2007-03-07 18:49:32 +00:00
##############################################################################
2009-10-14 11:15:34 +00:00
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
2007-03-07 18:49:32 +00:00
#
2008-11-03 19:18:56 +00:00
# This program is free software: you can redistribute it and/or modify
2009-10-14 11:15:34 +00:00
# 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.
2007-03-07 18:49:32 +00:00
#
2008-11-03 19:18:56 +00:00
# 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
2009-10-14 11:15:34 +00:00
# GNU Affero General Public License for more details.
2007-03-07 18:49:32 +00:00
#
2009-10-14 11:15:34 +00:00
# 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/>.
2007-03-07 18:49:32 +00:00
#
##############################################################################
2007-03-07 18:10:55 +00:00
from osv import fields , osv
2007-03-07 18:49:32 +00:00
import time
2007-03-07 18:10:55 +00:00
class hr_employee_marital_status ( osv . osv ) :
2008-07-22 15:11:28 +00:00
_name = " hr.employee.marital.status "
_description = " Employee Marital Status "
_columns = {
' name ' : fields . char ( ' Marital Status ' , size = 30 , required = True ) ,
' description ' : fields . text ( ' Status Description ' ) ,
}
2007-03-07 18:10:55 +00:00
hr_employee_marital_status ( )
class hr_employee ( osv . osv ) :
2008-07-22 15:11:28 +00:00
_name = " hr.employee "
_description = " Employee "
_inherit = " hr.employee "
_columns = {
' manager ' : fields . boolean ( ' Manager ' ) ,
' medic_exam ' : fields . date ( ' Medical examination date ' ) ,
' audiens_num ' : fields . char ( ' AUDIENS Number ' , size = 30 ) ,
' place_of_birth ' : fields . char ( ' Place of Birth ' , size = 30 ) ,
' marital_status ' : fields . many2one ( ' hr.employee.marital.status ' , ' Marital Status ' ) ,
' children ' : fields . integer ( ' Number of children ' ) ,
' contract_ids ' : fields . one2many ( ' hr.contract ' , ' employee_id ' , ' Contracts ' ) ,
}
2007-03-07 18:10:55 +00:00
hr_employee ( )
#Contract wage type period name
class hr_contract_wage_type_period ( osv . osv ) :
2008-07-22 15:11:28 +00:00
_name = ' hr.contract.wage.type.period '
_description = ' Wage Period '
_columns = {
' name ' : fields . char ( ' Period Name ' , size = 50 , required = True , select = True ) ,
' 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 ' )
}
_defaults = {
' factor_days ' : lambda * args : 168.0
}
2007-03-07 18:10:55 +00:00
hr_contract_wage_type_period ( )
#Contract wage type (hourly, daily, monthly, ...)
class hr_contract_wage_type ( osv . osv ) :
2008-07-22 15:11:28 +00:00
_name = ' hr.contract.wage.type '
_description = ' Wage Type '
_columns = {
' name ' : fields . char ( ' Wage Type Name ' , size = 50 , required = True , select = True ) ,
' period_id ' : fields . many2one ( ' hr.contract.wage.type.period ' , ' Wage Period ' , required = True ) ,
' type ' : fields . selection ( [ ( ' gross ' , ' Gross ' ) , ( ' net ' , ' Net ' ) ] , ' Type ' , required = True ) ,
' 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 ' )
}
_defaults = {
' type ' : lambda * a : ' gross ' ,
' factor_type ' : lambda * args : 1.8
}
2007-03-07 18:10:55 +00:00
hr_contract_wage_type ( )
class hr_contract ( osv . osv ) :
2008-07-22 15:11:28 +00:00
_name = ' hr.contract '
_description = ' Contract '
_columns = {
' name ' : fields . char ( ' Contract Name ' , size = 30 , required = True ) ,
2009-12-21 09:50:54 +00:00
' employee_id ' : fields . many2one ( ' hr.employee ' , " Employee ' s Name " , required = True ) ,
2008-07-22 15:11:28 +00:00
' function ' : fields . many2one ( ' res.partner.function ' , ' Function ' ) ,
' date_start ' : fields . date ( ' Start Date ' , required = True ) ,
' date_end ' : fields . date ( ' End Date ' ) ,
2009-09-24 10:46:21 +00:00
' working_hours_per_day_id ' : fields . many2one ( ' hr.timesheet.group ' , ' Working hours per day ' ) ,
2008-07-22 15:11:28 +00:00
' wage_type_id ' : fields . many2one ( ' hr.contract.wage.type ' , ' Wage Type ' , required = True ) ,
' wage ' : fields . float ( ' Wage ' , required = True ) ,
' notes ' : fields . text ( ' Notes ' ) ,
}
_defaults = {
' date_start ' : lambda * a : time . strftime ( " % Y- % m- %d " ) ,
}
2007-03-07 18:10:55 +00:00
hr_contract ( )
2008-07-23 14:41:47 +00:00
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: