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 @@
+
diff --git a/addons/hr_timesheet_sheet/res_config.py b/addons/hr_timesheet_sheet/res_config.py
index 13dc9e75829..da8d4979e68 100644
--- a/addons/hr_timesheet_sheet/res_config.py
+++ b/addons/hr_timesheet_sheet/res_config.py
@@ -20,7 +20,7 @@
##############################################################################
from osv import osv, fields
-
+import pooler
class hr_timeshee_settings(osv.osv_memory):
_name = 'human.resources.configuration'
_inherit = 'human.resources.configuration'
@@ -34,13 +34,17 @@ class hr_timeshee_settings(osv.osv_memory):
"computation for one sheet. Set this to 0 if you do not want any control."),
}
-
def default_get(self, cr, uid, fields, context=None):
- ir_values = self.pool.get('ir.values')
res = super(hr_timeshee_settings, self).default_get(cr, uid, fields, context)
- timesheet = ir_values.get_default(cr, uid, 'res.company', 'timesheet_range')
- companies = self.pool.get('res.company').search(cr, uid, [], context=context)
- for time_diff in self.pool.get('res.company').browse(cr, uid, companies, context=context):
- res['timesheet_range']=time_diff.timesheet_range
- res['timesheet_max_difference']=time_diff.timesheet_max_difference
+ user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+ res['timesheet_range']=user.company_id.timesheet_range
+ res['timesheet_max_difference']=user.company_id.timesheet_max_difference
return res
+
+ def set_timesheet_defaults(self, cr, uid, ids, context=None):
+ wizard = self.browse(cr, uid, ids)[0]
+ tm_range = wizard.timesheet_range
+ tm_diff = wizard.timesheet_max_difference
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ user.company_id.write({'timesheet_range': tm_range,'timesheet_max_difference': tm_diff})
+ return {}