Merge lp:~openerp-dev/openerp-web/7.0-opw-590811-msh into lp:openerp-web/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Merged
Merge reported by: Mohammed Shekha(Open ERP)
Merged at revision: not available
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-590811-msh
Merge into: lp:openerp-web/7.0
Diff against target: 11 lines (+1/-0)
1 file modified
addons/web/static/src/js/view_list.js (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-590811-msh
Reviewer Review Type Date Requested Status
Csaba TOTH (community) Approve
OpenERP Core Team Pending
Review via email: mp+156352@code.launchpad.net

Description of the change

Hello,

Fixed the issue of pager not updated in switch view.

Demo:- Open any list view and delete one record from list view pager is updated(correct) and open any record by clicking on row(note it is generated only if you click on row, it is not generated if you click on switch view button.) pager shows old count which not correct.

Reason:- when record is unlinked dataset got updated, _length is reduced also dataset.ids removed unlink of dataset but when we click on row we triggered row_link with dataset of Listview.List this dataset contains old ids, so when you open record by clicking on row you will get old dataset.ids.length.

When record is removed from record collection, dataset.ids must also be removed from dataset.

Thanks.

To post a comment you must log in.
Revision history for this message
Csaba TOTH (tsabi) wrote :

Tested. works!

review: Approve
Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

Same thing has been merged in revision 3898.

Thanks.

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-04-01 13:30:04 +0000
4@@ -898,6 +898,7 @@
5 var $row = self.$current.children(
6 '[data-id=' + record.get('id') + ']');
7 var index = $row.data('index');
8+ self.dataset.ids = _(self.dataset.ids).difference(record.get('id'));
9 $row.remove();
10 },
11 'reset': function () { return self.on_records_reset(); },