Add clause for res_id = 0 in order for ir.model.*

This commit is contained in:
Cédric Krier
2009-01-28 14:07:02 +01:00
parent 0655bb44fc
commit e025d706f1
+4 -2
View File
@@ -3046,12 +3046,13 @@ class ORM(object):
table_join = 'LEFT JOIN "ir_translation" ' \
'AS "%s" ON ' \
'(%s.name = ir_model.model||\',%s\' ' \
'AND %s.res_id = 0 ' \
'AND %s.lang = %%s ' \
'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'
@@ -3064,12 +3065,13 @@ class ORM(object):
table_join = 'LEFT JOIN "ir_translation" ' \
'AS "%s" ON ' \
'(%s.name = ir_model.model||\',\'||%s.name ' \
'AND %s.res_id = 0 ' \
'AND %s.lang = %%s ' \
'AND %s.type = \'%s\' ' \
'AND %s.fuzzy = false)' % \
(translation_table, translation_table, table_name,
translation_table, translation_table,
ttype, translation_table)
translation_table, ttype, translation_table)
else:
table_join = 'LEFT JOIN "ir_translation" ' \
'AS "%s" ON ' \