IDEMPIERE-1158: Allow Create Lines From on Invoice (Customer) - Fix NullPointerException in CreateFrom

This commit is contained in:
Elaine Tan 2013-10-24 12:11:02 +08:00
parent 270aa0c6f6
commit 9eeedfa909
1 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import java.util.logging.Level;
import org.compiere.apps.IStatusBar; import org.compiere.apps.IStatusBar;
import org.compiere.minigrid.IMiniTable; import org.compiere.minigrid.IMiniTable;
import org.compiere.model.GridField;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MOrder; import org.compiere.model.MOrder;
import org.compiere.model.MRMA; import org.compiere.model.MRMA;
@ -53,7 +54,12 @@ public abstract class CreateFrom implements ICreateFrom
public CreateFrom(GridTab gridTab) { public CreateFrom(GridTab gridTab) {
this.gridTab = gridTab; this.gridTab = gridTab;
isSOTrx = (Boolean) gridTab.getField("isSoTrx").getValue();
GridField field = gridTab.getField("IsSOTrx");
if (field != null)
isSOTrx = (Boolean) field.getValue();
else
isSOTrx = "Y".equals(Env.getContext(Env.getCtx(), gridTab.getWindowNo(), "IsSOTrx"));
} }
public abstract boolean dynInit() throws Exception; public abstract boolean dynInit() throws Exception;