[FIX] Advanced view adaptations to new facet & value shapes
authorXavier Morel <xmo@openerp.com>
Thu, 3 May 2012 19:36:45 +0000 (21:36 +0200)
committerXavier Morel <xmo@openerp.com>
Thu, 3 May 2012 19:36:45 +0000 (21:36 +0200)
bzr revid: xmo@openerp.com-20120503193645-ccap97ojw9cgre3y

addons/web/static/src/js/search.js

index a17839f..39a53cf 100644 (file)
@@ -1416,16 +1416,18 @@ instance.web.search.Advanced = instance.web.search.Input.extend({
         var children = this.getChildren(),
             domain = _.invoke(children, 'get_proposition');
         var filters = _(domain).map(function (section) {
-            return new instance.web.search.Filter({attrs: {
-                string: _.str.sprintf('%s(%s)%s',
-                    section[0], section[1], section[2]),
-                domain: [section]
-            }}, self.view);
+            return {
+                label: _.str.sprintf('%s(%s)%s',
+                        section[0], section[1], section[2]),
+                value: new instance.web.search.Filter({attrs: {
+                    domain: [section]
+                }}, self.view)
+            };
         });
         // Create Filter (& FilterGroup around it) with that domain
         var f = new instance.web.search.FilterGroup(filters, this.view);
         // add group to query
-        this.query.add({
+        this.view.query.add({
             category: _t("Advanced"),
             values: filters,
             field: f