← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 768430] Re: [6.0.2] Error when creating new product

 

After updating product module I get back this deleted category, but I
don't think it is good to prevent user to delete category which can make
an error like this.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/768430

Title:
  [6.0.2] Error when creating new product

Status in OpenERP Modules (addons):
  New

Bug description:
  I deleted product category which was by default "All products" and now
  I can't create new product. Problem is -
  "/bin/addons/product/product.py", line 319, in _default_category"
  method.

  Environment Information : 
  System : Linux-2.6.32-31-generic-i686-with-Ubuntu-10.04-lucid
  OS Name : posix
  Distributor ID:	Ubuntu
  Description:	Ubuntu 10.04.2 LTS
  Release:	10.04
  Codename:	lucid
  Operating System Release : 2.6.32-31-generic
  Operating System Version : #61-Ubuntu SMP Fri Apr 8 18:24:35 UTC 2011
  Operating System Architecture : 32bit
  Operating System Locale : lt_LT.UTF8
  Python Version : 2.6.5
  OpenERP-Client Version : 6.0.1
  Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
    File "/home/komsas/openerp/server/bin/netsvc.py", line 489, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "/home/komsas/openerp/server/bin/service/web_services.py", line 599, in dispatch
      res = fn(db, uid, *params)
    File "/home/komsas/openerp/server/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/komsas/openerp/server/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/komsas/openerp/server/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/komsas/openerp/server/bin/osv/orm.py", line 975, in default_get
      context))
    File "/home/komsas/openerp/server/bin/osv/orm.py", line 981, in default_get
      defaults[f] = self._defaults[f](self, cr, uid, context)
    File "/home/komsas/openerp/server/bin/addons/product/product.py", line 319, in _default_category
      res = md.get_object_reference(cr, uid, 'product', 'cat0') or False
    File "/home/komsas/openerp/server/bin/tools/misc.py", line 823, in cached_result
      result2 = fn(self2, cr, *args[:self.skiparg-2], **kwargs2)
    File "/home/komsas/openerp/server/bin/addons/base/ir/ir_model.py", line 609, in get_object_reference
      data_id = self._get_id(cr, uid, module, xml_id)
    File "/home/komsas/openerp/server/bin/tools/misc.py", line 823, in cached_result
      result2 = fn(self2, cr, *args[:self.skiparg-2], **kwargs2)
    File "/home/komsas/openerp/server/bin/addons/base/ir/ir_model.py", line 602, in _get_id
      raise ValueError('No references to %s.%s' % (module, xml_id))
  ValueError: No references to product.cat0


References