[IMP] base: default separator for view attribute alteration is now ,
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user