[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
This commit is contained in:
parent
0c72a7e647
commit
ff7d9aa2e9
|
@ -315,7 +315,11 @@ class product_template(osv.osv):
|
||||||
if 'categ_id' in context and context['categ_id']:
|
if 'categ_id' in context and context['categ_id']:
|
||||||
return context['categ_id']
|
return context['categ_id']
|
||||||
md = self.pool.get('ir.model.data')
|
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
|
return res and res[1] or False
|
||||||
|
|
||||||
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
|
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
|
||||||
|
|
Loading…
Reference in New Issue