IDEMPIERE-4167 Can't use Copy Info Window columns process with an Order By clause
This commit is contained in:
parent
2c084ac9da
commit
c87223e5c9
|
|
@ -90,19 +90,19 @@ public class CopyInfoWindowColumns extends SvrProcess
|
||||||
MInfoWindow sourceInfoWindow = new MInfoWindow(getCtx(), p_source_AD_InfoWindow_ID, get_TrxName());
|
MInfoWindow sourceInfoWindow = new MInfoWindow(getCtx(), p_source_AD_InfoWindow_ID, get_TrxName());
|
||||||
MInfoColumn[] sourceColumns = sourceInfoWindow.getInfoColumns();
|
MInfoColumn[] sourceColumns = sourceInfoWindow.getInfoColumns();
|
||||||
|
|
||||||
|
targetInfoWindow.setIsValidateEachColumn(false);
|
||||||
for (int i = 0; i < sourceColumns.length; i++)
|
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);
|
PO.copyValues(sourceColumns[i], colTarget);
|
||||||
colTarget.setAD_InfoWindow_ID (targetInfoWindow.getAD_InfoWindow_ID());
|
colTarget.setAD_InfoWindow_ID (targetInfoWindow.getAD_InfoWindow_ID());
|
||||||
colTarget.setAD_Org_ID(targetInfoWindow.getAD_Org_ID());
|
|
||||||
colTarget.setEntityType(targetInfoWindow.getEntityType());
|
colTarget.setEntityType(targetInfoWindow.getEntityType());
|
||||||
colTarget.setIsActive(sourceColumns[i].isActive());
|
colTarget.setIsActive(sourceColumns[i].isActive());
|
||||||
colTarget.saveEx(get_TrxName());
|
colTarget.saveEx(get_TrxName());
|
||||||
|
|
||||||
m_count++;
|
m_count++;
|
||||||
}
|
}
|
||||||
|
targetInfoWindow.validate();
|
||||||
//
|
//
|
||||||
return "#" + m_count;
|
return "#" + m_count;
|
||||||
} // doIt
|
} // doIt
|
||||||
|
|
|
||||||
|
|
@ -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
|
* Stanfard Constructor
|
||||||
|
|
@ -65,6 +65,13 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
|
||||||
super (ctx, rs, trxName);
|
super (ctx, rs, trxName);
|
||||||
} // MInfoColumn
|
} // 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 */
|
/** Parent */
|
||||||
private MInfoWindow m_parent = null;
|
private MInfoWindow m_parent = null;
|
||||||
|
|
||||||
|
|
@ -172,9 +179,9 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
|
||||||
return success;
|
return success;
|
||||||
|
|
||||||
// evaluate need valid
|
// 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){
|
if (isNeedValid){
|
||||||
getParent().validate();
|
getParent().validate();
|
||||||
getParent().saveEx(get_TrxName());
|
getParent().saveEx(get_TrxName());
|
||||||
|
|
|
||||||
|
|
@ -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
|
* Standard Constructor
|
||||||
|
|
@ -455,5 +455,19 @@ public class MInfoWindow extends X_AD_InfoWindow
|
||||||
// valid state
|
// valid state
|
||||||
this.setIsValid(true);
|
this.setIsValid(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IDEMPIERE-4167
|
||||||
|
**/
|
||||||
|
private boolean m_validateEachColumn = true;
|
||||||
|
|
||||||
|
public void setIsValidateEachColumn (boolean validateEachColumn) {
|
||||||
|
m_validateEachColumn= validateEachColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isValidateEachColumn() {
|
||||||
|
return m_validateEachColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // MInfoWindow
|
} // MInfoWindow
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue