From ff7d9aa2e92aeb7df498abb0708a8bc374b4dc64 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 27 Apr 2011 11:30:52 +0530 Subject: [PATCH] [FIX]product:Fixed-After delete All product category you cannot create new product lp bug: https://launchpad.net/bugs/768430 fixed bzr revid: ron@tinyerp.com-20110427060052-ztqk8tye4unbg3yc --- addons/product/product.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index bab6b5f5cc1..afd42dfe929 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -315,7 +315,11 @@ 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 + res = False + try: + res = md.get_object_reference(cr, uid, 'product', 'cat0') + except ValueError: + res = False return res and res[1] or False def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):