[FIX] ir_qweb: contact widget: properly pass the context when browsing the contact
authorSimon Lejeune <sle@openerp.com>
Tue, 9 Sep 2014 16:16:21 +0000 (18:16 +0200)
committerSimon Lejeune <sle@openerp.com>
Tue, 9 Sep 2014 16:16:21 +0000 (18:16 +0200)
As the context was not transferred, it was never translated.

openerp/addons/base/ir/ir_qweb.py

index 8ce38a2..a6f4dd8 100644 (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 = {