Add missing fuzzy test in _where_calc and _order_calc for issue697

This commit is contained in:
Cédric Krier
2009-01-24 19:48:18 +01:00
parent c0ab5ea7a0
commit 274ea2733e
+12 -6
View File
@@ -2756,6 +2756,7 @@ class ORM(object):
query1 = '(SELECT res_id FROM ir_translation ' \
'WHERE name = %s AND lang = %s ' \
'AND type = %s ' \
'AND fuzzy = false ' \
'AND (value ' + args[i][1] + ' %s ' \
+ oper +' value ' + args[i][1] + ' %s))'
query2 = [table._name + ',' + args[i][0],
@@ -3014,9 +3015,11 @@ class ORM(object):
'AS "%s" ON ' \
'(%s.name = ir_model.model||\',%s\' ' \
'AND %s.lang = %%s ' \
'AND %s.type = \'model\')' % \
'AND %s.type = \'model\' ' \
'AND %s.fuzzy = false)' % \
(translation_table, translation_table, field_name,
translation_table, translation_table)
translation_table, translation_table,
translation_table)
elif self._name == 'ir.model.field':
if field_name == 'field_description':
ttype = 'field'
@@ -3030,20 +3033,23 @@ class ORM(object):
'AS "%s" ON ' \
'(%s.name = ir_model.model||\',\'||%s.name ' \
'AND %s.lang = %%s ' \
'AND %s.type = \'%s\')' % \
'AND %s.type = \'%s\' ' \
'AND %s.fuzzy = false)' % \
(translation_table, translation_table, table_name,
translation_table, translation_table,
ttype)
ttype, translation_table)
else:
table_join = 'LEFT JOIN "ir_translation" ' \
'AS "%s" ON ' \
'(%s.res_id = %s.id ' \
'AND %s.name = \'%s,%s\' ' \
'AND %s.lang = %%s ' \
'AND %s.type = \'model\')' % \
'AND %s.type = \'model\' ' \
'AND %s.fuzzy = false)' % \
(translation_table, translation_table, table_name,
translation_table, self._name, field_name,
translation_table, translation_table)
translation_table, translation_table,
translation_table)
if table_join not in tables:
tables.append(table_join)
tables_args[table_join] = [context.get('language') or 'en_US']