diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index b1175634981..84e7db409ab 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -35,25 +35,23 @@ class hr_employee(osv.osv): } def _getAnalyticJournal(self, cr, uid, context=None): - if context is None: - context = {} - id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) - if id: - journal = self.browse(cr, uid, id[0], context=context) - if journal.journal_id: - return journal.journal_id.id + md = self.pool.get('ir.model.data') + try: + result = md.get_object_reference(cr, uid, 'hr_timesheet', 'analytic_journal') + return result[1] + except ValueError, e: + pass return False - + def _getEmployeeProduct(self, cr, uid, context=None): - if context is None: - context = {} - id = self.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) - if id: - prod = self.browse(cr, uid, id[0], context=context) - if prod.product_id: - return prod.product_id.id + md = self.pool.get('ir.model.data') + try: + result = md.get_object_reference(cr, uid, 'hr_timesheet', 'product_consultant') + return result[1] + except ValueError, e: + pass return False - + _defaults = { 'journal_id' : _getAnalyticJournal, 'product_id' : _getEmployeeProduct diff --git a/addons/hr_timesheet/hr_timesheet_data.xml b/addons/hr_timesheet/hr_timesheet_data.xml index 08a769d7ee6..e7cb3d5e0d4 100644 --- a/addons/hr_timesheet/hr_timesheet_data.xml +++ b/addons/hr_timesheet/hr_timesheet_data.xml @@ -6,5 +6,17 @@ Timesheet Journal general + + + 75.0 + 30.0 + + + Service on Timesheet + + service + + + diff --git a/addons/hr_timesheet/hr_timesheet_demo.xml b/addons/hr_timesheet/hr_timesheet_demo.xml index f344b60c83e..e7ba5c91342 100644 --- a/addons/hr_timesheet/hr_timesheet_demo.xml +++ b/addons/hr_timesheet/hr_timesheet_demo.xml @@ -2,20 +2,6 @@ - - DEV - 75.0 - 30.0 - - - Consultancy - Senior Developer - - service - produce - make_to_order - - -