|
@@ -388,9 +388,18 @@ class MultipleRef(Reference):
|
388
|
388
|
if self.max_item < len(value):
|
389
|
389
|
raise FieldValidationError("Too many items")
|
390
|
390
|
error_list = []
|
391
|
|
- for i,v in enumerate(value):
|
|
391
|
+ # if we have got a str
|
|
392
|
+ # right place to test this ?
|
|
393
|
+
|
|
394
|
+ if isinstance(value, str):
|
|
395
|
+ value.replace(" ","")
|
|
396
|
+ s_value=value.split(',')
|
|
397
|
+ value=list(s_value)
|
|
398
|
+ logger.debug(value)
|
|
399
|
+ for i,v in enumerate(s_value):
|
392
|
400
|
new_val = super()._check_data_value(v)
|
393
|
|
- value[i]=v
|
|
401
|
+ value[i]=new_val
|
|
402
|
+ logger.debug(value)
|
394
|
403
|
if len(error_list) >0:
|
395
|
404
|
raise FieldValidationError("MultipleRef have for error :", error_list)
|
396
|
405
|
return value
|
|
@@ -412,7 +421,9 @@ class MultipleRef(Reference):
|
412
|
421
|
elif isinstance(cur_value, list):
|
413
|
422
|
l_value = list()
|
414
|
423
|
for value in cur_value:
|
415
|
|
- if isinstance(value,uidtype.cast_type):
|
|
424
|
+ if isinstance(value,str):
|
|
425
|
+ l_value.append(uidtype.cast_type(value))
|
|
426
|
+ elif isinstance(value,uidtype.cast_type):
|
416
|
427
|
l_value.append(value)
|
417
|
428
|
else:
|
418
|
429
|
raise ValueError("The items must be of the same type, string or %s" % (emcomponent.__name__))
|