summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-04-23 14:28:20 +0200
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>2013-04-23 14:28:20 +0200
commit6d9ae761cdc5b5b4599c0fbe1a63265f930ff8b9 (patch)
treed48255468bbccd049056f3946d058f55918c9461
parent2e4aafa7dc26981066df7f7fa648241e6d13fd5e (diff)
[FIX] hr_timesheet: return default values for journal and product only if the uid has the read access on it (multi-company) thanks to a new method on ir.model.data: check_object_reference()
bzr revid: qdp-launchpad@openerp.com-20130423122820-9gf2i4iic5bqr8g6
-rw-r--r--addons/hr_timesheet/hr_timesheet.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py
index 6a538e5d09c..461507f9e41 100644
--- a/addons/hr_timesheet/hr_timesheet.py
+++ b/addons/hr_timesheet/hr_timesheet.py
@@ -37,8 +37,8 @@ class hr_employee(osv.osv):
def _getAnalyticJournal(self, cr, uid, context=None):
md = self.pool.get('ir.model.data')
try:
- result = md.get_object_reference(cr, uid, 'hr_timesheet', 'analytic_journal')
- return result[1]
+ dummy, res_id = md.check_object_reference(cr, uid, 'hr_timesheet', 'analytic_journal')
+ return res_id
except ValueError:
pass
return False
@@ -46,8 +46,8 @@ class hr_employee(osv.osv):
def _getEmployeeProduct(self, cr, uid, context=None):
md = self.pool.get('ir.model.data')
try:
- result = md.get_object_reference(cr, uid, 'product', 'product_product_consultant')
- return result[1]
+ dummy, res_id = md.check_object_reference(cr, uid, 'product', 'product_product_consultant')
+ return res_id
except ValueError:
pass
return False