← Back to team overview

openerp-india team mailing list archive

[Bug 1017960] [NEW] [extra-addons-trunk] product_image_olbs : duplicate product crash

 

Public bug reported:

I get the following error when trying to duplicate a product with linked
images:

2012-06-26 13:10:10,424 4812 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3406, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3529, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/fields.py", line 1132, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product.py", line 52, in _get_main_image
    res[id] = image.file
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 476, in __getattr__
    return self[name]
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 391, in __getitem__
    field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3406, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3529, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/fields.py", line 1132, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product_images.py", line 119, in _get_image
    res[each] = self.get_image(cr, uid, each, context=context)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product_images.py", line 100, in get_image
    full_path = self._image_path(cr, uid, image, context=context)
  File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product_images.py", line 90, in _image_path
    '%s%s' % (image.name or '', image.extention or ''))
  File "/usr/lib/python2.6/posixpath.py", line 65, in join
    if b.startswith('/'):
AttributeError: 'bool' object has no attribute 'startswith'


This is caused by the new product having False as default_code.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

** Summary changed:

- [extra-addons] product_image_olbs : duplicate product crash
+ [extra-addons-trunk] product_image_olbs : duplicate product crash

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1017960

Title:
  [extra-addons-trunk] product_image_olbs : duplicate product crash

Status in OpenERP Addons (modules):
  New

Bug description:
  I get the following error when trying to duplicate a product with
  linked images:

  2012-06-26 13:10:10,424 4812 ERROR ? openerp.osv.osv: Uncaught exception
  Traceback (most recent call last):
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/osv.py", line 164, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3406, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3529, in _read_flat
      res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/fields.py", line 1132, in get
      result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product.py", line 52, in _get_main_image
      res[id] = image.file
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 476, in __getattr__
      return self[name]
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 391, in __getitem__
      field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3406, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/orm.py", line 3529, in _read_flat
      res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/osv/fields.py", line 1132, in get
      result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product_images.py", line 119, in _get_image
      res[each] = self.get_image(cr, uid, each, context=context)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product_images.py", line 100, in get_image
      full_path = self._image_path(cr, uid, image, context=context)
    File "/srv/openerp/instances/openerp_prod_alpesdeveloppement/src/server/openerp/addons/product_images_olbs/product_images.py", line 90, in _image_path
      '%s%s' % (image.name or '', image.extention or ''))
    File "/usr/lib/python2.6/posixpath.py", line 65, in join
      if b.startswith('/'):
  AttributeError: 'bool' object has no attribute 'startswith'

  
  This is caused by the new product having False as default_code.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1017960/+subscriptions


Follow ups

References