[IMP] user: context_get
bzr revid: hmo@tinyerp.com-20100209134652-528dzv3j73hu3i0h
This commit is contained in:
parent
b6a1916f23
commit
18603858e5
|
@ -78,7 +78,7 @@
|
||||||
<form string="Users">
|
<form string="Users">
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
<page string="Current Activity">
|
<page string="Current Activity">
|
||||||
<field name="company_id" widget="selection" readonly="0" context="{'prefence_company':True}"/>
|
<field name="company_id" widget="selection" readonly="0" context="{'user_prefence':True}"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
<separator colspan="4" string="Preferences"/>
|
<separator colspan="4" string="Preferences"/>
|
||||||
</page>
|
</page>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import fields,osv
|
from osv import fields,osv
|
||||||
from osv.orm import except_orm
|
from osv.orm import except_orm, browse_record
|
||||||
import tools
|
import tools
|
||||||
import pytz
|
import pytz
|
||||||
import pooler
|
import pooler
|
||||||
|
@ -296,7 +296,10 @@ class users(osv.osv):
|
||||||
result = {}
|
result = {}
|
||||||
for k in self._columns.keys():
|
for k in self._columns.keys():
|
||||||
if k.startswith('context_'):
|
if k.startswith('context_'):
|
||||||
result[k[8:]] = getattr(user,k)
|
res = getattr(user,k)
|
||||||
|
if isinstance(res, browse_record):
|
||||||
|
res = res.id
|
||||||
|
result[k[8:]] = res
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue