Skip to content

Commit

Permalink
[FIX] ir_qweb: contact widget: properly pass the context when browsin…
Browse files Browse the repository at this point in the history
…g the contact

As the context was not transferred, it was never translated.
  • Loading branch information
sle-odoo committed Sep 9, 2014
1 parent 9ce08b7 commit 2266a96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openerp/addons/base/ir/ir_qweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 2266a96

Please sign in to comment.