Merge lp:~openerp-dev/openerp-web/7.0-opw-589888-ado into lp:openerp-web/7.0

Proposed by Amit Dodiya (OpenERP)
Status: Rejected
Rejected by: Christophe Matthieu (OpenERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-589888-ado
Merge into: lp:openerp-web/7.0
Diff against target: 18 lines (+1/-7)
1 file modified
addons/web/static/src/js/view_list.js (+1/-7)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-589888-ado
Reviewer Review Type Date Requested Status
Christophe Matthieu (OpenERP) (community) Disapprove
Review via email: mp+155559@code.launchpad.net

Description of the change

Hello,

[FIX] view_list: when we have more than 80 record in list and we create new record and switch the views like form->list->form gives traceback

Steps:
1). Goto Sale--> Address Book--> Localization--> Countries
2). Create new country, now switch to list view and again switch to form view
This gives you blank page
Same issue happens in account creation, in account creation this gives traceback.

Regards,
Amit Dodiya

To post a comment you must log in.
Revision history for this message
Christophe Matthieu (OpenERP) (chm-openerp) wrote :

Hi,
It's a wrong fix.
Forgot index value in all case.
I fixed this in 7.0

review: Disapprove

Unmerged revisions

3868. By Amit Dodiya (OpenERP)

[FIX] view_list: when we have more than 80 record in list and we create new record and switch the view to form it gives traceback due to index is set to 81 instead of 0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_list.js'
2--- addons/web/static/src/js/view_list.js 2013-03-22 16:23:10 +0000
3+++ addons/web/static/src/js/view_list.js 2013-03-26 17:13:30 +0000
4@@ -503,13 +503,7 @@
5 var reloaded = $.Deferred();
6 this.$el.find('.oe_list_content').append(
7 this.groups.render(function () {
8- if (self.dataset.index == null) {
9- var has_one = false;
10- self.records.each(function () { has_one = true; });
11- if (has_one) {
12- self.dataset.index = 0;
13- }
14- }
15+ self.dataset.index = self.records.length ? 0 : null;
16 self.compute_aggregates();
17 reloaded.resolve();
18 }));