[FIX] res.users: correctly json-encode modifiers in generated fields_view_get
bzr revid: xmo@openerp.com-20110808115207-y2a0p9c0z4uk7bo5
This commit is contained in:
parent
dad68b79a7
commit
6ab80e92e7
|
@ -20,17 +20,21 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import logging
|
||||
from functools import partial
|
||||
from xml.sax.saxutils import quoteattr
|
||||
|
||||
import simplejson
|
||||
import pytz
|
||||
from lxml import etree
|
||||
|
||||
import netsvc
|
||||
import pooler
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
from osv.orm import browse_record
|
||||
import tools
|
||||
from functools import partial
|
||||
import pytz
|
||||
import pooler
|
||||
from tools.translate import _
|
||||
from service import security
|
||||
import netsvc
|
||||
import logging
|
||||
from lxml import etree
|
||||
from tools.translate import _
|
||||
|
||||
class groups(osv.osv):
|
||||
_name = "res.groups"
|
||||
|
@ -760,13 +764,15 @@ class users_view(osv.osv):
|
|||
if tips:
|
||||
fields[app_name].update(help='\n'.join(tips))
|
||||
fields[sel_name] = {'type': 'selection', 'string': 'Group', 'selection': selection}
|
||||
attrs = {'invisible': [('%s' % app_name, '=', False)]}
|
||||
elems.append("""
|
||||
<field name="%(app)s"/>
|
||||
<field name="%(sel)s" nolabel="1" colspan="2"
|
||||
attrs="{'invisible': [('%(app)s', '=', False)]}"
|
||||
modifiers="{'invisible': [('%(app)s', '=', False)]}"/>
|
||||
attrs=%(attrs)s modifiers=%(json_attrs)s/>
|
||||
<newline/>
|
||||
""" % {'app': app_name, 'sel': sel_name})
|
||||
""" % {'app': app_name, 'sel': sel_name,
|
||||
'attrs': quoteattr(str(attrs)),
|
||||
'json_attrs': quoteattr(simplejson.dumps(attrs))})
|
||||
# create other sections
|
||||
for sec, groups in others:
|
||||
elems.append('<separator colspan="6" string="%s"/>' % sec)
|
||||
|
|
Loading…
Reference in New Issue