← Back to team overview

openerp-india team mailing list archive

[Bug 1005654] Re: [Extra-addons][product_images_olbs] AttributeError: 'cursor' object has no attribute 'get_image' on server 6.0

 

Hello Mariano,

This is not a bug, but you have faced the problem due to your end
problem.

As per your traceback you have used 6.0.4 server/client but you have
used a extra-trunk(which is compatible with trunk/6.1 not with the
stable 6). If you want to use this module for  6.0.4 server/client
please take the branch/code from lp:openobject-addons/extra-6.0  which
is compatible with stable 6.0.4.

I have checked this module from extra-6.0 at there the code is like this.
        'preview':fields.function(_get_image, type="binary", method=True),
and it's working perfectly, also I have checked with extra-trunk and found your described code which is         'file':fields.function(_get_image, fnct_inv=_set_image, type="binary", filters='*.png,*.jpg,*.gif'),

also it's working fine with the trunk/6.1 because no need "method=True"
on function field on 6.1(Improved behaviour.)

Now as your last line of bug description, "To solve this, in product_images class, the 'file' function field must be have the attribute method to True:"  But as I said  fields.function() does not take a "method" parameter anymore .
Would you please check http://bazaar.launchpad.net/~openerp/openobject-server/trunk/revision/3495 (at here you can see it we didn't use method parameter anymore on field.function)

That's why on both extra-6.0 as well as extra-trunk this module is
working fine, If you are using proper compatible version.

So this problem occurs due to your end compatibility issue. Also it's
not a bug.

Solution: 1)  Would you please try this module from lp:openobject-addons/extra-6.0 
                   2) Or you can use server/client 6.1 or trunk then it will work fine.

Thanks for reporting!

** Changed in: openobject-addons
       Status: New => Invalid

-- 
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/1005654

Title:
  [Extra-addons][product_images_olbs] AttributeError: 'cursor' object
  has no attribute 'get_image' on server 6.0

Status in OpenERP Addons (modules):
  Invalid

Bug description:
  The module product_images_olbs raise this in server 6.0:

  [2012-05-28 15:20:17,797][openerp6] ERROR:web-services:Uncaught exception
  Traceback (most recent call last):
    File "/opt/openerp-6.0.4/server/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/opt/openerp-6.0.4/server/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/opt/openerp-6.0.4/server/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/opt/openerp-6.0.4/server/bin/osv/orm.py", line 2947, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "/opt/openerp-6.0.4/server/bin/osv/orm.py", line 3067, in _read_flat
      res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
    File "/opt/openerp-6.0.4/server/bin/osv/fields.py", line 815, in get
      res = self._fnct(cr, obj._table, ids, name, self._arg, context)
    File "/opt/openerp-6.0.4/extra-addons/product_images_olbs/product_images.py", line 119, in _get_image
      res[each] = self.get_image(cr, uid, each, context=context)
    File "/opt/openerp-6.0.4/server/bin/sql_db.py", line 78, in wrapper
      return f(self, *args, **kwargs)
    File "/opt/openerp-6.0.4/server/bin/sql_db.py", line 237, in __getattr__
      return getattr(self._obj, name)
  AttributeError: 'cursor' object has no attribute 'get_image'

  To solve this, in product_images class, the 'file' function field must
  be have the attribute method to True:

  'file':fields.function(_get_image, fnct_inv=_set_image, type="binary",
  method=True, filters='*.png,*.jpg,*.gif'),

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


References