~viktor-nagy/openobject-client-web/treegrid-buttons

« back to all changes in this revision

Viewing changes to addons/openerp/widgets/listgroup.py

  • Committer: Viktor Nagy
  • Date: 2011-07-12 05:03:07 UTC
  • mfrom: (4529.1.136 6.0)
  • Revision ID: viktor.nagy@toolpart.hu-20110712050307-evyo7xzx8o7x10kk
mergedĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
 
142
142
        proxy = rpc.RPCProxy(model)
143
143
 
 
144
        # adding the piece of code to set limit as 0 to get rid of pager's negative offset error.
 
145
        # Here, we don't change the self.limit as Pager needs -1 to treat Unlimited limit  atribute
 
146
        terp_offset, terp_limit = self.offset, self.limit
 
147
        if self.limit < 0:
 
148
            terp_offset, terp_limit = 0, 0
 
149
 
144
150
        custom_search_domain = getattr(cherrypy.request, 'custom_search_domain', [])
145
151
        custom_filter_domain = getattr(cherrypy.request, 'custom_filter_domain', [])
146
152
 
152
158
 
153
159
 
154
160
        if ids is None and not self.group_by_no_leaf:
155
 
            if self.limit > 0:
156
 
                ids = proxy.search(self.domain, self.offset, self.limit, 0, self.context)
157
 
            else:
158
 
                ids = proxy.search(self.domain, 0, 0, 0, self.context)
 
161
 
 
162
            ids = proxy.search(self.domain, terp_offset, terp_limit, 0, self.context)
159
163
 
160
164
            if len(ids) < self.limit:
161
165
                self.count = len(ids)
209
213
            if not grp_rec.get('__context'):
210
214
                grp_rec['__context'] = {'group_by': self.group_by_ctx}
211
215
 
212
 
        self.grouped, grp_ids = parse_groups(self.group_by_ctx, self.grp_records, self.headers, self.ids, model,  self.offset, self.limit, self.context, self.data, self.field_total, fields)
 
216
        self.grouped, grp_ids = parse_groups(self.group_by_ctx, self.grp_records, self.headers, self.ids, model, terp_offset, terp_limit, self.context, self.data, self.field_total, fields)
213
217
 
214
218
        if self.pageable:
215
219
            self.count = len(self.grouped)