Reduce offset when no search result
issue7966 review60461002
This commit is contained in:
1 parent
f3565724be
commit
3fcef1f985
2 files changed
+12
-6
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Reduce offset when no search result
|
||||
* Ensure URL scheme of bus (issue7792)
|
||||
* Add drag & drop support on binary widget
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ class Screen(SignalEvent):
|
||||
|
||||
def search_prev(self, search_string):
|
||||
if self.limit:
|
||||
self.offset -= self.limit
|
||||
self.offset = max(self.offset - self.limit, 0)
|
||||
self.search_filter(search_string=search_string)
|
||||
|
||||
def search_next(self, search_string):
|
||||
@@ -271,11 +271,16 @@ class Screen(SignalEvent):
|
||||
context = self.context
|
||||
if self.screen_container.but_active.get_active():
|
||||
context['active_test'] = False
|
||||
try:
|
||||
ids = RPCExecute('model', self.model_name, 'search', domain,
|
||||
self.offset, self.limit, self.order, context=context)
|
||||
except RPCException:
|
||||
ids = []
|
||||
ids = []
|
||||
while True:
|
||||
try:
|
||||
ids = RPCExecute('model', self.model_name, 'search', domain,
|
||||
self.offset, self.limit, self.order, context=context)
|
||||
except RPCException:
|
||||
break
|
||||
if ids or self.offset <= 0:
|
||||
break
|
||||
self.offset = max(self.offset - self.limit, 0)
|
||||
if not only_ids:
|
||||
if self.limit is not None and len(ids) == self.limit:
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user