[IMP] add more information when searching on a non-searchable field using debug logging

bzr revid: xmo@openerp.com-20120802152553-r8xpw0g6bep08jod
This commit is contained in:
Xavier Morel 2012-08-02 17:25:53 +02:00
parent 937a24a240
commit ef26faf0a5
1 changed files with 7 additions and 2 deletions

View File

@ -122,6 +122,7 @@ start the server specifying the --unaccent flag.
"""
import logging
import traceback
from openerp.tools import flatten, reverse_enumerate
import fields
@ -426,6 +427,7 @@ class expression(object):
# If the field is _inherits'd, search for the working_table,
# and extract the field.
field = None
if field_path[0] in table._inherit_fields:
while True:
field = working_table._columns.get(field_path[0])
@ -475,9 +477,12 @@ class expression(object):
# values in the database, so we must ignore it : we generate a dummy leaf
self.__exp[i] = TRUE_LEAF
_logger.error(
"The field '%s' can not be searched: non-stored "
"The field '%s' (%s) can not be searched: non-stored "
"function field without fnct_search",
field.string)
field.string, left)
# avoid compiling stack trace if not needed
if _logger.isEnabledFor(logging.DEBUG):
_logger.debug(''.join(traceback.format_stack()))
else:
subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context)
if not subexp: