[MERGE] Sync with trunk
[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 openerp.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('Allow timesheets validation by managers',
30             help ="""This installs the module hr_timesheet_sheet."""),
31         'module_hr_attendance': fields.boolean('Install attendances feature',
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('Manage holidays, leaves and allocation requests',
36             help ="""This installs the module hr_holidays."""),
37         'module_hr_expense': fields.boolean('Manage employees expenses',
38             help ="""This installs the module hr_expense."""),
39         'module_hr_recruitment': fields.boolean('Manage the recruitment process',
40             help ="""This installs the module hr_recruitment."""),
41         'module_hr_contract': fields.boolean('Record contracts per employee',
42             help ="""This installs the module hr_contract."""),
43         'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation',
44             help ="""This installs the module hr_evaluation."""),
45         'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (the sale application will be installed)',
46             help ="""This installs the module account_analytic_analysis, which will install sales management too."""),
47         'module_hr_payroll': fields.boolean('Manage payroll',
48             help ="""This installs the module hr_payroll."""),
49     }
50
51     def onchange_hr_timesheet(self, cr, uid, ids, timesheet, context=None):
52         """ module_hr_timesheet implies module_hr_attendance """
53         if timesheet:
54             return {'value': {'module_hr_attendance': True}}
55         return {}
56
57     def onchange_hr_attendance(self, cr, uid, ids, attendance, context=None):
58         """ module_hr_timesheet implies module_hr_attendance """
59         if not attendance:
60             return {'value': {'module_hr_timesheet': False}}
61         return {}
62
63 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: