From 90c30026c4eb7fe0c33974481eaaeba1d88a720c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 4 Oct 2012 17:44:50 -0500 Subject: [PATCH] IDEMPIERE-332 Document sequence organization level and restart monthly / NPE when not org selected --- org.adempiere.base/src/org/compiere/model/MSequence.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index b01099eb49..1092822971 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -1345,7 +1345,10 @@ public class MSequence extends X_AD_Sequence cym = sdf.format(d); } if (orgLevelSeq) { - org = (Integer)tab.getValue(seq.getOrgColumn()); + String orgColumn = seq.getOrgColumn(); + Object orgObj = tab.getValue(orgColumn); + if (orgObj != null) + org = (Integer)orgObj; } String sql = "SELECT CurrentNext FROM AD_Sequence_No WHERE AD_Sequence_ID=? AND CalendarYearMonth=? AND AD_Org_ID=?"; currentNext = DB.getSQLValue(null, sql, AD_Sequence_ID, cym, org);