From e578e2af784cb3af11ceae7d07cc07c7036a85e9 Mon Sep 17 00:00:00 2001 From: "Mohammed Shekha (OpenERP)" Date: Thu, 17 Oct 2013 18:32:17 +0530 Subject: [PATCH] [FIX]Fix the issue of page navigation when all records of current page are deleted, currently it does not go to previous page instead displays blank list, expected behavior: it should navigated to previous page when all records of the current page deleted. bzr revid: msh@openerp.com-20131017130217-dtpukpq27fdmsvd9 --- addons/web/static/src/js/view_list.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 74c2fc47aee..dd8b62ae619 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -593,7 +593,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi _(ids).each(function (id) { self.records.remove(self.records.get(id)); }); - self.configure_pager(self.dataset); + if (self.records.length == 0 && self.page > 0) { + //Trigger previous manually to navigate to previous page, + //If all records are deleted on current page. + self.$pager.find('ul li:first a').trigger('click'); + } else { + self.configure_pager(self.dataset); + } self.compute_aggregates(); }); },