[IMP] skip injection of data-oe-* attributes outside of editable mode

bzr revid: xmo@openerp.com-20140317110904-k8bptgv7y2yhhh8s
This commit is contained in:
Xavier Morel 2014-03-17 12:09:04 +01:00
parent 8ffc4d0a5a
commit a2ef044c47
1 changed files with 8 additions and 7 deletions

View File

@ -488,7 +488,6 @@ class FieldConverter(osv.AbstractModel):
A default configuration key is ``widget`` which can override the
field's own ``_type``.
"""
content = None
try:
content = self.record_to_html(
cr, uid, field_name, record,
@ -503,12 +502,14 @@ class FieldConverter(osv.AbstractModel):
field_name, record._model._name, exc_info=True)
content = None
g_att += ''.join(
' %s="%s"' % (name, werkzeug.utils.escape(value))
for name, value in self.attributes(
cr, uid, field_name, record, options,
source_element, g_att, t_att, qweb_context)
)
if context and context.get('inherit_branding'):
# add branding attributes
g_att += ''.join(
' %s="%s"' % (name, werkzeug.utils.escape(value))
for name, value in self.attributes(
cr, uid, field_name, record, options,
source_element, g_att, t_att, qweb_context)
)
return self.render_element(cr, uid, source_element, t_att, g_att,
qweb_context, content)