[MERGE] lp:768430

bzr revid: qdp-launchpad@openerp.com-20110531220951-6mtceil9xsbmnktp
This commit is contained in:
Quentin (OpenERP) 2011-06-01 00:09:51 +02:00
commit 4860c4d86f
1 changed files with 6 additions and 2 deletions

View File

@ -317,8 +317,12 @@ class product_template(osv.osv):
if 'categ_id' in context and context['categ_id']:
return context['categ_id']
md = self.pool.get('ir.model.data')
res = md.get_object_reference(cr, uid, 'product', 'cat0') or False
return res and res[1] or False
res = False
try:
res = md.get_object_reference(cr, uid, 'product', 'cat0')[1]
except ValueError:
res = False
return res
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
if uom_id: