IDEMPIERE-4167 Can't use Copy Info Window columns process with an Order By clause

This commit is contained in:
Carlos Ruiz 2020-02-05 22:38:02 +01:00
parent 2c084ac9da
commit c87223e5c9
3 changed files with 28 additions and 7 deletions

View File

@ -90,19 +90,19 @@ public class CopyInfoWindowColumns extends SvrProcess
MInfoWindow sourceInfoWindow = new MInfoWindow(getCtx(), p_source_AD_InfoWindow_ID, get_TrxName());
MInfoColumn[] sourceColumns = sourceInfoWindow.getInfoColumns();
targetInfoWindow.setIsValidateEachColumn(false);
for (int i = 0; i < sourceColumns.length; i++)
{
MInfoColumn colTarget = new MInfoColumn(getCtx(),0, get_TrxName());
MInfoColumn colTarget = new MInfoColumn(targetInfoWindow);
PO.copyValues(sourceColumns[i], colTarget);
colTarget.setAD_InfoWindow_ID (targetInfoWindow.getAD_InfoWindow_ID());
colTarget.setAD_Org_ID(targetInfoWindow.getAD_Org_ID());
colTarget.setEntityType(targetInfoWindow.getEntityType());
colTarget.setIsActive(sourceColumns[i].isActive());
colTarget.saveEx(get_TrxName());
m_count++;
}
targetInfoWindow.validate();
//
return "#" + m_count;
} // doIt

View File

@ -41,7 +41,7 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
/**
*
*/
private static final long serialVersionUID = 9198213211937136870L;
private static final long serialVersionUID = -6313260451237775302L;
/**
* Stanfard Constructor
@ -65,6 +65,13 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
super (ctx, rs, trxName);
} // MInfoColumn
public MInfoColumn(MInfoWindow targetInfoWindow) {
this(targetInfoWindow.getCtx(), 0, targetInfoWindow.get_TrxName());
m_parent = targetInfoWindow;
this.setAD_InfoWindow_ID (targetInfoWindow.getAD_InfoWindow_ID());
this.setEntityType(targetInfoWindow.getEntityType());
}
/** Parent */
private MInfoWindow m_parent = null;
@ -172,9 +179,9 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
return success;
// evaluate need valid
boolean isNeedValid = newRecord || is_ValueChanged (MInfoColumn.COLUMNNAME_SelectClause);
boolean isNeedValid = getParent().isValidateEachColumn() && (newRecord || is_ValueChanged (MInfoColumn.COLUMNNAME_SelectClause));
// call valid of parrent
// call valid of parent
if (isNeedValid){
getParent().validate();
getParent().saveEx(get_TrxName());

View File

@ -43,7 +43,7 @@ public class MInfoWindow extends X_AD_InfoWindow
/**
*
*/
private static final long serialVersionUID = -3627504150648422756L;
private static final long serialVersionUID = -1619434756919905441L;
/**
* Standard Constructor
@ -455,5 +455,19 @@ public class MInfoWindow extends X_AD_InfoWindow
// valid state
this.setIsValid(true);
}
/**
* IDEMPIERE-4167
**/
private boolean m_validateEachColumn = true;
public void setIsValidateEachColumn (boolean validateEachColumn) {
m_validateEachColumn= validateEachColumn;
}
boolean isValidateEachColumn() {
return m_validateEachColumn;
}
} // MInfoWindow