Anandkumar (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-1095251-pan into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #1095251 in OpenERP Server: "[Trunk] Impossible to look for a user whose 
language is none (inexistant)"
  https://bugs.launchpad.net/openobject-server/+bug/1095251

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-1095251-pan/+merge/143845

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.

Thanks,
PAN 
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-1095251-pan/+merge/143845
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-1095251-pan.
=== modified file 'addons/web/static/src/js/search.js'
--- addons/web/static/src/js/search.js	2013-01-14 14:02:43 +0000
+++ addons/web/static/src/js/search.js	2013-01-18 10:36:21 +0000
@@ -1738,6 +1738,13 @@
         var children = this.getChildren();
         var propositions = _.invoke(children, 'get_proposition');
         var domain = _(propositions).pluck('value');
+        
+        // if operator is '!=' then add another domain for null value
+        var field = children[0].attrs.selected.name;
+        if ((domain[domain.length - 1][1] == '!=') && (domain[domain.length - 1][2] != null )) {
+            domain[domain.length] = [field, '=', null]
+        }
+        
         for (var i = domain.length; --i;) {
             domain.unshift('|');
         }
@@ -1875,7 +1882,7 @@
         {value: "!=", text: _lt("is not equal to")}
     ],
     get_value: function() {
-        return this.$el.val();
+        return this.$el.val() || null;
     }
 });
 instance.web.search.ExtendedSearchProposition.DateTime = instance.web.search.ExtendedSearchProposition.Field.extend({
@@ -1961,6 +1968,14 @@
 });
 instance.web.search.ExtendedSearchProposition.Selection = instance.web.search.ExtendedSearchProposition.Field.extend({
     template: 'SearchView.extended_search.proposition.selection',
+    init: function  (parent ,field) {
+        this._super.apply(this, arguments);
+        this.field = field;
+        this.field.selection = _(this.field.selection).chain()
+            .reject(function (v) { return v[0] === false && v[1] === ''; })
+            .unshift([null, ''])
+            .value();
+    },
     operators: [
         {value: "=", text: _lt("is")},
         {value: "!=", text: _lt("is not")}
@@ -1971,7 +1986,7 @@
         return option.label || option.text;
     },
     get_value: function() {
-        return this.$el.val();
+        return this.$el.val() || null;
     }
 });
 instance.web.search.ExtendedSearchProposition.Boolean = instance.web.search.ExtendedSearchProposition.Field.extend({

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to