[FIX] orm: pass context if widget selection in __view_look_dom method

bzr revid: hmo@tinyerp.com-20100209051214-qlsi5ld42y8srtu5
This commit is contained in:
Harry (Open ERP) 2010-02-09 10:42:14 +05:30
parent c5a3905c8b
commit c2ac394eae
2 changed files with 2 additions and 1 deletions

View File

@ -78,7 +78,7 @@
<form string="Users">
<notebook colspan="4">
<page string="Current Activity">
<field name="company_id" widget="selection" readonly="0"/>
<field name="company_id" widget="selection" readonly="0" context="{'prefence_company':True}"/>
<newline/>
<separator colspan="4" string="Preferences"/>
</page>

View File

@ -1076,6 +1076,7 @@ class orm_template(object):
if column._domain and not isinstance(column._domain, (str, unicode)):
dom = column._domain
dom += eval(node.get('domain','[]'), {'uid':user, 'time':time})
context.update(eval(node.get('context','{}')))
attrs['selection'] = self.pool.get(relation).name_search(cr, user, '', dom, context=context)
if (node.get('required') and not int(node.get('required'))) or not column.required:
attrs['selection'].append((False,''))