BF [ 1808552 ] Adempiere freeze when we try to save a packout line
This commit is contained in:
parent
81fa88f9f1
commit
f6b5458305
|
@ -54,24 +54,22 @@ public class MPackageExpDetail extends X_AD_Package_Exp_Detail
|
||||||
} // MPackageExp
|
} // MPackageExp
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* After Save
|
/* (non-Javadoc)
|
||||||
* @param newRecord new
|
* @see org.compiere.model.PO#beforeSave(boolean)
|
||||||
* @param success success
|
|
||||||
* @return success
|
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
@Override
|
||||||
{
|
protected boolean beforeSave(boolean newRecord) {
|
||||||
|
if (getLine() == 0) {
|
||||||
X_AD_Package_Exp_Detail PackDetail =new X_AD_Package_Exp_Detail(Env.getCtx(), getAD_Package_Exp_Detail_ID(), null);
|
final String sql = "SELECT max("+COLUMNNAME_Line+")"
|
||||||
String sql = "SELECT max(Line) FROM AD_Package_Exp_Detail WHERE AD_Package_Exp_ID = ?";
|
+ "FROM "+Table_Name
|
||||||
int lineNo = DB.getSQLValue(null, sql,getAD_Package_Exp_ID());
|
+ " WHERE "+COLUMNNAME_AD_Package_Exp_ID+"=?"
|
||||||
|
+" AND "+COLUMNNAME_AD_Package_Exp_Detail_ID+"<>?";
|
||||||
if(PackDetail.getLine()==0){
|
int lineNo = DB.getSQLValue(get_TrxName(), sql, getAD_Package_Exp_ID(), getAD_Package_Exp_Detail_ID());
|
||||||
PackDetail.setLine(lineNo+10);
|
if (lineNo >= 0)
|
||||||
PackDetail.save();}
|
setLine(lineNo+10);
|
||||||
|
}
|
||||||
|
//
|
||||||
return true;
|
return true;
|
||||||
} // afterSave
|
}
|
||||||
|
|
||||||
} // MMenu
|
} // MMenu
|
||||||
|
|
Loading…
Reference in New Issue