IDEMPIERE-1665:matching PO-receipt error make session break

This commit is contained in:
hieplq 2014-09-06 18:40:11 +07:00
parent ee2a9757b6
commit e2fdfddacc
1 changed files with 12 additions and 5 deletions

View File

@ -206,12 +206,19 @@ public class Match
// Create it // Create it
String innerTrxName = Trx.createTrxName("Match"); String innerTrxName = Trx.createTrxName("Match");
Trx innerTrx = Trx.get(innerTrxName, true); Trx innerTrx = Trx.get(innerTrxName, true);
if (createMatchRecord(invoice, M_InOutLine_ID, Line_ID, BigDecimal.valueOf(qty), innerTrxName))
innerTrx.commit(); try{
else if (createMatchRecord(invoice, M_InOutLine_ID, Line_ID, BigDecimal.valueOf(qty), innerTrxName))
innerTrx.commit();
else
innerTrx.rollback();
}catch(Exception ex){
innerTrx.rollback(); innerTrx.rollback();
innerTrx.close(); throw new AdempiereException(ex);
innerTrx = null; }finally{
innerTrx.close();
innerTrx = null;
}
} }
} }
// requery // requery