diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java index 13d610f1d8..78a758bcfb 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VAllocation.java @@ -424,6 +424,10 @@ public class VAllocation extends Allocation */ public void saveData() { + if (m_AD_Org_ID > 0) + Env.setContext(Env.getCtx(), m_WindowNo, "AD_Org_ID", m_AD_Org_ID); + else + Env.setContext(Env.getCtx(), m_WindowNo, "AD_Org_ID", ""); try { Trx.run(new TrxRunnable() diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java index e4497936bc..bdc5f60f76 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java @@ -486,6 +486,10 @@ public class WAllocation extends Allocation */ public void saveData() { + if (m_AD_Org_ID > 0) + Env.setContext(Env.getCtx(), form.getWindowNo(), "AD_Org_ID", m_AD_Org_ID); + else + Env.setContext(Env.getCtx(), form.getWindowNo(), "AD_Org_ID", ""); Trx trx = Trx.get(Trx.createTrxName("AL"), true); statusBar.setStatusLine(saveData(form.getWindowNo(), dateField.getValue(), paymentTable, invoiceTable, trx.getTrxName())); trx.commit(); diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java b/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java index d56842aff9..3cff9c7fe7 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java @@ -604,7 +604,7 @@ public class Allocation if (AD_Org_ID == 0) { //ADialog.error(m_WindowNo, this, "Org0NotAllowed", null); - new AdempiereException("@Org0NotAllowed@"); + throw new AdempiereException("@Org0NotAllowed@"); } // log.config("Client=" + AD_Client_ID + ", Org=" + AD_Org_ID