[IMP] base: default separator for view attribute alteration is now ,

This commit is contained in:
Christophe Simonis
2015-09-04 17:56:08 +02:00
parent 6672e45ba4
commit 69ddcb3234
2 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -533,7 +533,9 @@ class view(osv.osv):
value = child.text or ''
if child.get('add') or child.get('remove'):
assert not child.text
separator = child.get('separator', None)
separator = child.get('separator', ',')
if separator == ' ':
separator = None # squash spaces
to_add = map(str.strip, child.get('add', '').split(separator))
to_remove = map(str.strip, child.get('remove', '').split(separator))
values = map(str.strip, node.get(attribute, '').split(separator))
+3 -3
View File
@@ -744,9 +744,9 @@ class test_views(ViewCase):
'arch': """
<footer position="attributes">
<attribute name="thing">bob tata lolo</attribute>
<attribute name="thing" add="bibi" remove="tata"/>
<attribute name="thing" add="bibi and co" remove="tata" separator=" " />
<attribute name="otherthing">bob, tata,lolo</attribute>
<attribute name="otherthing" add="bibi" remove="tata, bob" separator=","/>
<attribute name="otherthing" add="bibi" remove="tata, bob"/>
</footer>
"""
})
@@ -766,7 +766,7 @@ class test_views(ViewCase):
E.p("Replacement data"),
E.footer(
E.button(name="action_next", type="object", string="New button"),
thing="bob lolo bibi", otherthing="lolo,bibi"
thing="bob lolo bibi and co", otherthing="lolo,bibi"
),
string="Replacement title", version="7.0"))