diff --git a/client/src/org/compiere/apps/APanel.java b/client/src/org/compiere/apps/APanel.java index a92c88a42b..6786236a76 100644 --- a/client/src/org/compiere/apps/APanel.java +++ b/client/src/org/compiere/apps/APanel.java @@ -1654,7 +1654,7 @@ public final class APanel extends CPanel * @param manualCmd true if invoked manually (i.e. force) * @return true if saved */ - private boolean cmd_save (boolean manualCmd) + public boolean cmd_save (boolean manualCmd) { if (m_curAPanelTab != null) manualCmd = false; @@ -2271,7 +2271,8 @@ public final class APanel extends CPanel { // log.fine("" + pi); 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); // Process Result @@ -2317,7 +2318,7 @@ public final class APanel extends CPanel * Get Current Tab * @return current tab */ - protected GridTab getCurrentTab() + public GridTab getCurrentTab() { return m_curTab; } // getCurrentTab diff --git a/client/src/org/compiere/apps/ProcessCtl.java b/client/src/org/compiere/apps/ProcessCtl.java index a9685d103c..6aa3a78ae8 100644 --- a/client/src/org/compiere/apps/ProcessCtl.java +++ b/client/src/org/compiere/apps/ProcessCtl.java @@ -352,6 +352,11 @@ public class ProcessCtl implements Runnable */ if (m_pi.getClassName() != null) { + if (JasperReport != null && JasperReport.trim().length() > 0) + { + m_pi.setReportingProcess(true); + } + // Run Class if (!startProcess()) { @@ -386,6 +391,8 @@ public class ProcessCtl implements Runnable */ if (IsReport) { + m_pi.setReportingProcess(true); + // Optional Pre-Report Process if (ProcedureName.length() > 0) { diff --git a/client/src/org/compiere/grid/ed/VPAttribute.java b/client/src/org/compiere/grid/ed/VPAttribute.java index e74b8eb779..cf37ad3bea 100644 --- a/client/src/org/compiere/grid/ed/VPAttribute.java +++ b/client/src/org/compiere/grid/ed/VPAttribute.java @@ -23,6 +23,7 @@ import java.util.logging.*; import javax.swing.*; import org.adempiere.plaf.AdempierePLAF; +import org.compiere.apps.AWindow; import org.compiere.model.*; import org.compiere.swing.*; import org.compiere.util.*; @@ -291,6 +292,25 @@ public class VPAttribute extends JComponent // Exclude ability to enter ASI 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) { MProduct product = MProduct.get(Env.getCtx(), M_Product_ID); diff --git a/client/src/org/compiere/print/AReport.java b/client/src/org/compiere/print/AReport.java index 37ef0a06fb..fad803fd3c 100644 --- a/client/src/org/compiere/print/AReport.java +++ b/client/src/org/compiere/print/AReport.java @@ -185,7 +185,7 @@ public class AReport implements ActionListener if(pf != null && pf.getJasperProcess_ID() > 0) { // 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 ProcessCtl worker = ProcessCtl.process(parent, WindowNo, pi, null);