Skip to content
Snippets Groups Projects
Commit 1424e15a authored by Jérémie Gavrel's avatar Jérémie Gavrel
Browse files

Fixed a bug where fields added by analytic_dimensions were always read-only

parent 9eb2dc32
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,6 @@
lambda self, cr, uid, ids, *a: {i: '' for i in ids},
string=u"Analytic Dimensions",
readonly=True,
invisible=True,
store=False,
)
......
......@@ -309,5 +309,11 @@
# Now we can insert the fields in the view's architecture.
for field in elem_fields:
attrs = {'name': field, 'modifiers': '{}'}
attrs = {'name': field}
modifiers = json.loads(elem.attrib.get('modifiers', {}))
attrs['modifiers'] = json.dumps({
attr: value for attr, value in modifiers.iteritems()
if attr == 'readonly' or
elem.attrib.get(attr, 'False') in ('True', 'true', '1')
})
for attr, value in elem.attrib.iteritems():
......@@ -313,5 +319,5 @@
for attr, value in elem.attrib.iteritems():
if attr in ['name', 'prefix']:
if attr in ['name', 'prefix', 'suffix', 'modifiers']:
continue
attrs[attr] = value
parent.append(etree.Element('field', attrs))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment