Fix several errors with Allocation:
- fix a wrong raise of exception when no organization (add throws keyword) - when creating the allocation is taking the organization of log in, and it must take precedence the organization chosen by the user on the allocation window (login org still used in case no org is selected by user)
This commit is contained in:
parent
52ccb1f03c
commit
9bc32c1cd4
|
@ -424,6 +424,10 @@ public class VAllocation extends Allocation
|
||||||
*/
|
*/
|
||||||
public void saveData()
|
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
|
try
|
||||||
{
|
{
|
||||||
Trx.run(new TrxRunnable()
|
Trx.run(new TrxRunnable()
|
||||||
|
|
|
@ -486,6 +486,10 @@ public class WAllocation extends Allocation
|
||||||
*/
|
*/
|
||||||
public void saveData()
|
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);
|
Trx trx = Trx.get(Trx.createTrxName("AL"), true);
|
||||||
statusBar.setStatusLine(saveData(form.getWindowNo(), dateField.getValue(), paymentTable, invoiceTable, trx.getTrxName()));
|
statusBar.setStatusLine(saveData(form.getWindowNo(), dateField.getValue(), paymentTable, invoiceTable, trx.getTrxName()));
|
||||||
trx.commit();
|
trx.commit();
|
||||||
|
|
|
@ -604,7 +604,7 @@ public class Allocation
|
||||||
if (AD_Org_ID == 0)
|
if (AD_Org_ID == 0)
|
||||||
{
|
{
|
||||||
//ADialog.error(m_WindowNo, this, "Org0NotAllowed", null);
|
//ADialog.error(m_WindowNo, this, "Org0NotAllowed", null);
|
||||||
new AdempiereException("@Org0NotAllowed@");
|
throw new AdempiereException("@Org0NotAllowed@");
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
log.config("Client=" + AD_Client_ID + ", Org=" + AD_Org_ID
|
log.config("Client=" + AD_Client_ID + ", Org=" + AD_Org_ID
|
||||||
|
|
Loading…
Reference in New Issue