Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-opw-578685-msh into 
lp:openobject-client-web.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-578685-msh/+merge/122620

Hello,

Fixed the issue of many2many pager inconsistent behaviour.

Demo:- Create some more records in many2many like in partner category I have 
500 records and limit is 50, so now to check inconsistency just click on next 
paging records in 2/3 times you will get the issue.

when you click next records 2/3 times the count is shown proper but the record 
will not be appear.

Reason :- The issue is generated due to 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-383682-msh/+merge/93358
 because ids were assigned filtered ids based on current.offset and 
current.limit due to which when next page is opened so we will get only 
filtered ids in ids.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-578685-msh/+merge/122620
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-578685-msh.
=== modified file 'addons/openerp/widgets/form/_m2m.py'
--- addons/openerp/widgets/form/_m2m.py	2012-06-08 16:55:21 +0000
+++ addons/openerp/widgets/form/_m2m.py	2012-09-04 06:51:57 +0000
@@ -95,16 +95,17 @@
         if not current:
             current = TinyDict()
 
+        search_ids = attrs.get('value')
         current.offset = current.offset or 0
         current.limit = current.limit or 50
-        current.count = len(ids or [])
+        current.count = len(search_ids or [])
 
         if isinstance(ids, tuple):
             ids = list(ids)
 
-        if ids and current.limit != -1 and not params.sort_key:
-            ids = ids[current.offset: current.offset+current.limit]
-        
+        if ids and current.limit != -1 and not params.sort_key and len(search_ids) > current.limit:
+            ids = search_ids[current.offset: current.offset+current.limit]
+
         if self.name == params.source and params.sort_key and ids:
             domain = current.domain or []
             domain.append(('id','in',ids))

_______________________________________________
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

Reply via email to