From 135962184d68e278ee564502d079cb3235035015 Mon Sep 17 00:00:00 2001
From: Christophe Simonis <chs@odoo.com>
Date: Wed, 6 Aug 2014 17:27:27 +0200
Subject: [PATCH] [FIX] web: make search by `id` possible.

+ correct tests
---
 addons/web/static/src/js/search.js | 2 +-
 addons/web/static/test/search.js   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index b686a4861550..7ed70f7bc685 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -1963,7 +1963,7 @@ instance.web.search.Advanced = instance.web.search.Input.extend({
                     context: this.view.dataset.context
                 }).done(function(data) {
                     self.fields = {
-                        id: { string: 'ID', type: 'id' }
+                        id: { string: 'ID', type: 'id', searchable: true }
                     };
                     _.each(data, function(field_def, field_name) {
                         if (field_def.selectable !== false && field_name != 'id') {
diff --git a/addons/web/static/test/search.js b/addons/web/static/test/search.js
index d93cb131e059..828347b68a55 100644
--- a/addons/web/static/test/search.js
+++ b/addons/web/static/test/search.js
@@ -157,7 +157,7 @@ var makeSearchView = function (instance, dummy_widget_attributes, defaults) {
             return {
                 type: 'search',
                 fields: {
-                    dummy: {type: 'char', string: "Dummy"}
+                    dummy: {type: 'char', string: "Dummy", searchable: true}
                 },
                 arch: '<search><field name="dummy" widget="dummy"/></search>'
             };
@@ -168,7 +168,7 @@ var makeSearchView = function (instance, dummy_widget_attributes, defaults) {
     };
     instance.session.responses['dummy.model:fields_get'] = function () {
         return {
-            dummy: {type: 'char', string: 'Dummy'}
+            dummy: {type: 'char', string: 'Dummy', searchable: true}
         };
     };
     instance.client = { action_manager: { inner_action: undefined } };
-- 
GitLab