[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user