← Back to team overview

openerp-india team mailing list archive

[Bug 962229] Re: [6.1][ir_attachement] _search method should work with count option

 

Hi Xrg
The bug really exist but the patch was wrong.

Maybe the explication was not clear and short. Actually the option count
is pass to the super method so when the option count is set super method
will return a number and not a list of ids. This why we was thinking to
return this result directly.

In fact as the aim is to filter the number of attachment some line
after. The count option must be set to false in order to have always a
list of id

This bug have been introduce in rev 4096

================

        ids = super(ir_attachment, self)._search(cr, uid, args, offset=offset,
                                                 limit=limit, order=order,
 -                                                context=context, count=count,
+                                                 context=context, count=false,
                                                 access_rights_uid=access_rights_uid)
        if not ids:
            if count:
                return 0
            return []

================



** Patch added: "server.patch"
   https://bugs.launchpad.net/openobject-server/+bug/962229/+attachment/2920896/+files/server.patch

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

Title:
  [6.1][ir_attachement] _search method should work with count option

Status in OpenERP Server:
  New

Bug description:
  In ir_attachement.py line 57: 
  In the override method _search, if the option count is True, the method _search return an number of ids instead of ids.
  In this case the method should return this number directly without trying to read the attachements.

  So I propose to move up : 
  if count:
      return ids
  As I submit in the attachement of the bug

  Best regards,

  Benoît

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


Follow ups

References