Merge lp:~openerp-dev/openerp-web/7.0-opw-589782-cbi into lp:openerp-web/7.0

Proposed by Chris Biersbach (OpenERP)
Status: Rejected
Rejected by: Xavier (Open ERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-589782-cbi
Merge into: lp:openerp-web/7.0
Diff against target: 21 lines (+2/-2)
1 file modified
addons/web/static/src/js/view_form.js (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-589782-cbi
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Needs Fixing
Csaba TOTH (community) Disapprove
Review via email: mp+153147@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris Biersbach (OpenERP) (cbi-openerp) wrote :

The issue: A maximum of 7 entries appear in o2m fields (it should be 8)

The reason: The limit was set to 7, the search was done with limit+1 (8).
The results were then sliced (0 to 7 NOT included) -> 7 results

The fix: I changed the limit o 8, the search to limit and now the slice actually behaves the way we want (8 entries)

Revision history for this message
Csaba TOTH (tsabi) wrote :

I tested this patch, and this eliminitaes the "Search more..." action to show up in the list!

review: Disapprove
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

`limit + 1` is specifically to get one more record if there is, so `Search More` can be displayed if there are more than `this.limit` records in database. Otherwise can not know if there are more than this.limit records in database without second request.

To get 8 records, should just set limit to 8, not change limit in name_search.

review: Needs Fixing

Unmerged revisions

3840. By Chris Biersbach (OpenERP)

[FIX] web: I corrected the limit in the CompletionFieldMixin to 8 instead of 7 so that actually 8 entries appear (instead of 7). This was caused by an incorrect use of the slice method, which does not include the upper bound.

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_form.js'
2--- addons/web/static/src/js/view_form.js 2013-03-13 10:17:56 +0000
3+++ addons/web/static/src/js/view_form.js 2013-03-13 14:17:08 +0000
4@@ -2841,7 +2841,7 @@
5 */
6 instance.web.form.CompletionFieldMixin = {
7 init: function() {
8- this.limit = 7;
9+ this.limit = 8;
10 this.orderer = new instance.web.DropMisordered();
11 },
12 /**
13@@ -2856,7 +2856,7 @@
14
15 return this.orderer.add(dataset.name_search(
16 search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]),
17- 'ilike', this.limit + 1, self.build_context())).then(function(data) {
18+ 'ilike', this.limit, self.build_context())).then(function(data) {
19 self.last_search = data;
20 // possible selections for the m2o
21 var values = _.map(data, function(x) {