Merge lp:~openerp-dev/openerp-web/7.0-bug-1095251-pan into lp:openerp-web/7.0

Proposed by Anand
Status: Rejected
Rejected by: Xavier (Open ERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-bug-1095251-pan
Merge into: lp:openerp-web/7.0
Diff against target: 50 lines (+17/-2)
1 file modified
addons/web/static/src/js/search.js (+17/-2)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-bug-1095251-pan
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Disapprove
Review via email: mp+144244@code.launchpad.net

Description of the change

Hello,

fixed the issue of "Impossible to look for a user whose language is none".

-Here if user select blank in language then it stores as null.
-And the advanced search looks for only not null values.
-So, Added domain for the null values.
-And also added a blank option in drop-down to select blank if required.

Thanks,
PAN

To post a comment you must log in.
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Reimplemented 6.1's generic "is set"/"is not set" operators.

review: Disapprove

Unmerged revisions

3709. By Anand

[FIX][7.0]Impossible to look for a user whose language is none (inexistant)

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/search.js'
2--- addons/web/static/src/js/search.js 2013-01-14 13:51:45 +0000
3+++ addons/web/static/src/js/search.js 2013-01-22 08:59:23 +0000
4@@ -1745,6 +1745,13 @@
5 var children = this.getChildren();
6 var propositions = _.invoke(children, 'get_proposition');
7 var domain = _(propositions).pluck('value');
8+
9+ // if operator is '!=' then add another domain for null value
10+ var field = children[0].attrs.selected.name;
11+ if ((domain[domain.length - 1][1] == '!=') && (domain[domain.length - 1][2] != null )) {
12+ domain[domain.length] = [field, '=', null]
13+ }
14+
15 for (var i = domain.length; --i;) {
16 domain.unshift('|');
17 }
18@@ -1882,7 +1889,7 @@
19 {value: "!=", text: _lt("is not equal to")}
20 ],
21 get_value: function() {
22- return this.$el.val();
23+ return this.$el.val() || null;
24 }
25 });
26 instance.web.search.ExtendedSearchProposition.DateTime = instance.web.search.ExtendedSearchProposition.Field.extend({
27@@ -1968,6 +1975,14 @@
28 });
29 instance.web.search.ExtendedSearchProposition.Selection = instance.web.search.ExtendedSearchProposition.Field.extend({
30 template: 'SearchView.extended_search.proposition.selection',
31+ init: function (parent ,field) {
32+ this._super.apply(this, arguments);
33+ this.field = field;
34+ this.field.selection = _(this.field.selection).chain()
35+ .reject(function (v) { return v[0] === false && v[1] === ''; })
36+ .unshift([null, ''])
37+ .value();
38+ },
39 operators: [
40 {value: "=", text: _lt("is")},
41 {value: "!=", text: _lt("is not")}
42@@ -1978,7 +1993,7 @@
43 return option.label || option.text;
44 },
45 get_value: function() {
46- return this.$el.val();
47+ return this.$el.val() || null;
48 }
49 });
50 instance.web.search.ExtendedSearchProposition.Boolean = instance.web.search.ExtendedSearchProposition.Field.extend({