818
818
if not default_code or not vals.get('xmlid_code', False):
819
819
raise Exception, "Problem creating product: Missing xmlid_code/default_code in the data"
820
820
exist_dc = self.search(cr, uid, [('default_code', '=',
821
default_code)], force_no_order=True, limit=1, context=context)
821
default_code)], limit=1, context=context, count=True)
822
822
exist_xc = self.search(cr, uid, [('xmlid_code', 'in', [default_code, xmlid_code])],
824
824
if exist_dc: # if any of the code exists, report error!,
825
825
raise Exception, "Problem creating product: Duplicate default_code found"
826
826
if exist_xc: # if any of the code exists, report error!,