Convert list/tuple value to list of IDs only if it contains records
The Modify Header set the start value from the sale or purchase values but when it is a list or a tuple, it should also ensure it contains records before converting to a list of ids. Closes #13915 (grafted from 35fc6e3d271b4eeb7ef123f58085836fdab77228) --HG-- branch : 7.0
This commit is contained in:
@@ -2223,7 +2223,8 @@ class ModifyHeader(Wizard):
|
||||
value = str(value)
|
||||
else:
|
||||
value = value.id
|
||||
elif isinstance(value, (list, tuple)):
|
||||
elif (value and isinstance(value, (list, tuple))
|
||||
and isinstance(value[0], Model)):
|
||||
value = [r.id for r in value]
|
||||
values[fieldname] = value
|
||||
|
||||
|
||||
@@ -2294,7 +2294,8 @@ class ModifyHeader(Wizard):
|
||||
value = str(value)
|
||||
else:
|
||||
value = value.id
|
||||
elif isinstance(value, (list, tuple)):
|
||||
elif (value and isinstance(value, (list, tuple))
|
||||
and isinstance(value[0], Model)):
|
||||
value = [r.id for r in value]
|
||||
values[fieldname] = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user