hg merge release-6.2 (merge release6.2 into default)

This commit is contained in:
Carlos Ruiz 2019-11-14 20:38:44 +01:00
commit e9f48caf03
2 changed files with 6 additions and 20 deletions

View File

@ -2775,8 +2775,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
// Get dependent MFields (may be because of display or dynamic lookup)
for (GridField dependentField : getDependantFields(columnName))
{
if (dependentField == null || dependentField.isLookupEditorSettingValue()) continue;
if (dependentField == null || dependentField.isLookupEditorSettingValue())
continue;
// if the field has a lookup
if (dependentField.getLookup() instanceof MLookup)
{
@ -2787,12 +2788,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
{
if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - "
+ dependentField.getColumnName() + " set to null");
mLookup.refresh();
Object currentValue = dependentField.getValue();
// invalidate current selection
setValue(dependentField, null);
if (currentValue != null && mLookup.containsKey(currentValue))
if (currentValue != null && mLookup.containsKeyNoDirect(currentValue))
setValue(dependentField, currentValue);
}
}

View File

@ -69,7 +69,6 @@ import org.compiere.model.GridTable;
import org.compiere.model.GridWindow;
import org.compiere.model.I_AD_Preference;
import org.compiere.model.MColumn;
import org.compiere.model.MLookup;
import org.compiere.model.MPreference;
import org.compiere.model.MRole;
import org.compiere.model.MSysConfig;
@ -1372,27 +1371,12 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|| (Core.findCallout(gridTab.getTableName(), mField.getColumnName())).size()>0
|| gridTab.hasDependants(mField.getColumnName())))
{
// IDEMPIERE-4106 Refresh the list (lookup) on dependant fields was moved inside processFieldChange->processDependencies
String msg = gridTab.processFieldChange(mField); // Dependencies & Callout
if (msg.length() > 0)
{
FDialog.error(windowNo, this, msg);
}
// Refresh the list on dependant fields
for (GridField dependentField : gridTab.getDependantFields(mField.getColumnName()))
{
// if the field has a lookup
if (dependentField != null && dependentField.getLookup() instanceof MLookup)
{
MLookup mLookup = (MLookup)dependentField.getLookup();
// if the lookup is dynamic (i.e. contains this columnName as variable)
if (mLookup.getValidation().indexOf("@"+mField.getColumnName()+"@") != -1)
{
mLookup.refresh();
}
}
} // for all dependent fields
}
//if (col >= 0)
if (!uiCreated)