[ 1753074 ] Can't open attribute instance window for new product

[ 1753072 ] Report window doesn't have the focus when launch from window
This commit is contained in:
Heng Sin Low 2007-07-13 01:01:28 +00:00
parent 8d851c582f
commit a839dd8705
4 changed files with 32 additions and 4 deletions

View File

@ -1654,7 +1654,7 @@ public final class APanel extends CPanel
* @param manualCmd true if invoked manually (i.e. force) * @param manualCmd true if invoked manually (i.e. force)
* @return true if saved * @return true if saved
*/ */
private boolean cmd_save (boolean manualCmd) public boolean cmd_save (boolean manualCmd)
{ {
if (m_curAPanelTab != null) if (m_curAPanelTab != null)
manualCmd = false; manualCmd = false;
@ -2271,7 +2271,8 @@ public final class APanel extends CPanel
{ {
// log.fine("" + pi); // log.fine("" + pi);
boolean notPrint = pi != null boolean notPrint = pi != null
&& pi.getAD_Process_ID() != m_curTab.getAD_Process_ID(); && pi.getAD_Process_ID() != m_curTab.getAD_Process_ID()
&& pi.isReportingProcess() == false;
// //
setBusy(false, notPrint); setBusy(false, notPrint);
// Process Result // Process Result
@ -2317,7 +2318,7 @@ public final class APanel extends CPanel
* Get Current Tab * Get Current Tab
* @return current tab * @return current tab
*/ */
protected GridTab getCurrentTab() public GridTab getCurrentTab()
{ {
return m_curTab; return m_curTab;
} // getCurrentTab } // getCurrentTab

View File

@ -352,6 +352,11 @@ public class ProcessCtl implements Runnable
*/ */
if (m_pi.getClassName() != null) if (m_pi.getClassName() != null)
{ {
if (JasperReport != null && JasperReport.trim().length() > 0)
{
m_pi.setReportingProcess(true);
}
// Run Class // Run Class
if (!startProcess()) if (!startProcess())
{ {
@ -386,6 +391,8 @@ public class ProcessCtl implements Runnable
*/ */
if (IsReport) if (IsReport)
{ {
m_pi.setReportingProcess(true);
// Optional Pre-Report Process // Optional Pre-Report Process
if (ProcedureName.length() > 0) if (ProcedureName.length() > 0)
{ {

View File

@ -23,6 +23,7 @@ import java.util.logging.*;
import javax.swing.*; import javax.swing.*;
import org.adempiere.plaf.AdempierePLAF; import org.adempiere.plaf.AdempierePLAF;
import org.compiere.apps.AWindow;
import org.compiere.model.*; import org.compiere.model.*;
import org.compiere.swing.*; import org.compiere.swing.*;
import org.compiere.util.*; import org.compiere.util.*;
@ -291,6 +292,25 @@ public class VPAttribute extends JComponent
// Exclude ability to enter ASI // Exclude ability to enter ASI
boolean exclude = true; boolean exclude = true;
//auto save for new product
if (M_Product_ID == 0)
{
JFrame frame = Env.getWindow(m_WindowNo);
if (frame instanceof AWindow)
{
AWindow aWindow = (AWindow)frame;
if (aWindow.getAPanel().getCurrentTab().getTableName().equalsIgnoreCase("M_Product"))
{
if (aWindow.getAPanel().cmd_save(true))
{
Object value = aWindow.getAPanel().getCurrentTab().getValue("M_Product_ID");
if (value != null && value instanceof Integer)
M_Product_ID = ((Integer)value).intValue();
}
}
}
}
if (M_Product_ID != 0) if (M_Product_ID != 0)
{ {
MProduct product = MProduct.get(Env.getCtx(), M_Product_ID); MProduct product = MProduct.get(Env.getCtx(), M_Product_ID);

View File

@ -185,7 +185,7 @@ public class AReport implements ActionListener
if(pf != null && pf.getJasperProcess_ID() > 0) if(pf != null && pf.getJasperProcess_ID() > 0)
{ {
// It's a report using the JasperReports engine // It's a report using the JasperReports engine
ProcessInfo pi = new ProcessInfo ("", pf.getJasperProcess_ID()); ProcessInfo pi = new ProcessInfo ("", pf.getJasperProcess_ID(), pf.getAD_Table_ID(), Record_ID);
// Execute Process // Execute Process
ProcessCtl worker = ProcessCtl.process(parent, WindowNo, pi, null); ProcessCtl worker = ProcessCtl.process(parent, WindowNo, pi, null);