[FIX] guess the language in which the document must be translated without triggering an orm warning

bzr revid: sle@openerp.com-20140403162138-6yvh3q24n39tdi4r
This commit is contained in:
Simon Lejeune
2014-04-03 18:21:38 +02:00
parent d5c06607b6
commit ff1e5edcea
+2 -2
View File
@@ -124,9 +124,9 @@ class Report(osv.Model):
else:
# Guessing the lang we want to translate the doc into
newlang = None
if hasattr(doc, 'partner_id'):
if doc._model._all_columns.get('partner_id'):
newlang = doc.partner_id.lang
elif hasattr(doc, 'lang'):
elif doc._model._all_columns.get('lang'):
newlang = doc.lang
if newlang:
ctx['lang'] = newlang