Skip to content

Commit 02191aa

Browse files
authored
Merge pull request #8210 from 4teamwork/es/TI-3289-fix-sip-package-with-custom-fields
Fix sip package generation if using multiple choice custom fields.
2 parents 2e65c2c + 44c148e commit 02191aa

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

changes/TI-3289.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix sip package generation if using multiple choice custom fields. [elioschmutz]

opengever/disposition/ech0160/model/additional_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_additional_data(obj):
1313
if value is None:
1414
continue
1515

16-
if isinstance(value, list):
16+
if isinstance(value, list) or isinstance(value, set):
1717
value = u', '.join(value)
1818

1919
if isinstance(value, bool):

opengever/disposition/tests/test_model.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,23 +366,26 @@ def test_include_propertysheets_in_zusatzdaten(self):
366366
values=["one", "two", "three"])
367367
.with_field("bool", u"f3", u"Field 3", u"", False)
368368
.with_field("int", u"f4", u"Field 4", u"", False)
369-
.with_field("date", u"f5", u"Field 5", u"", False))
369+
.with_field("date", u"f5", u"Field 5", u"", False)
370+
.with_field("multiple_choice", u"f6", u"Field 6", u"", False,
371+
values=["blue", "red", "green"]))
370372

371373
IDocumentCustomProperties(self.document).custom_properties = {
372374
"IDocument.default": {"f1": "custom field text",
373375
"f2": ["one", "three"],
374376
"f3": False,
375377
"f4": 1234,
376-
"f5": date(2022, 4, 1)},
378+
"f5": date(2022, 4, 1),
379+
"f6": {"red"}},
377380
}
378381

379382
binding = Document(self.document).binding()
380383

381384
self.assertEquals(
382-
[u'f1', u'f2', u'f3', u'f4', u'f5'],
385+
[u'f1', u'f2', u'f3', u'f4', u'f5', u'f6'],
383386
[prop.name for prop in binding.zusatzDaten.merkmal])
384387
self.assertEquals(
385-
[u'custom field text', u'one, three', u'No', u'1234', u'2022-04-01'],
388+
[u'custom field text', u'one, three', u'No', u'1234', u'2022-04-01', 'red'],
386389
[prop.value() for prop in binding.zusatzDaten.merkmal])
387390

388391

0 commit comments

Comments
 (0)