Chirag Patel (OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/6.0-opw-575137-cpa into
lp:openobject-server/6.0.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-575137-cpa/+merge/108140
Hello,
Fixed ir attachment not return all ids when search.
Demo:
1) Project task named *Task A* which contains 13 files attached (named
*Document 001 a.txt to Document 013 a.txt*)
2) Project task named *Task B* which contains also 13 files (named *Document
001 b.txt to Document 013 b.txt*)
3) Under the Knowledge/Documents section, those 26 files are displayed
correctly, even if I sort the list by name or changing the limit to 20 records
per page, or anyother option.
4) Delete the *Task A* from Project/Tasks, without deleting the attached files.
Those files remains binary into the database, but they are hidden.
5) Go to Knowledge/Documents and check the files displayed there. There are 13
files, those which are attached to the remaining task named *Task B*.
6) Sort the documents list by name and change the limit to 20 records per page.
Now, the list displays only 10 documents.
video link:
http://blip.tv/emylmatei/knowledge-documents-list-display-wrong-number-of-records-per-page-scenario-6160548
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-575137-cpa/+merge/108140
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/6.0-opw-575137-cpa.
=== modified file 'bin/addons/base/ir/ir_attachment.py'
--- bin/addons/base/ir/ir_attachment.py 2011-05-02 11:57:10 +0000
+++ bin/addons/base/ir/ir_attachment.py 2012-05-31 10:53:23 +0000
@@ -57,8 +57,8 @@
def search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False):
- ids = super(ir_attachment, self).search(cr, uid, args, offset=offset,
- limit=limit, order=order,
+ ids = super(ir_attachment, self).search(cr, uid, args, offset=0,
+ limit=0, order=order,
context=context, count=False)
if not ids:
if count:
@@ -95,6 +95,10 @@
ids.remove(attach_id)
if count:
return len(ids)
+
+ ids = ids[offset:]
+ ids = ids[:limit]
+
return ids
def read(self, cr, uid, ids, fields_to_read=None, context=None, load='_classic_read'):
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp