IDEMPIERE-481 Order field cleared at Shipment window. Add control to avoid clearing of lookup field value that just have been set. Fixed shipment callout always modify the IsSoTrx field's value due to wrong datatype comparision ( comparing 'Y'/'N' with boolean true/false ).
This commit is contained in:
parent
0f04122f5b
commit
0cead2d7f9
|
@ -193,7 +193,17 @@ public class CalloutInOut extends CalloutEngine
|
|||
String DocBaseType = rs.getString("DocBaseType");
|
||||
// BF [2708789] Read IsSOTrx from C_DocType
|
||||
String trxFlag = rs.getString("IsSOTrx");
|
||||
if (!(trxFlag.equals(mTab.getValue("IsSOTrx"))))
|
||||
Object isSOTrxValue = mTab.getValue("IsSOTrx");
|
||||
String isSOTrxValueStr = null;
|
||||
if (isSOTrxValue != null)
|
||||
{
|
||||
if (isSOTrxValue instanceof Boolean)
|
||||
isSOTrxValueStr = (Boolean)isSOTrxValue ? "Y" : "N";
|
||||
else
|
||||
isSOTrxValueStr = (String)isSOTrxValue;
|
||||
}
|
||||
|
||||
if (!(trxFlag.equals(isSOTrxValueStr)))
|
||||
mTab.setValue("IsSOTrx", trxFlag);
|
||||
if (DocBaseType.equals("MMS")) // Material Shipments
|
||||
/**solve 1648131 bug vpj-cd e-evolution */
|
||||
|
|
|
@ -102,6 +102,12 @@ public class GridField
|
|||
|
||||
private GridTab m_gridTab;
|
||||
|
||||
/**
|
||||
* Use by lookup editor to indicate setting of new value is in progress.
|
||||
* GridTab.processDependentFields will check this flag to avoid clearing of lookup field value that just have been set.
|
||||
**/
|
||||
private boolean m_lookupEditorSettingValue = false;
|
||||
|
||||
/**
|
||||
* Dispose
|
||||
*/
|
||||
|
@ -2051,5 +2057,21 @@ public class GridField
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param b
|
||||
*/
|
||||
public void setLookupEditorSettingValue(boolean b)
|
||||
{
|
||||
m_lookupEditorSettingValue = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the setting value of this field by UI is in progress
|
||||
*/
|
||||
public boolean isLookupEditorSettingValue()
|
||||
{
|
||||
return m_lookupEditorSettingValue;
|
||||
}
|
||||
|
||||
} // GridField
|
||||
|
|
|
@ -2676,8 +2676,10 @@ 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 the field has a lookup
|
||||
if (dependentField != null && dependentField.getLookup() instanceof MLookup)
|
||||
if (dependentField.getLookup() instanceof MLookup)
|
||||
{
|
||||
MLookup mLookup = (MLookup)dependentField.getLookup();
|
||||
// if the lookup is dynamic (i.e. contains this columnName as variable)
|
||||
|
|
|
@ -449,35 +449,37 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
|
|||
{
|
||||
if (log.isLoggable(Level.FINE))
|
||||
log.fine("Value=" + value);
|
||||
|
||||
ValueChangeEvent evt = new ValueChangeEvent(this, this.getColumnName(), getValue(), value);
|
||||
// -> ADTabpanel - valuechange
|
||||
fireValueChange(evt);
|
||||
|
||||
// is the value updated ?
|
||||
boolean updated = false;
|
||||
if (value instanceof Object[] && ((Object[])value).length > 0)
|
||||
|
||||
try
|
||||
{
|
||||
value = ((Object[])value)[0];
|
||||
}
|
||||
|
||||
if (value == null && getValue() == null)
|
||||
updated = true;
|
||||
else if (value != null && value.equals(getValue()))
|
||||
updated = true;
|
||||
if (!updated)
|
||||
{
|
||||
setValue(value);
|
||||
if (gridTab != null && gridField != null) {
|
||||
if (value == null && gridField.getValue() != null) {
|
||||
gridTab.setValue(gridField, value);
|
||||
} else if (value != null && gridField.getValue() == null) {
|
||||
gridTab.setValue(gridField, value);
|
||||
} else if (value != null && !value.equals(gridField.getValue())) {
|
||||
gridTab.setValue(gridField, value);
|
||||
}
|
||||
if (gridField != null)
|
||||
gridField.setLookupEditorSettingValue(true);
|
||||
|
||||
ValueChangeEvent evt = new ValueChangeEvent(this, this.getColumnName(), getValue(), value);
|
||||
// -> ADTabpanel - valuechange
|
||||
fireValueChange(evt);
|
||||
|
||||
// is the value updated ?
|
||||
boolean updated = false;
|
||||
if (value instanceof Object[] && ((Object[])value).length > 0)
|
||||
{
|
||||
value = ((Object[])value)[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (value == null && getValue() == null)
|
||||
updated = true;
|
||||
else if (value != null && value.equals(getValue()))
|
||||
updated = true;
|
||||
if (!updated)
|
||||
{
|
||||
setValue(value);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (gridField != null)
|
||||
gridField.setLookupEditorSettingValue(false);
|
||||
}
|
||||
|
||||
} // actionCombo
|
||||
|
||||
|
|
|
@ -399,10 +399,17 @@ ContextMenuListener, IZoomableEditor
|
|||
onselecting = true;
|
||||
Object newValue = getValue();
|
||||
if (isValueChange(newValue)) {
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
getComponent().setValue(newValue);
|
||||
try {
|
||||
if (gridField != null)
|
||||
gridField.setLookupEditorSettingValue(true);
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
getComponent().setValue(newValue);
|
||||
} finally {
|
||||
if (gridField != null)
|
||||
gridField.setLookupEditorSettingValue(false);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
onselecting = false;
|
||||
|
@ -422,9 +429,16 @@ ContextMenuListener, IZoomableEditor
|
|||
{
|
||||
Object newValue = getValue();
|
||||
if (isValueChange(newValue)) {
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
try {
|
||||
if (gridField != null)
|
||||
gridField.setLookupEditorSettingValue(true);
|
||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||
super.fireValueChange(changeEvent);
|
||||
oldValue = newValue;
|
||||
} finally {
|
||||
if (gridField != null)
|
||||
gridField.setLookupEditorSettingValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue