AttributeError: 'bool' object has no attribute 'startswith'

Bug #957039 reported by Maxime Chambreuil (http://www.savoirfairelinux.com)
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP's Framework R&D

Bug Description

Using magentoerpconnect, I tried to duplicate a product exported to Magento and I got:

Server Traceback (most recent call last):
  File "/Users/openerp/openerp/web/addons/web/common/http.py", line 592, in send
    result = openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/service/web_services.py", line 572, in dispatch
    res = fn(db, uid, *params)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/orm.py", line 3405, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/orm.py", line 3528, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/fields.py", line 1132, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/Users/openerp/openerp/on-change-support-extra-addons/product_images_olbs/product.py", line 50, in _get_main_image
    res[id] = image.file
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/orm.py", line 476, in __getattr__
    return self[name]
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/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 "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/orm.py", line 3405, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/orm.py", line 3528, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/Users/openerp/openerp-virt/lib/python2.6/site-packages/openerp-6.1-py2.6.egg/openerp/osv/fields.py", line 1132, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/Users/openerp/openerp/on-change-support-extra-addons/product_images_olbs/product_images.py", line 108, in _get_image
    res[each] = self.get_image(cr, uid, each, context=context)
  File "/Users/openerp/openerp/on-change-support-extra-addons/product_images_olbs/product_images.py", line 87, in get_image
    full_path = os.path.join(local_media_repository, product_code, '%s%s'%(each['name'], each['extention']))
  File "/Users/openerp/openerp-virt/bin/../lib/python2.6/posixpath.py", line 65, in join
    if b.startswith('/'):
AttributeError: 'bool' object has no attribute 'startswith'

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

When duplicating a product with images, product_code is empty and generate this error.

Changed in openobject-addons:
status: New → Triaged
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Solutions:
* No code and no duplication of images
* Generate a random code and duplicate images

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Maxium,

I have faced the same trace-back at my end due to some mistake.

When I have started the my server with training module on 6.0 and also my 6.1 client is open(with 6.1 'a db) then trying to open the one of the menu from 6.1 client(with 6.1 'a db) when I am creating a db on 6.0 (means my sever is running).

I have faced the same traceback, would you please see attached the screen-shot.

I think you have did a mistake at your end, So would you please again check you have stated your same server/client version and then notify us.

Thanks and waiting for your reply

Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
status: Triaged → Incomplete
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

I don't understand your explanation and the relation you make with the training module.

I would say that this is not a bug but a normal behavior of the application. A good fix would be to check if the default_code has a value and choose one of the 2 proposed solutions above.

Changed in openobject-addons:
status: Incomplete → Invalid
status: Invalid → Incomplete
status: Incomplete → Confirmed
Amit Parik (amit-parik)
affects: openobject-addons → openobject-server
Amit Parik (amit-parik)
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.