From 2266a96420bc008fb0c83858a4b5ae8dec0c84e8 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Tue, 9 Sep 2014 18:16:21 +0200 Subject: [PATCH] [FIX] ir_qweb: contact widget: properly pass the context when browsing the contact As the context was not transferred, it was never translated. --- openerp/addons/base/ir/ir_qweb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index 8ce38a292d3..a6f4dd8dd5c 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -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 = {