Merge lp:~openerp-dev/openobject-server/6.1-opw-576295-rgo into lp:openobject-server/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 4224
Merged at revision: 4259
Proposed branch: lp:~openerp-dev/openobject-server/6.1-opw-576295-rgo
Merge into: lp:openobject-server/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
openerp/addons/base/ir/ir_attachment.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.1-opw-576295-rgo
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Approve
Naresh(OpenERP) (community) Approve
Review via email: mp+112295@code.launchpad.net

Description of the change

Hello,

If any file in `Attachments` is referring to a record, reading that record will throw traceback in GTK-Client.

Steps to reproduce the issue:

Go to Customer view, open record for `Agrolait` in form view, add an attachment for this record.

Reload the 'Agrolait' in form view, a traceback will be faced saying,
`TypeError: 'bool' object is not iterable`.

This fix fixes this issue. Kindly review it.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

The issue is a result of a regression generated at 4069 <email address hidden> where the count=False was changed to count=count. Where as we expect ids and not the count from super here

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Looks good, thanks! (And sorry for introducing the original mistake)

PS: as a workaround, installing base_calendar or document modules looks like it bypasses the issue

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/addons/base/ir/ir_attachment.py'
2--- openerp/addons/base/ir/ir_attachment.py 2012-03-09 10:04:29 +0000
3+++ openerp/addons/base/ir/ir_attachment.py 2012-06-27 09:03:25 +0000
4@@ -57,7 +57,7 @@
5 def _search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None):
6 ids = super(ir_attachment, self)._search(cr, uid, args, offset=offset,
7 limit=limit, order=order,
8- context=context, count=count,
9+ context=context, count=False,
10 access_rights_uid=access_rights_uid)
11 if not ids:
12 if count: