[FIX] Translation should not fail if lang=False is passed anyhow
bzr revid: ach@tinyerp.com-20100726130052-fwvjx0z4qf2xxaf6
This commit is contained in:
@@ -133,16 +133,18 @@ class ir_translation(osv.osv):
|
||||
'and type=%s ' \
|
||||
'and name=%s ' \
|
||||
'and src=%s',
|
||||
(lang, tt, tools.ustr(name), source))
|
||||
(lang or '', tt, tools.ustr(name), source))
|
||||
else:
|
||||
cr.execute('select value ' \
|
||||
'from ir_translation ' \
|
||||
'where lang=%s ' \
|
||||
'and type=%s ' \
|
||||
'and name=%s',
|
||||
(lang, tt, tools.ustr(name)))
|
||||
(lang or '', tt, tools.ustr(name)))
|
||||
res = cr.fetchone()
|
||||
trad = res and res[0] or ''
|
||||
if source and not trad:
|
||||
return source
|
||||
return trad
|
||||
|
||||
def create(self, cursor, user, vals, context=None):
|
||||
|
||||
Reference in New Issue
Block a user