[FIX] avoid a bug when look in stack when translate code strings

bzr revid: christophe@tinyerp.com-20090813110643-9y2wgb6omp6odjsz
This commit is contained in:
Christophe Simonis
2009-08-13 13:06:43 +02:00
parent 076c4f13d6
commit e0a62de1ad
+5 -1
View File
@@ -125,7 +125,11 @@ def translate(cr, name, source_type, lang, source=None):
class GettextAlias(object):
def __call__(self, source):
frame = inspect.stack()[1][0]
try:
frame = inspect.stack()[1][0]
except:
return source
cr = frame.f_locals.get('cr')
lang = (frame.f_locals.get('context') or {}).get('lang', False)
if not (lang and cr):