diff --git a/client/src/org/compiere/apps/APanel.java b/client/src/org/compiere/apps/APanel.java index d360580f1b..3c7a02b155 100644 --- a/client/src/org/compiere/apps/APanel.java +++ b/client/src/org/compiere/apps/APanel.java @@ -2388,12 +2388,22 @@ public final class APanel extends CPanel } } + // try to get table and record id from context data (eg for unposted view) + // otherwise use current table/record + int tableId = Env.getContextAsInt(m_ctx, m_curWindowNo, "AD_Table_ID", true); + int recordId = Env.getContextAsInt(m_ctx, m_curWindowNo, "Record_ID", true); + if ( tableId == 0 || recordId == 0 ) + { + tableId = m_curTab.getAD_Table_ID(); + recordId = m_curTab.getRecord_ID(); + } + // Check Post Status Object ps = m_curTab.getValue("Posted"); if (ps != null && ps.equals("Y")) { new org.compiere.acct.AcctViewer (Env.getContextAsInt (m_ctx, m_curWindowNo, "AD_Client_ID"), - m_curTab.getAD_Table_ID(), m_curTab.getRecord_ID()); + tableId, recordId); } else { @@ -2401,10 +2411,10 @@ public final class APanel extends CPanel { boolean force = ps != null && !ps.equals ("N"); // force when problems String error = AEnv.postImmediate (m_curWindowNo, Env.getAD_Client_ID(m_ctx), - m_curTab.getAD_Table_ID(), m_curTab.getRecord_ID(), force); - m_curTab.dataRefresh(); + tableId, recordId, force); if (error != null) ADialog.error(m_curWindowNo, this, "PostingError-N", error); + cmd_refresh(); } } return; diff --git a/migration/353a-trunk/oracle/476_FR2794732_PostFromUnposted.sql b/migration/353a-trunk/oracle/476_FR2794732_PostFromUnposted.sql new file mode 100644 index 0000000000..cac78683fd --- /dev/null +++ b/migration/353a-trunk/oracle/476_FR2794732_PostFromUnposted.sql @@ -0,0 +1,4 @@ + +UPDATE AD_Column SET AD_Reference_ID=28, AD_Reference_Value_ID=NULL,Updated=TO_DATE('2009-06-02 11:32:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56347 +; + diff --git a/migration/353a-trunk/postgresql/476_FR2794732_PostFromUnposted.sql b/migration/353a-trunk/postgresql/476_FR2794732_PostFromUnposted.sql new file mode 100644 index 0000000000..827a222835 --- /dev/null +++ b/migration/353a-trunk/postgresql/476_FR2794732_PostFromUnposted.sql @@ -0,0 +1,4 @@ + +UPDATE AD_Column SET AD_Reference_ID=28, AD_Reference_Value_ID=NULL,Updated=TO_TIMESTAMP('2009-06-02 11:32:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56347 +; +