IDEMPIERE-5425 Chosen Multiple Selection fields are not being copied with the Copy button (#1489)

This commit is contained in:
Carlos Ruiz 2022-09-17 05:47:47 +02:00 committed by GitHub
parent b5c0809072
commit 45516c6c91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 36 additions and 1 deletions

View File

@ -1081,7 +1081,42 @@ public class GridField
// cannot be validated
if (!isLookup() || m_lookup == null)
return true;
if (m_lookup.containsKeyNoDirect(m_value)) {
if (getDisplayType() == DisplayType.ChosenMultipleSelectionList) {
boolean allValid = true;
for (String vals : ((String)m_value).split(",")) {
if (! m_lookup.containsKeyNoDirect(vals)) {
if (m_lookup.get(vals) == null) {
allValid = false;
break;
}
String name = m_lookup.get(vals).getName();
if (name.startsWith(MLookup.INACTIVE_S) && name.endsWith(MLookup.INACTIVE_E)) {
allValid = false;
break;
}
}
}
if (allValid)
return true;
} else if (getDisplayType() == DisplayType.ChosenMultipleSelectionTable || getDisplayType() == DisplayType.ChosenMultipleSelectionSearch) {
boolean allValid = true;
for (String vals : ((String)m_value).split(",")) {
Integer vali = Integer.valueOf(vals);
if (! m_lookup.containsKeyNoDirect(vali)) {
if (m_lookup.get(vali) == null) {
allValid = false;
break;
}
String name = m_lookup.get(vali).getName();
if (name.startsWith(MLookup.INACTIVE_S) && name.endsWith(MLookup.INACTIVE_E)) {
allValid = false;
break;
}
}
}
if (allValid)
return true;
} else if (m_lookup.containsKeyNoDirect(m_value)) {
String name = m_lookup.get(m_value).getName();
if (! ( name.startsWith(MLookup.INACTIVE_S) && name.endsWith(MLookup.INACTIVE_E) ) ) {
return true;