[FIX] ir_qweb: contact widget: properly pass the context when browsing the contact

As the context was not transferred, it was never translated.
This commit is contained in:
Simon Lejeune 2014-09-09 18:16:21 +02:00
parent 9ce08b78ce
commit 2266a96420
1 changed files with 5 additions and 2 deletions

View File

@ -862,15 +862,18 @@ class Contact(orm.AbstractModel):
_inherit = 'ir.qweb.field.many2one'
def record_to_html(self, cr, uid, field_name, record, column, options=None, context=None):
if context is None:
context = {}
if options is None:
options = {}
opf = options.get('fields') or ["name", "address", "phone", "mobile", "fax", "email"]
if not getattr(record, field_name):
return None
id = getattr(record, field_name).id
field_browse = self.pool[column._obj].browse(cr, openerp.SUPERUSER_ID, id, context={"show_address": True})
context.update(show_address=True)
field_browse = self.pool[column._obj].browse(cr, openerp.SUPERUSER_ID, id, context=context)
value = field_browse.name_get()[0][1]
val = {