FR2794732 Post documents from Unposted document window

https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2794732&group_id=176962
This commit is contained in:
Heng Sin Low 2009-06-02 06:02:28 +00:00
parent 29aa44beb3
commit cf8f7670a3
2 changed files with 215 additions and 204 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1775,13 +1775,23 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
} }
} }
// try to get table and record id from context data (eg for unposted view)
// otherwise use current table/record
int tableId = Env.getContextAsInt(ctx, curWindowNo, "AD_Table_ID", true);
int recordId = Env.getContextAsInt(ctx, curWindowNo, "Record_ID", true);
if ( tableId == 0 || recordId == 0 )
{
tableId = curTab.getAD_Table_ID();
recordId = curTab.getRecord_ID();
}
// Check Post Status // Check Post Status
Object ps = curTab.getValue("Posted"); Object ps = curTab.getValue("Posted");
if (ps != null && ps.equals("Y")) if (ps != null && ps.equals("Y"))
{ {
new org.adempiere.webui.acct.WAcctViewer(Env.getContextAsInt (ctx, curWindowNo, "AD_Client_ID"), new org.adempiere.webui.acct.WAcctViewer(Env.getContextAsInt (ctx, curWindowNo, "AD_Client_ID"),
curTab.getAD_Table_ID(), curTab.getRecord_ID()); tableId, recordId);
} }
else else
{ {
@ -1790,12 +1800,12 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
boolean force = ps != null && !ps.equals ("N"); // force when problems boolean force = ps != null && !ps.equals ("N"); // force when problems
String error = AEnv.postImmediate (curWindowNo, Env.getAD_Client_ID(ctx), String error = AEnv.postImmediate (curWindowNo, Env.getAD_Client_ID(ctx),
curTab.getAD_Table_ID(), curTab.getRecord_ID(), force); tableId, recordId, force);
curTab.dataRefresh();
if (error != null) if (error != null)
FDialog.error(curWindowNo, null, "PostingError-N", error); FDialog.error(curWindowNo, null, "PostingError-N", error);
onRefresh();
} }
} }
return; return;