From 571dd35fef992c983f64aa874c98eb33f2caefff Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 3 Apr 2012 14:34:04 +0530 Subject: [PATCH] [IMP] HR: improve the code in res_config.py for hr_timesheet_sheet module and res_config.py for hr module bzr revid: jap@tinyerp.com-20120403090404-j5gdfhwwkdkb82vw --- addons/hr/res_config.py | 26 ------------------------- addons/hr/res_config_view.xml | 1 + addons/hr_timesheet_sheet/res_config.py | 20 +++++++++++-------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/addons/hr/res_config.py b/addons/hr/res_config.py index 9966c5bed3d..6dca7fedae4 100644 --- a/addons/hr/res_config.py +++ b/addons/hr/res_config.py @@ -41,34 +41,8 @@ class human_resources_configuration(osv.osv_memory): help ="""It installs the hr_contract module."""), 'module_hr_evaluation': fields.boolean('Manage Appraisals Process', help ="""It installs the hr_evaluation module."""), - 'module_l10n_be_hr_payroll': fields.boolean('Allow to change Payroll Rules', - help ="""It allow to change payroll Rules."""), } - - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - - ir_module = self.pool.get('ir.module.module') - - payroll_id= ir_module.search(cr, uid, [('name','=','hr_payroll')]) - recruitment_id= ir_module.search(cr, uid, [('name','=','hr_recruitment')]) - timesheet_id= ir_module.search(cr, uid, [('name','=','hr_timesheet_sheet')]) - - payroll_modle_state = ir_module.browse(cr,uid, payroll_id[0],context=context).state - recruitment_modle_state = ir_module.browse(cr,uid, recruitment_id[0],context=context).state - timesheet_modle_state = ir_module.browse(cr,uid, timesheet_id[0],context=context).state - - - res = super(human_resources_configuration, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) - doc = etree.XML(res['arch']) - - if recruitment_modle_state == 'uninstalled': - for node in doc.xpath("//group[@name='Recruitment']"): - node.set('invisible', '1') - res['arch'] = etree.tostring(doc) - - return res - human_resources_configuration() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr/res_config_view.xml b/addons/hr/res_config_view.xml index 3c642802201..5be83f80bb4 100644 --- a/addons/hr/res_config_view.xml +++ b/addons/hr/res_config_view.xml @@ -15,6 +15,7 @@