From 1f15055de35b07e10d8082086abf3a97fd284801 Mon Sep 17 00:00:00 2001
From: Raphael Collet <rco@openerp.com>
Date: Wed, 24 Sep 2014 11:12:44 +0200
Subject: [PATCH] [FIX] fields: a function field with fnct_search should be
 searchable

---
 openerp/fields.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/openerp/fields.py b/openerp/fields.py
index 1381a3df8443..a679ffbe58b2 100644
--- a/openerp/fields.py
+++ b/openerp/fields.py
@@ -557,7 +557,11 @@ class Field(object):
         return False
 
     def _description_searchable(self, env):
-        return self._description_store(env) or bool(self.search)
+        if self.store:
+            column = env[self.model_name]._columns.get(self.name)
+            return bool(getattr(column, 'store', True)) or \
+                   bool(getattr(column, '_fnct_search', False))
+        return bool(self.search)
 
     _description_manual = property(attrgetter('manual'))
     _description_depends = property(attrgetter('depends'))
-- 
GitLab