[IMP] review of some hr form view
[odoo/odoo.git] / addons / hr / res_config.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Business Applications
5 #    Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
6 #
7 #    This program is free software: you can redistribute it and/or modify
8 #    it under the terms of the GNU Affero General Public License as
9 #    published by the Free Software Foundation, either version 3 of the
10 #    License, or (at your option) any later version.
11 #
12 #    This program is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU Affero General Public License for more details.
16 #
17 #    You should have received a copy of the GNU Affero General Public License
18 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 #
20 ##############################################################################
21
22 from osv import fields, osv
23
24 class hr_config_settings(osv.osv_memory):
25     _name = 'hr.config.settings'
26     _inherit = 'res.config.settings'
27
28     _columns = {
29         'module_hr_timesheet_sheet': fields.boolean('Timesheet Validation by Manager',
30             help ="""This installs the module hr_timesheet_sheet."""),
31         'module_hr_attendance': fields.boolean('Track Attendances',
32             help ="""This installs the module hr_attendance."""),
33         'module_hr_timesheet': fields.boolean('Manage Timesheets',
34             help ="""This installs the module hr_timesheet."""),
35         'module_hr_holidays': fields.boolean('Leaves & Holidays',
36             help ="""This installs the module hr_holidays."""),
37         'module_hr_expense': fields.boolean('Expenses',
38             help ="""This installs the module hr_expense."""),
39         'module_hr_recruitment': fields.boolean('Recruitment',
40             help ="""This installs the module hr_recruitment."""),
41         'module_hr_contract': fields.boolean('Employees Contracts',
42             help ="""This installs the module hr_contract."""),
43         'module_hr_evaluation': fields.boolean('Periodic Appraisals',
44             help ="""This installs the module hr_evaluation."""),
45         'module_hr_payroll': fields.boolean('Payroll',
46             help ="""This installs the module hr_payroll."""),
47     }
48
49     def onchange_hr_timesheet(self, cr, uid, ids, timesheet, context=None):
50         """ module_hr_timesheet implies module_hr_attendance """
51         if timesheet:
52             return {'value': {'module_hr_attendance': True}}
53         return {}
54
55     def onchange_hr_attendance(self, cr, uid, ids, attendance, context=None):
56         """ module_hr_timesheet implies module_hr_attendance """
57         if not attendance:
58             return {'value': {'module_hr_timesheet': False}}
59         return {}
60
61 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: