From 7e2832096b26e22803aed9b24a6207fab03c07ff Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 14 Jun 2013 08:44:06 -0500 Subject: [PATCH 1/9] IDEMPIERE-1056 Print Invoice not working --- .../adempiere/webui/process/InvoicePrint.java | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java index 24d0189ec3..a56e43f0cd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java @@ -16,25 +16,39 @@ *****************************************************************************/ package org.adempiere.webui.process; -import java.io.*; -import java.sql.*; +import java.io.File; +import java.io.FileInputStream; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.List; -import java.util.logging.*; +import java.util.logging.Level; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Window; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.window.SimplePDFViewer; -import org.compiere.model.*; -import org.compiere.print.*; +import org.compiere.model.MClient; +import org.compiere.model.MInvoice; +import org.compiere.model.MMailText; +import org.compiere.model.MQuery; +import org.compiere.model.MUser; +import org.compiere.model.MUserMail; +import org.compiere.model.PrintInfo; +import org.compiere.print.MPrintFormat; +import org.compiere.print.ReportEngine; import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; -import org.compiere.util.*; -import org.zkoss.zk.ui.util.Clients; +import org.compiere.util.AdempiereUserError; +import org.compiere.util.DB; +import org.compiere.util.EMail; +import org.compiere.util.Env; +import org.compiere.util.Ini; +import org.compiere.util.Language; /** - * Print Invoices on Paperor send PDFs + * Print Invoices on Paper or send PDFs * * @author Jorg Janke * @version $Id: InvoicePrint.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ @@ -48,8 +62,8 @@ public class InvoicePrint extends SvrProcess private Timestamp m_dateInvoiced_From = null; private Timestamp m_dateInvoiced_To = null; - private int m_C_BPartner_ID = 0; - private int m_C_Invoice_ID = 0; + private int m_C_BPartner_ID = 0; + private int m_C_Invoice_ID = 0; private String m_DocumentNo_From = null; private String m_DocumentNo_To = null; @@ -92,7 +106,7 @@ public class InvoicePrint extends SvrProcess } // prepare /** - * Perrform process. + * Perform process. * @return Message * @throws Exception */ @@ -101,7 +115,7 @@ public class InvoicePrint extends SvrProcess // Need to have Template if (p_EMailPDF && p_R_MailText_ID == 0) throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@"); - log.info ("C_BPartner_ID=" + m_C_BPartner_ID + if (log.isLoggable(Level.INFO)) log.info ("C_BPartner_ID=" + m_C_BPartner_ID + ", C_Invoice_ID=" + m_C_Invoice_ID + ", EmailPDF=" + p_EMailPDF + ",R_MailText_ID=" + p_R_MailText_ID + ", DateInvoiced=" + m_dateInvoiced_From + "-" + m_dateInvoiced_To @@ -123,7 +137,7 @@ public class InvoicePrint extends SvrProcess MClient client = MClient.get(getCtx()); // Get Info - StringBuffer sql = new StringBuffer ( + StringBuilder sql = new StringBuilder ( "SELECT i.C_Invoice_ID,bp.AD_Language,c.IsMultiLingualDocument," // 1..3 // Prio: 1. BPartner 2. DocType, 3. PrintFormat (Org) // see ReportCtl+MInvoice + " COALESCE(bp.Invoice_PrintFormat_ID, dt.AD_PrintFormat_ID, pf.Invoice_PrintFormat_ID)," // 4 @@ -275,7 +289,7 @@ public class InvoicePrint extends SvrProcess // Engine PrintInfo info = new PrintInfo( DocumentNo, - X_C_Invoice.Table_ID, + MInvoice.Table_ID, C_Invoice_ID, C_BPartner_ID); info.setCopies(copies); @@ -359,7 +373,6 @@ public class InvoicePrint extends SvrProcess File outFile = File.createTempFile("InvoicePrint", ".pdf"); AEnv.mergePdf(pdfList, outFile); - Clients.showBusy(null, null); Window win = new SimplePDFViewer(this.getName(), new FileInputStream(outFile)); win.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); SessionManager.getAppDesktop().showWindow(win, "center"); @@ -367,7 +380,6 @@ public class InvoicePrint extends SvrProcess log.log(Level.SEVERE, e.getLocalizedMessage(), e); } } else if (pdfList.size() > 0) { - Clients.clearBusy(); try { Window win = new SimplePDFViewer(this.getName(), new FileInputStream(pdfList.get(0))); win.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); From ce111cb7547dc641acc41157d76fa5d800609969 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 14 Jun 2013 12:34:40 -0500 Subject: [PATCH 2/9] IDEMPIERE-1019 Jasper 4.6 has some issues with the table component / based on suggestions and tests from Anthony Sossah (xolali) --- .../.classpath | 11 +- .../META-INF/MANIFEST.MF | 114 ++++++++++++++++-- .../build.properties | 11 +- 3 files changed, 115 insertions(+), 21 deletions(-) diff --git a/org.adempiere.report.jasper.library/.classpath b/org.adempiere.report.jasper.library/.classpath index ebf95f1e17..e4c4b4572d 100644 --- a/org.adempiere.report.jasper.library/.classpath +++ b/org.adempiere.report.jasper.library/.classpath @@ -1,13 +1,12 @@ - - - - - + + + + - + diff --git a/org.adempiere.report.jasper.library/META-INF/MANIFEST.MF b/org.adempiere.report.jasper.library/META-INF/MANIFEST.MF index 23003c08f2..bbe1cc2b06 100644 --- a/org.adempiere.report.jasper.library/META-INF/MANIFEST.MF +++ b/org.adempiere.report.jasper.library/META-INF/MANIFEST.MF @@ -5,14 +5,21 @@ Bundle-SymbolicName: org.adempiere.report.jasper.library Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: lib/commons-beanutils-1.8.0.jar, lib/commons-digester-2.1.jar, - lib/jasperreports-4.6.0.jar, + lib/jasperreports-5.1.2.jar, lib/jdt-compiler-3.1.1.jar, - lib/jasperreports-fonts-4.6.0.jar, - lib/barcode4j-2.0.jar, - lib/jackson-core-asl-1.9.4.jar, - lib/jackson-mapper-asl-1.9.4.jar, - lib/xalan.jar + lib/jasperreports-fonts-5.1.2.jar, + lib/barcode4j-2.1.jar, + lib/jackson-core-2.0.5.jar, + lib/xalan-2.7.1.jar Export-Package: ., + com.fasterxml.jackson.core, + com.fasterxml.jackson.core.base, + com.fasterxml.jackson.core.format, + com.fasterxml.jackson.core.io, + com.fasterxml.jackson.core.json, + com.fasterxml.jackson.core.sym, + com.fasterxml.jackson.core.type, + com.fasterxml.jackson.core.util, net.sf.jasperreports.ant, net.sf.jasperreports.charts, net.sf.jasperreports.charts.base, @@ -28,8 +35,12 @@ Export-Package: ., net.sf.jasperreports.components.charts, net.sf.jasperreports.components.headertoolbar, net.sf.jasperreports.components.headertoolbar.actions, + net.sf.jasperreports.components.headertoolbar.htmlv2, + net.sf.jasperreports.components.iconlabel, net.sf.jasperreports.components.list, net.sf.jasperreports.components.map, + net.sf.jasperreports.components.map.fill, + net.sf.jasperreports.components.map.type, net.sf.jasperreports.components.sort, net.sf.jasperreports.components.sort.actions, net.sf.jasperreports.components.spiderchart, @@ -64,13 +75,14 @@ Export-Package: ., net.sf.jasperreports.data.xml, net.sf.jasperreports.data.xmla, net.sf.jasperreports.engine, + net.sf.jasperreports.engine.analytics.data, + net.sf.jasperreports.engine.analytics.dataset, net.sf.jasperreports.engine.base, net.sf.jasperreports.engine.component, net.sf.jasperreports.engine.convert, net.sf.jasperreports.engine.data, net.sf.jasperreports.engine.design, net.sf.jasperreports.engine.design.events, - net.sf.jasperreports.engine.dtds, net.sf.jasperreports.engine.export, net.sf.jasperreports.engine.export.data, net.sf.jasperreports.engine.export.draw, @@ -78,18 +90,24 @@ Export-Package: ., net.sf.jasperreports.engine.export.oasis, net.sf.jasperreports.engine.export.ooxml, net.sf.jasperreports.engine.export.ooxml.type, + net.sf.jasperreports.engine.export.tabulator, + net.sf.jasperreports.engine.export.type, net.sf.jasperreports.engine.export.zip, net.sf.jasperreports.engine.fill, net.sf.jasperreports.engine.fonts, - net.sf.jasperreports.engine.images, net.sf.jasperreports.engine.print, net.sf.jasperreports.engine.query, net.sf.jasperreports.engine.scriptlets, + net.sf.jasperreports.engine.style, net.sf.jasperreports.engine.type, net.sf.jasperreports.engine.util, net.sf.jasperreports.engine.util.xml, + net.sf.jasperreports.engine.virtualization, net.sf.jasperreports.engine.xml, + net.sf.jasperreports.expressions, net.sf.jasperreports.extensions, + net.sf.jasperreports.functions, + net.sf.jasperreports.functions.annotations, net.sf.jasperreports.governors, net.sf.jasperreports.j2ee.servlets, net.sf.jasperreports.olap, @@ -100,9 +118,9 @@ Export-Package: ., net.sf.jasperreports.renderers, net.sf.jasperreports.repo, net.sf.jasperreports.swing, + net.sf.jasperreports.types.date, net.sf.jasperreports.util, net.sf.jasperreports.view, - net.sf.jasperreports.view.images, net.sf.jasperreports.view.save, net.sf.jasperreports.web, net.sf.jasperreports.web.actions, @@ -110,17 +128,74 @@ Export-Package: ., net.sf.jasperreports.web.listeners, net.sf.jasperreports.web.servlets, net.sf.jasperreports.web.util, + org.apache.bcel, + org.apache.bcel.classfile, + org.apache.bcel.generic, + org.apache.bcel.util, + org.apache.bcel.verifier, + org.apache.bcel.verifier.exc, + org.apache.bcel.verifier.statics, + org.apache.bcel.verifier.structurals, org.apache.commons.beanutils, org.apache.commons.beanutils.converters, + org.apache.commons.beanutils.expression, org.apache.commons.beanutils.locale, org.apache.commons.beanutils.locale.converters, org.apache.commons.collections, org.apache.commons.digester, + org.apache.commons.digester.annotations, + org.apache.commons.digester.annotations.handlers, + org.apache.commons.digester.annotations.internal, + org.apache.commons.digester.annotations.providers, + org.apache.commons.digester.annotations.reflect, + org.apache.commons.digester.annotations.rules, + org.apache.commons.digester.annotations.spi, + org.apache.commons.digester.annotations.utils, org.apache.commons.digester.parser, org.apache.commons.digester.plugins, org.apache.commons.digester.plugins.strategies, org.apache.commons.digester.substitution, org.apache.commons.digester.xmlrules, + org.apache.regexp, + org.apache.xalan, + org.apache.xalan.client, + org.apache.xalan.extensions, + org.apache.xalan.lib, + org.apache.xalan.lib.sql, + org.apache.xalan.processor, + org.apache.xalan.res, + org.apache.xalan.serialize, + org.apache.xalan.templates, + org.apache.xalan.trace, + org.apache.xalan.transformer, + org.apache.xalan.xslt, + org.apache.xalan.xsltc, + org.apache.xalan.xsltc.cmdline, + org.apache.xalan.xsltc.cmdline.getopt, + org.apache.xalan.xsltc.compiler, + org.apache.xalan.xsltc.compiler.util, + org.apache.xalan.xsltc.dom, + org.apache.xalan.xsltc.runtime, + org.apache.xalan.xsltc.runtime.output, + org.apache.xalan.xsltc.trax, + org.apache.xalan.xsltc.util, + org.apache.xml.dtm, + org.apache.xml.dtm.ref, + org.apache.xml.dtm.ref.dom2dtm, + org.apache.xml.dtm.ref.sax2dtm, + org.apache.xml.res, + org.apache.xml.utils, + org.apache.xml.utils.res, + org.apache.xpath, + org.apache.xpath.axes, + org.apache.xpath.compiler, + org.apache.xpath.domapi, + org.apache.xpath.functions, + org.apache.xpath.jaxp, + org.apache.xpath.objects, + org.apache.xpath.operations, + org.apache.xpath.patterns, + org.apache.xpath.res, org.eclipse.jdt.core.compiler, org.eclipse.jdt.internal.compiler, org.eclipse.jdt.internal.compiler.ast, @@ -136,6 +211,27 @@ Export-Package: ., org.eclipse.jdt.internal.compiler.problem, org.eclipse.jdt.internal.compiler.util, org.eclipse.jdt.internal.core.util, + org.krysalis.barcode4j, + org.krysalis.barcode4j.ant, + org.krysalis.barcode4j.cli, + org.krysalis.barcode4j.impl, + org.krysalis.barcode4j.impl.codabar, + org.krysalis.barcode4j.impl.code128, + org.krysalis.barcode4j.impl.code39, + org.krysalis.barcode4j.impl.datamatrix, + org.krysalis.barcode4j.impl.fourstate, + org.krysalis.barcode4j.impl.int2of5, + org.krysalis.barcode4j.impl.pdf417, + org.krysalis.barcode4j.impl.postnet, + org.krysalis.barcode4j.impl.upcean, + org.krysalis.barcode4j.output, + org.krysalis.barcode4j.output.bitmap, + org.krysalis.barcode4j.output.eps, + org.krysalis.barcode4j.output.java2d, + org.krysalis.barcode4j.output.svg, + org.krysalis.barcode4j.servlet, + org.krysalis.barcode4j.tools, + org.krysalis.barcode4j.xalan, org.w3c.tools.codec Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: com.lowagie.text, diff --git a/org.adempiere.report.jasper.library/build.properties b/org.adempiere.report.jasper.library/build.properties index 36d3db9c1a..5c8f02849d 100644 --- a/org.adempiere.report.jasper.library/build.properties +++ b/org.adempiere.report.jasper.library/build.properties @@ -1,10 +1,9 @@ bin.includes = META-INF/,\ lib/commons-beanutils-1.8.0.jar,\ lib/commons-digester-2.1.jar,\ - lib/jasperreports-4.6.0.jar,\ + lib/jasperreports-5.1.2.jar,\ lib/jdt-compiler-3.1.1.jar,\ - lib/jasperreports-fonts-4.6.0.jar,\ - lib/barcode4j-2.0.jar,\ - lib/jackson-core-asl-1.9.4.jar,\ - lib/jackson-mapper-asl-1.9.4.jar,\ - lib/xalan.jar + lib/jasperreports-fonts-5.1.2.jar,\ + lib/barcode4j-2.1.jar,\ + lib/jackson-core-2.0.5.jar,\ + lib/xalan-2.7.1.jar From 3c9696db4b7455ae0e2f2b578ed5127b2877fe51 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 14 Jun 2013 13:09:51 -0500 Subject: [PATCH 3/9] IDEMPIERE-994 Model afterSave and afterDelete must check success flag when doing DB work / based on patch from Carlos Sanchez --- .../compiere/model/MAcctSchemaElement.java | 4 ++ .../src/org/compiere/model/MAssetUse.java | 5 +- .../src/org/compiere/model/MAttribute.java | 2 + .../src/org/compiere/model/MAttributeSet.java | 2 + .../src/org/compiere/model/MClientShare.java | 4 +- .../src/org/compiere/model/MColumn.java | 2 + .../org/compiere/model/MCommissionAmt.java | 2 + .../org/compiere/model/MCommissionDetail.java | 2 + .../src/org/compiere/model/MCostDetail.java | 16 +---- .../org/compiere/model/MDepositBatchLine.java | 4 ++ .../org/compiere/model/MDistributionLine.java | 2 + .../org/compiere/model/MDunningRunLine.java | 8 ++- .../src/org/compiere/model/MElementValue.java | 2 + .../src/org/compiere/model/MForm.java | 2 + .../src/org/compiere/model/MInfoWindow.java | 2 + .../org/compiere/model/MInventoryLine.java | 24 +++---- .../compiere/model/MInvoicePaySchedule.java | 2 + .../src/org/compiere/model/MLanguage.java | 2 + .../src/org/compiere/model/MLocation.java | 2 + .../src/org/compiere/model/MMenu.java | 2 + .../org/compiere/model/MOrderPaySchedule.java | 2 + .../src/org/compiere/model/MPInstance.java | 2 + .../src/org/compiere/model/MPaySchedule.java | 2 + .../org/compiere/model/MPaySelectionLine.java | 8 ++- .../src/org/compiere/model/MPeriod.java | 2 + .../src/org/compiere/model/MProcess.java | 2 + .../src/org/compiere/model/MProductBOM.java | 2 + .../compiere/model/MProductCategoryAcct.java | 2 + .../src/org/compiere/model/MProjectLine.java | 4 ++ .../compiere/model/MResourceAssignment.java | 66 ++++++++++--------- .../model/MRevenueRecognitionPlan.java | 63 +++++++++--------- .../org/compiere/model/MRfQResponseLine.java | 4 +- .../src/org/compiere/model/MRole.java | 4 +- .../src/org/compiere/model/MTable.java | 2 + .../src/org/compiere/model/MTask.java | 2 + .../src/org/compiere/model/MTree_Base.java | 2 + .../src/org/compiere/model/MWindow.java | 2 + .../src/org/compiere/model/M_Element.java | 4 +- 38 files changed, 167 insertions(+), 99 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java index 2462891928..f58bf0007c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java @@ -470,6 +470,8 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element @Override protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Default Value if (isMandatory() && is_ValueChanged(COLUMNNAME_IsMandatory)) { @@ -535,6 +537,8 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element @Override protected boolean afterDelete (boolean success) { + if (!success) + return success; // Update Account Info StringBuilder msguvd = new StringBuilder("AD_Client_ID=").append(getAD_Client_ID()); MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetUse.java b/org.adempiere.base/src/org/compiere/model/MAssetUse.java index 126918d73e..2c4dc96745 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetUse.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetUse.java @@ -41,7 +41,8 @@ public class MAssetUse extends X_A_Asset_Use protected boolean afterSave (boolean newRecord,boolean success) { log.info ("afterSave"); - + if (!success) + return success; int p_A_Asset_ID = 0; int total_unitsused = 0; p_A_Asset_ID = getA_Asset_ID(); @@ -64,7 +65,7 @@ protected boolean afterSave (boolean newRecord,boolean success) change.setUseUnits(getUseUnits()); change.saveEx(); - return true; + return success; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MAttribute.java b/org.adempiere.base/src/org/compiere/model/MAttribute.java index ad8212af46..e2a38ac83c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttribute.java +++ b/org.adempiere.base/src/org/compiere/model/MAttribute.java @@ -241,6 +241,8 @@ public class MAttribute extends X_M_Attribute */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Changed to Instance Attribute if (!newRecord && is_ValueChanged("IsInstanceAttribute") && isInstanceAttribute()) { diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java index 234badba8a..292a0071b8 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java @@ -397,6 +397,8 @@ public class MAttributeSet extends X_M_AttributeSet protected boolean afterSave (boolean newRecord, boolean success) { // Set Instance Attribute + if (!success) + return success; if (!isInstanceAttribute()) { StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas") diff --git a/org.adempiere.base/src/org/compiere/model/MClientShare.java b/org.adempiere.base/src/org/compiere/model/MClientShare.java index 3aa9cf2a2a..69f0cf8c2e 100644 --- a/org.adempiere.base/src/org/compiere/model/MClientShare.java +++ b/org.adempiere.base/src/org/compiere/model/MClientShare.java @@ -191,12 +191,14 @@ public class MClientShare extends X_AD_ClientShare */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (isActive()) { setDataToLevel(); listChildRecords(); } - return true; + return success; } // afterSave /** diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index f4e867ac9a..ee49d68bfe 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -345,6 +345,8 @@ public class MColumn extends X_AD_Column */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Update Fields if (!newRecord) { diff --git a/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java b/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java index b9d2d54240..5a2173f688 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java +++ b/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java @@ -139,6 +139,8 @@ public class MCommissionAmt extends X_C_CommissionAmt */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (!newRecord) updateRunHeader(); return success; diff --git a/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java b/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java index 43780c54fd..421470ffcb 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java @@ -115,6 +115,8 @@ public class MCommissionDetail extends X_C_CommissionDetail */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (!newRecord) updateAmtHeader(); return success; diff --git a/org.adempiere.base/src/org/compiere/model/MCostDetail.java b/org.adempiere.base/src/org/compiere/model/MCostDetail.java index faa9bbeef8..caa83f3bd8 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MCostDetail.java @@ -49,7 +49,7 @@ public class MCostDetail extends X_M_CostDetail /** * */ - private static final long serialVersionUID = -7882724307127281675L; + private static final long serialVersionUID = -448632684360931078L; /** * Create New Order Cost Detail for Purchase Orders. @@ -686,19 +686,7 @@ public class MCostDetail extends X_M_CostDetail return !(getDeltaAmt().signum() == 0 && getDeltaQty().signum() == 0); } // isDelta - - - /** - * After Save - * @param newRecord new - * @param success success - * @return true - */ - protected boolean afterSave (boolean newRecord, boolean success) - { - return true; - } // afterSave - + /** * Before Delete * @return false if processed diff --git a/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java b/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java index 59de5a017a..1344acb23a 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java @@ -152,6 +152,8 @@ import org.compiere.util.Env; */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; updateHeader(); return success; } // afterSave @@ -163,6 +165,8 @@ import org.compiere.util.Env; */ protected boolean afterDelete (boolean success) { + if (!success) + return success; updateHeader(); if (getC_Payment_ID() != 0 ) { diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionLine.java b/org.adempiere.base/src/org/compiere/model/MDistributionLine.java index 5013a8a9e6..a620e32bb4 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionLine.java @@ -270,6 +270,8 @@ public class MDistributionLine extends X_GL_DistributionLine */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; getParent(); m_parent.validate(); m_parent.saveEx(); diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java b/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java index 756fbfbf1a..3f9655accd 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java @@ -317,7 +317,9 @@ public class MDunningRunLine extends X_C_DunningRunLine * @return success */ protected boolean afterSave (boolean newRecord, boolean success) - { + { + if (!success) + return success; updateEntry(); return success; } // afterSave @@ -328,7 +330,9 @@ public class MDunningRunLine extends X_C_DunningRunLine * @return success */ protected boolean afterDelete (boolean success) - { + { + if (!success) + return success; updateEntry(); return success; } // afterDelete diff --git a/org.adempiere.base/src/org/compiere/model/MElementValue.java b/org.adempiere.base/src/org/compiere/model/MElementValue.java index 2c7b5ca682..ef12535d3e 100644 --- a/org.adempiere.base/src/org/compiere/model/MElementValue.java +++ b/org.adempiere.base/src/org/compiere/model/MElementValue.java @@ -244,6 +244,8 @@ public class MElementValue extends X_C_ElementValue @Override protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) { // afalcone [Bugs #1837219] diff --git a/org.adempiere.base/src/org/compiere/model/MForm.java b/org.adempiere.base/src/org/compiere/model/MForm.java index ab74fe5df5..4f58748a63 100644 --- a/org.adempiere.base/src/org/compiere/model/MForm.java +++ b/org.adempiere.base/src/org/compiere/model/MForm.java @@ -66,6 +66,8 @@ public class MForm extends X_AD_Form */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) { int AD_Role_ID = Env.getAD_Role_ID(getCtx()); diff --git a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java index 6b7c9b7570..54c0e7ed07 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java @@ -130,6 +130,8 @@ public class MInfoWindow extends X_AD_InfoWindow @Override protected boolean afterSave(boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) // Add to all automatic roles { MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'"); diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java index 5badb4c46a..7cc5183b91 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java @@ -39,7 +39,7 @@ public class MInventoryLine extends X_M_InventoryLine /** * */ - private static final long serialVersionUID = -3513145563716006099L; + private static final long serialVersionUID = -3864175464877913555L; /** * Get Inventory Line with parameters @@ -365,17 +365,17 @@ public class MInventoryLine extends X_M_InventoryLine * @param success success * @return true */ - protected boolean afterSave (boolean newRecord, boolean success) - { - if (!success) - return false; - - // Create MA - //if (newRecord && success - // && m_isManualEntry && getM_AttributeSetInstance_ID() == 0) - // createMA(); - return true; - } // afterSave + //protected boolean afterSave (boolean newRecord, boolean success) + //{ + // if (!success) + // return false; + // + // // Create MA + // //if (newRecord && success + // // && m_isManualEntry && getM_AttributeSetInstance_ID() == 0) + // // createMA(); + // return true; + //} // afterSave /** * Create Material Allocations for new Instances diff --git a/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java b/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java index 2006a6a74c..d50d3ac3e9 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java @@ -227,6 +227,8 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (is_ValueChanged("DueAmt")) { log.fine("afterSave"); diff --git a/org.adempiere.base/src/org/compiere/model/MLanguage.java b/org.adempiere.base/src/org/compiere/model/MLanguage.java index 8572d7f313..7b9d40fae7 100644 --- a/org.adempiere.base/src/org/compiere/model/MLanguage.java +++ b/org.adempiere.base/src/org/compiere/model/MLanguage.java @@ -318,6 +318,8 @@ public class MLanguage extends X_AD_Language */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; int no = TranslationTable.getActiveLanguages(true); if (log.isLoggable(Level.FINE)) log.fine("Active Languages=" + no); return true; diff --git a/org.adempiere.base/src/org/compiere/model/MLocation.java b/org.adempiere.base/src/org/compiere/model/MLocation.java index c44caac593..bc189f1dde 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MLocation.java @@ -675,6 +675,8 @@ public class MLocation extends X_C_Location implements Comparator */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Value/Name change in Account if (!newRecord && ("Y".equals(Env.getContext(getCtx(), "$Element_LF")) diff --git a/org.adempiere.base/src/org/compiere/model/MMenu.java b/org.adempiere.base/src/org/compiere/model/MMenu.java index 941f2b737b..2bacdfca28 100644 --- a/org.adempiere.base/src/org/compiere/model/MMenu.java +++ b/org.adempiere.base/src/org/compiere/model/MMenu.java @@ -143,6 +143,8 @@ public class MMenu extends X_AD_Menu */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) insert_Tree(MTree_Base.TREETYPE_Menu); return success; diff --git a/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java b/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java index c02a527aa2..e5d85adf9d 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java @@ -227,6 +227,8 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (is_ValueChanged("DueAmt")) { log.fine("afterSave"); diff --git a/org.adempiere.base/src/org/compiere/model/MPInstance.java b/org.adempiere.base/src/org/compiere/model/MPInstance.java index 38c9ea8c76..6909333f64 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstance.java @@ -289,6 +289,8 @@ public class MPInstance extends X_AD_PInstance */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Update Statistics if (!newRecord && !isProcessing() diff --git a/org.adempiere.base/src/org/compiere/model/MPaySchedule.java b/org.adempiere.base/src/org/compiere/model/MPaySchedule.java index 6cbf767a97..aefec3540f 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySchedule.java @@ -110,6 +110,8 @@ public class MPaySchedule extends X_C_PaySchedule */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord || is_ValueChanged("Percentage") || is_ValueChanged("IsActive")) { log.fine("afterSave"); diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java b/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java index c917142cc1..df9e9c0ce8 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java @@ -137,7 +137,9 @@ public class MPaySelectionLine extends X_C_PaySelectionLine * @return success */ protected boolean afterSave (boolean newRecord, boolean success) - { + { + if (!success) + return success; setHeader(); return success; } // afterSave @@ -148,7 +150,9 @@ public class MPaySelectionLine extends X_C_PaySelectionLine * @return sucess */ protected boolean afterDelete (boolean success) - { + { + if (!success) + return success; setHeader(); return success; } // afterDelete diff --git a/org.adempiere.base/src/org/compiere/model/MPeriod.java b/org.adempiere.base/src/org/compiere/model/MPeriod.java index 83241110d0..a93227c3d2 100644 --- a/org.adempiere.base/src/org/compiere/model/MPeriod.java +++ b/org.adempiere.base/src/org/compiere/model/MPeriod.java @@ -613,6 +613,8 @@ public class MPeriod extends X_C_Period */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) { // SELECT Value FROM AD_Ref_List WHERE AD_Reference_ID=183 diff --git a/org.adempiere.base/src/org/compiere/model/MProcess.java b/org.adempiere.base/src/org/compiere/model/MProcess.java index 25623c5985..a3f87f95ee 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcess.java +++ b/org.adempiere.base/src/org/compiere/model/MProcess.java @@ -358,6 +358,8 @@ public class MProcess extends X_AD_Process */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) // Add to all automatic roles { MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'"); diff --git a/org.adempiere.base/src/org/compiere/model/MProductBOM.java b/org.adempiere.base/src/org/compiere/model/MProductBOM.java index 8ca171faf8..1533d5946f 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductBOM.java +++ b/org.adempiere.base/src/org/compiere/model/MProductBOM.java @@ -157,6 +157,8 @@ public class MProductBOM extends X_M_Product_BOM */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Product Line was changed if (newRecord || is_ValueChanged("M_ProductBOM_ID")) { diff --git a/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java b/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java index 638573ac43..29cfd71efe 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java @@ -105,6 +105,8 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; checkCosting(); return success; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MProjectLine.java b/org.adempiere.base/src/org/compiere/model/MProjectLine.java index e43a2025bc..c01137b648 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectLine.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectLine.java @@ -240,6 +240,8 @@ public class MProjectLine extends X_C_ProjectLine */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; updateHeader(); return success; } // afterSave @@ -252,6 +254,8 @@ public class MProjectLine extends X_C_ProjectLine */ protected boolean afterDelete (boolean success) { + if (!success) + return success; updateHeader(); return success; } // afterDelete diff --git a/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java b/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java index ea4c182df5..96fa152652 100644 --- a/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java +++ b/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java @@ -34,7 +34,7 @@ public class MResourceAssignment extends X_S_ResourceAssignment /** * */ - private static final long serialVersionUID = 3024759545660161137L; + private static final long serialVersionUID = 4230793339153210998L; /** * Stnadard Constructor @@ -72,37 +72,39 @@ public class MResourceAssignment extends X_S_ResourceAssignment * @param success success * @return true */ - protected boolean afterSave (boolean newRecord, boolean success) - { - /* - v_Description := :new.Name; - IF (:new.Description IS NOT NULL AND LENGTH(:new.Description) > 0) THEN - v_Description := v_Description || ' (' || :new.Description || ')'; - END IF; - - -- Update Expense Line - UPDATE S_TimeExpenseLine - SET Description = v_Description, - Qty = :new.Qty - WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID - AND (Description <> v_Description OR Qty <> :new.Qty); - - -- Update Order Line - UPDATE C_OrderLine - SET Description = v_Description, - QtyOrdered = :new.Qty - WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID - AND (Description <> v_Description OR QtyOrdered <> :new.Qty); - - -- Update Invoice Line - UPDATE C_InvoiceLine - SET Description = v_Description, - QtyInvoiced = :new.Qty - WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID - AND (Description <> v_Description OR QtyInvoiced <> :new.Qty); - */ - return success; - } // afterSave +// protected boolean afterSave (boolean newRecord, boolean success) +// { +// /* +// if (!success) +// return success; +// v_Description := :new.Name; +// IF (:new.Description IS NOT NULL AND LENGTH(:new.Description) > 0) THEN +// v_Description := v_Description || ' (' || :new.Description || ')'; +// END IF; +// +// -- Update Expense Line +// UPDATE S_TimeExpenseLine +// SET Description = v_Description, +// Qty = :new.Qty +// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID +// AND (Description <> v_Description OR Qty <> :new.Qty); +// +// -- Update Order Line +// UPDATE C_OrderLine +// SET Description = v_Description, +// QtyOrdered = :new.Qty +// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID +// AND (Description <> v_Description OR QtyOrdered <> :new.Qty); +// +// -- Update Invoice Line +// UPDATE C_InvoiceLine +// SET Description = v_Description, +// QtyInvoiced = :new.Qty +// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID +// AND (Description <> v_Description OR QtyInvoiced <> :new.Qty); +// */ +// return success; +// } // afterSave /** * String Representation diff --git a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java index 91e5400ada..b55cea821d 100644 --- a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java +++ b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java @@ -32,8 +32,7 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan /** * */ - private static final long serialVersionUID = -6748195415080148091L; - + private static final long serialVersionUID = -8437258098744762898L; /** * Standard Constructor @@ -74,33 +73,35 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan * @param success success * @return success */ - protected boolean afterSave (boolean newRecord, boolean success) - { - if (newRecord) - { - MRevenueRecognition rr = new MRevenueRecognition(getCtx(), getC_RevenueRecognition_ID(), get_TrxName()); - if (rr.isTimeBased()) - { - /** Get InvoiveQty - SELECT QtyInvoiced, M_Product_ID - INTO v_Qty, v_M_Product_ID - FROM C_InvoiceLine - WHERE C_InvoiceLine_ID=:new.C_InvoiceLine_ID; - -- Insert - AD_Sequence_Next ('C_ServiceLevel', :new.AD_Client_ID, v_NextNo); - INSERT INTO C_ServiceLevel - (C_ServiceLevel_ID, C_RevenueRecognition_Plan_ID, - AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy, - M_Product_ID, Description, ServiceLevelInvoiced, ServiceLevelProvided, - Processing,Processed) - VALUES - (v_NextNo, :new.C_RevenueRecognition_Plan_ID, - :new.AD_Client_ID,:new.AD_Org_ID,'Y',SysDate,:new.CreatedBy,SysDate,:new.UpdatedBy, - v_M_Product_ID, NULL, v_Qty, 0, - 'N', 'N'); - **/ - } - } - return success; - } // afterSave +// protected boolean afterSave (boolean newRecord, boolean success) +// { +// if (!success) +// return success; +// if (newRecord) +// { +// MRevenueRecognition rr = new MRevenueRecognition(getCtx(), getC_RevenueRecognition_ID(), get_TrxName()); +// if (rr.isTimeBased()) +// { +// /** Get InvoiveQty +// SELECT QtyInvoiced, M_Product_ID +// INTO v_Qty, v_M_Product_ID +// FROM C_InvoiceLine +// WHERE C_InvoiceLine_ID=:new.C_InvoiceLine_ID; +// -- Insert +// AD_Sequence_Next ('C_ServiceLevel', :new.AD_Client_ID, v_NextNo); +// INSERT INTO C_ServiceLevel +// (C_ServiceLevel_ID, C_RevenueRecognition_Plan_ID, +// AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy, +// M_Product_ID, Description, ServiceLevelInvoiced, ServiceLevelProvided, +// Processing,Processed) +// VALUES +// (v_NextNo, :new.C_RevenueRecognition_Plan_ID, +// :new.AD_Client_ID,:new.AD_Org_ID,'Y',SysDate,:new.CreatedBy,SysDate,:new.UpdatedBy, +// v_M_Product_ID, NULL, v_Qty, 0, +// 'N', 'N'); +// **/ +// } +// } +// return success; +// } // afterSave } // MRevenueRecognitionPlan diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java b/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java index 56c23f4c53..24802ba9f7 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java @@ -204,7 +204,9 @@ public class MRfQResponseLine extends X_C_RfQResponseLine * @return success */ protected boolean afterSave (boolean newRecord, boolean success) - { + { + if (!success) + return success; if (!isActive()) { getQtys (false); diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 6de63b210f..87032e941c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -362,7 +362,9 @@ public final class MRole extends X_AD_Role * @return success */ protected boolean afterSave (boolean newRecord, boolean success) - { + { + if (!success) + return success; if (newRecord && success) { // Add Role to SuperUser diff --git a/org.adempiere.base/src/org/compiere/model/MTable.java b/org.adempiere.base/src/org/compiere/model/MTable.java index ed8563babc..e27ff2fe32 100644 --- a/org.adempiere.base/src/org/compiere/model/MTable.java +++ b/org.adempiere.base/src/org/compiere/model/MTable.java @@ -510,6 +510,8 @@ public class MTable extends X_AD_Table */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // Sync Table ID MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName()); if (seq == null || seq.get_ID() == 0) diff --git a/org.adempiere.base/src/org/compiere/model/MTask.java b/org.adempiere.base/src/org/compiere/model/MTask.java index e687b84b87..2c8d705d2d 100644 --- a/org.adempiere.base/src/org/compiere/model/MTask.java +++ b/org.adempiere.base/src/org/compiere/model/MTask.java @@ -153,6 +153,8 @@ public class MTask extends X_AD_Task protected boolean afterSave (boolean newRecord, boolean success) { if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); + if (!success) + return success; if (! newRecord) { // Menu/Workflow diff --git a/org.adempiere.base/src/org/compiere/model/MTree_Base.java b/org.adempiere.base/src/org/compiere/model/MTree_Base.java index a16673d6bb..c9c4be663c 100644 --- a/org.adempiere.base/src/org/compiere/model/MTree_Base.java +++ b/org.adempiere.base/src/org/compiere/model/MTree_Base.java @@ -353,6 +353,8 @@ public class MTree_Base extends X_AD_Tree */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) // Base Node { if (TREETYPE_BPartner.equals(getTreeType())) diff --git a/org.adempiere.base/src/org/compiere/model/MWindow.java b/org.adempiere.base/src/org/compiere/model/MWindow.java index c59ab2cc82..9e032c22a8 100644 --- a/org.adempiere.base/src/org/compiere/model/MWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MWindow.java @@ -118,6 +118,8 @@ public class MWindow extends X_AD_Window */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; if (newRecord) // Add to all automatic roles { MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'"); diff --git a/org.adempiere.base/src/org/compiere/model/M_Element.java b/org.adempiere.base/src/org/compiere/model/M_Element.java index c1f53048a7..0cd8e50b68 100644 --- a/org.adempiere.base/src/org/compiere/model/M_Element.java +++ b/org.adempiere.base/src/org/compiere/model/M_Element.java @@ -207,7 +207,9 @@ public class M_Element extends X_AD_Element * @return success */ protected boolean afterSave (boolean newRecord, boolean success) - { + { + if (!success) + return success; // Update Columns, Fields, Parameters, Print Info if (!newRecord) { From e03aa6317e5a3ff8a16c7095089826222d10cacf Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 15 Jun 2013 22:09:51 -0500 Subject: [PATCH 4/9] IDEMPIERE-1010 - fix problem opened with process parameter panel / swing --- .../src/org/compiere/apps/ProcessParameterPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java index 4810a9aa25..0ae23e3e16 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java @@ -202,7 +202,7 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe + "p.AD_Reference_ID, p.AD_Process_Para_ID, " + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, " + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " - + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted " + + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted, NULL AS FormatPattern " + "FROM AD_Process_Para p" + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " + "WHERE p.AD_Process_ID=?" // 1 @@ -213,7 +213,7 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe + "p.AD_Reference_ID, p.AD_Process_Para_ID, " + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, " + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " - + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted " + + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, p.ReadOnlyLogic, p.DisplayLogic, p.IsEncrypted, NULL AS FormatPattern " + "FROM AD_Process_Para p" + " INNER JOIN AD_Process_Para_Trl t ON (p.AD_Process_Para_ID=t.AD_Process_Para_ID)" + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " From 131a60a9deabf4ede7ae842f631b23518102fee9 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 15 Jun 2013 22:11:12 -0500 Subject: [PATCH 5/9] Remove byte order mark from 950_IDEMPIERE-234.sql --- migration/360lts-i1.0a/postgresql/950_IDEMPIERE-234.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/360lts-i1.0a/postgresql/950_IDEMPIERE-234.sql b/migration/360lts-i1.0a/postgresql/950_IDEMPIERE-234.sql index 0d1d28ab59..974c02809b 100644 --- a/migration/360lts-i1.0a/postgresql/950_IDEMPIERE-234.sql +++ b/migration/360lts-i1.0a/postgresql/950_IDEMPIERE-234.sql @@ -1,4 +1,4 @@ -DROP VIEW AD_TAB_V; +DROP VIEW AD_TAB_V; CREATE OR REPLACE VIEW AD_TAB_V (AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME, DESCRIPTION, HELP, SEQNO, ISSINGLEROW, HASTREE, ISINFOTAB, From 470202287c2343bf696498162157002c9bcfcae8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Jun 2013 13:56:27 -0500 Subject: [PATCH 6/9] IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom / IDEMPIERE-922 / IDEMPIERE-938 / Restored backward compatibility on copying AD_Org_ID --- .../oracle/201306171349_IDEMPIERE-67.sql | 32 ++++++++++++++++ .../postgresql/201306171349_IDEMPIERE-67.sql | 32 ++++++++++++++++ .../compiere/process/ColumnEncryption.java | 2 +- .../src/org/compiere/model/GridField.java | 38 +++++++++++++++++-- .../src/org/compiere/model/GridTable.java | 32 ++++++++++------ .../src/org/compiere/model/MColumn.java | 27 ++++++++----- .../src/org/compiere/model/MField.java | 11 ++++-- .../org/compiere/model/MRequestUpdate.java | 2 +- .../src/org/compiere/model/PO.java | 17 +++++++-- 9 files changed, 161 insertions(+), 32 deletions(-) create mode 100644 migration/i1.0b-release/oracle/201306171349_IDEMPIERE-67.sql create mode 100644 migration/i1.0b-release/postgresql/201306171349_IDEMPIERE-67.sql diff --git a/migration/i1.0b-release/oracle/201306171349_IDEMPIERE-67.sql b/migration/i1.0b-release/oracle/201306171349_IDEMPIERE-67.sql new file mode 100644 index 0000000000..6e73a87c6c --- /dev/null +++ b/migration/i1.0b-release/oracle/201306171349_IDEMPIERE-67.sql @@ -0,0 +1,32 @@ +-- Backward compatibility with old PO copyValues method +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND ColumnName IN ( +'Created', +'CreatedBy', +'Updated', +'UpdatedBy', +'IsActive', +'AD_Client_ID', +'AD_Org_ID', +'Processing' +); + +-- new columns found to be problematic +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND ColumnName IN ( +'ProcessedOn' +); + +-- key columns +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND IsKey='Y'; + +-- virtual columns +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND ColumnSQL IS NOT NULL; + +-- UUID columns +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND columnname = (SELECT tablename||'_UU' FROM ad_table t where t.ad_table_id=ad_column.ad_table_id); + +-- allow copy of AD_Org_ID on field but not on column (for backward compatibility) +UPDATE AD_Field SET IsAllowCopy='Y' WHERE COALESCE(IsAllowCopy,'N')='N' AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName = 'AD_Org_ID'); + +SELECT register_migration_script('201306171349_IDEMPIERE-67.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/201306171349_IDEMPIERE-67.sql b/migration/i1.0b-release/postgresql/201306171349_IDEMPIERE-67.sql new file mode 100644 index 0000000000..6e73a87c6c --- /dev/null +++ b/migration/i1.0b-release/postgresql/201306171349_IDEMPIERE-67.sql @@ -0,0 +1,32 @@ +-- Backward compatibility with old PO copyValues method +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND ColumnName IN ( +'Created', +'CreatedBy', +'Updated', +'UpdatedBy', +'IsActive', +'AD_Client_ID', +'AD_Org_ID', +'Processing' +); + +-- new columns found to be problematic +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND ColumnName IN ( +'ProcessedOn' +); + +-- key columns +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND IsKey='Y'; + +-- virtual columns +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND ColumnSQL IS NOT NULL; + +-- UUID columns +UPDATE AD_Column SET IsAllowCopy='N' WHERE IsAllowCopy='Y' AND columnname = (SELECT tablename||'_UU' FROM ad_table t where t.ad_table_id=ad_column.ad_table_id); + +-- allow copy of AD_Org_ID on field but not on column (for backward compatibility) +UPDATE AD_Field SET IsAllowCopy='Y' WHERE COALESCE(IsAllowCopy,'N')='N' AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName = 'AD_Org_ID'); + +SELECT register_migration_script('201306171349_IDEMPIERE-67.sql') FROM dual +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java index 09ada9d345..b09a709829 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java @@ -119,7 +119,7 @@ public class ColumnEncryption extends SvrProcess { int dt = column.getAD_Reference_ID(); // Can it be enabled? - if (column.isKey() || column.isParent() || column.isStandardColumn() + if (column.isKey() || column.isParent() || column.isStandardColumn() || column.isUUIDColumn() || column.isVirtualColumn() || column.isIdentifier() || column.isTranslated() || DisplayType.isLookup(dt) || DisplayType.isLOB(dt) || DisplayType.isDate(dt) || DisplayType.isNumeric(dt) diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 0795655642..8240fe8103 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -92,7 +92,7 @@ public class GridField // Set Attributes loadLookup(); setError(false); - } // MField + } // GridField /** Value Object */ private GridFieldVO m_vo; @@ -106,7 +106,7 @@ public class GridField */ protected void dispose() { - // log.fine( "MField.dispose = " + m_vo.ColumnName); + // log.fine( "GridField.dispose = " + m_vo.ColumnName); m_propertyChangeListeners = null; if (m_lookup != null) m_lookup.dispose(); @@ -1090,6 +1090,36 @@ public class GridField * @return true if allow copy */ public boolean isAllowCopy() { + /* IDEMPIERE-67 + * Extending MColumn.isStandardColumn + * Force some additional columns to forbid copy from the UI + */ + String colname = getColumnName(); + if ( colname.equals("C_CashLine_ID") + || colname.equals("C_Location_ID") + || colname.equals("C_Payment_ID") + || colname.equals("DocAction") + || colname.equals("DocStatus") + || colname.equals("DocumentNo") + || colname.equals("EntityType") + || colname.equals("GrandTotal") + || colname.equals("IsAllocated") + || colname.equals("IsApproved") + || colname.equals("IsDelivered") + || colname.equals("IsGenerated") + || colname.equals("IsInvoiced") + || colname.equals("IsPaid") + || colname.equals("IsReconciled") + || colname.equals("IsSelfService") + || colname.equals("Line") + || colname.equals("Posted") + || colname.equals("Processed") + || colname.equals("ProcessedOn") + || colname.equals("TotalCr") + || colname.equals("TotalDr") + || colname.equals("TotalLines") + || colname.startsWith("Ref_")) + return false; return m_vo.IsAllowCopy; } /** @@ -1693,7 +1723,7 @@ public class GridField */ public String toStringX() { - StringBuilder sb = new StringBuilder("MField["); + StringBuilder sb = new StringBuilder("GridField["); sb.append(m_vo.ColumnName).append("=").append(m_value) .append(",DisplayType=").append(getDisplayType()) .append("]"); @@ -2011,4 +2041,4 @@ public class GridField } -} // MField +} // GridField diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 39f557504f..79417d23ae 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -533,7 +533,7 @@ public class GridTable extends AbstractTableModel /** * Get Column at index * @param index index - * @return MField + * @return GridField */ protected GridField getField (int index) { @@ -545,7 +545,7 @@ public class GridTable extends AbstractTableModel /** * Return Columns with Identifier (ColumnName) * @param identifier column name - * @return MField + * @return GridField */ protected GridField getField (String identifier) { @@ -564,7 +564,7 @@ public class GridTable extends AbstractTableModel /** * Get all Fields - * @return MFields + * @return GridFields */ public GridField[] getFields () { @@ -791,7 +791,7 @@ public class GridTable extends AbstractTableModel */ private void dispose() { - // MFields + // GridFields for (int i = 0; i < m_fields.size(); i++) ((GridField)m_fields.get(i)).dispose(); m_fields.clear(); @@ -1183,7 +1183,7 @@ public class GridTable extends AbstractTableModel } // setChanged /** - * Set Value in data and update MField. + * Set Value in data and update GridField. * (called directly or from JTable.editingStopped()) * * @param value value to assign to cell @@ -1196,7 +1196,7 @@ public class GridTable extends AbstractTableModel } // setValueAt /** - * Set Value in data and update MField. + * Set Value in data and update GridField. * (called directly or from JTable.editingStopped()) * * @param value value to assign to cell @@ -1261,7 +1261,7 @@ public class GridTable extends AbstractTableModel setDataAtRow(row, rowData); // update Table fireTableCellUpdated(row, col); - // update MField + // update GridField GridField field = getField(col); field.setValue(value, m_inserting); // inform @@ -2530,18 +2530,28 @@ public class GridTable extends AbstractTableModel // fill data if (copyCurrent) { + boolean hasDocTypeTargetField = (getField("C_DocTypeTarget_ID") != null); Object[] origData = getDataAtRow(currentRow); for (int i = 0; i < size; i++) { GridField field = (GridField)m_fields.get(i); + MColumn column = null; + if (field.getAD_Column_ID() > 0) + column = MColumn.get(m_ctx, field.getAD_Column_ID()); if (field.isVirtualColumn()) ; - else if (field.isAllowCopy()) - rowData[i] = origData[i]; - else { + else if ( field.isKey() // KeyColumn + || (column != null && column.isUUIDColumn()) // IDEMPIERE-67 + || (column != null && column.isStandardColumn() && !column.getColumnName().equals("AD_Org_ID")) // AD_Org_ID can be copied + // Bug [ 1807947 ] + || (hasDocTypeTargetField && field.getColumnName().equals("C_DocType_ID")) + || ! field.isAllowCopy()) + { rowData[i] = field.getDefault(); field.setValue(rowData[i], m_inserting); } + else + rowData[i] = origData[i]; } } else // new @@ -3124,7 +3134,7 @@ public class GridTable extends AbstractTableModel String columnName = null; int displayType = 0; - // Types see also MField.createDefault + // Types see also GridField.createDefault try { // get row data diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index ee49d68bfe..7fe700c099 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -47,7 +47,7 @@ public class MColumn extends X_AD_Column /** * */ - private static final long serialVersionUID = -3366954463322356334L; + private static final long serialVersionUID = 2344447703630569514L; /** * Get MColumn from Cache @@ -150,6 +150,7 @@ public class MColumn extends X_AD_Column if (columnName.equals("AD_Client_ID") || columnName.equals("AD_Org_ID") || columnName.equals("IsActive") + || columnName.equals("Processing") || columnName.equals("Created") || columnName.equals("CreatedBy") || columnName.equals("Updated") @@ -159,6 +160,14 @@ public class MColumn extends X_AD_Column return false; } // isStandardColumn + /** + * Is UUID Column + * @return true for UUID column + */ + public boolean isUUIDColumn() { + return getColumnName().equals(PO.getUUIDColumnName(getAD_Table().getTableName())); + } + /** * Is Virtual Column * @return true if virtual column @@ -273,17 +282,18 @@ public class MColumn extends X_AD_Column if (isAlwaysUpdateable() && !isUpdateable()) setIsAlwaysUpdateable(false); // Encrypted + String colname = getColumnName(); if (isEncrypted()) { int dt = getAD_Reference_ID(); if (isKey() || isParent() || isStandardColumn() - || isVirtualColumn() || isIdentifier() || isTranslated() + || isVirtualColumn() || isIdentifier() || isTranslated() || isUUIDColumn() || DisplayType.isLookup(dt) || DisplayType.isLOB(dt) - || "DocumentNo".equalsIgnoreCase(getColumnName()) - || "Value".equalsIgnoreCase(getColumnName()) - || "Name".equalsIgnoreCase(getColumnName())) + || "DocumentNo".equalsIgnoreCase(colname) + || "Value".equalsIgnoreCase(colname) + || "Name".equalsIgnoreCase(colname)) { - log.warning("Encryption not sensible - " + getColumnName()); + log.warning("Encryption not sensible - " + colname); setIsEncrypted(false); } } @@ -300,11 +310,10 @@ public class MColumn extends X_AD_Column } // Validations for IsAllowCopy - some columns must never be set as allowed copying - String colname = getColumnName(); if (isAllowCopy()) { if ( isKey() - || getColumnSQL() != null - || colname.equals(PO.getUUIDColumnName(getAD_Table().getTableName())) + || isVirtualColumn() + || isUUIDColumn() || isStandardColumn() ) setIsAllowCopy(false); diff --git a/org.adempiere.base/src/org/compiere/model/MField.java b/org.adempiere.base/src/org/compiere/model/MField.java index a2d1406d75..2d96f83065 100644 --- a/org.adempiere.base/src/org/compiere/model/MField.java +++ b/org.adempiere.base/src/org/compiere/model/MField.java @@ -132,12 +132,17 @@ public class MField extends X_AD_Field if (getIsAllowCopy() != null) { MColumn column = (MColumn) getAD_Column(); if ( column.isKey() - || column.getColumnSQL() != null - || column.isStandardColumn() + || column.isVirtualColumn() + || column.isUUIDColumn() + || (column.isStandardColumn() && !column.getColumnName().equals("AD_Org_ID")) // AD_Org_ID can be copied ) setIsAllowCopy(null); } - + if (getIsAllowCopy() == null) { // IDEMPIERE-67 + // By default allow copy of AD_Org_ID overwriting value + if (getAD_Column().getColumnName().equals("AD_Org_ID")) // AD_Org_ID can be copied + setIsAllowCopy("Y"); + } return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java b/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java index 728a6fa5f3..3a8a5335c5 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java @@ -70,7 +70,7 @@ public class MRequestUpdate extends X_R_RequestUpdate // for (final MColumn col : MTable.get(getCtx(), Table_ID).getColumns(false)) { - if (col.isStandardColumn() || col.isKey() || col.isParent()) + if (col.isStandardColumn() || col.isKey() || col.isParent() || col.isUUIDColumn() || col.isVirtualColumn()) continue; final String columnName = col.getColumnName(); final int i = parent.get_ColumnIndex(columnName); diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 5366df5418..8f89a4aa14 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -1232,9 +1232,14 @@ public abstract class PO { for (int i1 = 0; i1 < from.m_oldValues.length; i1++) { - if (! from.p_info.isAllowCopy(i1)) - continue; String colName = from.p_info.getColumnName(i1); + MColumn column = MColumn.get(from.getCtx(), from.p_info.getAD_Column_ID(colName)); + if ( column.isVirtualColumn() + || column.isKey() // KeyColumn + || column.isUUIDColumn() // IDEMPIERE-67 + || column.isStandardColumn() + || ! column.isAllowCopy()) + continue; for (int i2 = 0; i2 < to.m_oldValues.length; i2++) { if (to.p_info.getColumnName(i2).equals(colName)) @@ -1249,7 +1254,13 @@ public abstract class PO { for (int i = 0; i < from.m_oldValues.length; i++) { - if (! from.p_info.isAllowCopy(i)) + String colName = from.p_info.getColumnName(i); + MColumn column = MColumn.get(from.getCtx(), from.p_info.getAD_Column_ID(colName)); + if ( column.isVirtualColumn() + || column.isKey() // KeyColumn + || column.isUUIDColumn() + || column.isStandardColumn() + || ! column.isAllowCopy()) continue; to.m_newValues[i] = from.m_oldValues[i]; } From 09a39bab525af4e3a21cce6df4abef70552de8e1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Jun 2013 19:16:30 -0500 Subject: [PATCH 7/9] IDEMPIERE-893 Use AD_InfoWindow_Access instead of DPViews for access to info windows / Based on patch from Juliana Corredor --- .../oracle/20130617121500_IDEMPIERE-893.sql | 100 ++++++++++++++++++ .../20130617121500_IDEMPIERE-893.sql | 100 ++++++++++++++++++ .../src/org/compiere/model/MInfoWindow.java | 12 ++- .../swingclient.product.launch | 2 +- .../src/org/adempiere/webui/apps/AEnv.java | 46 -------- .../adempiere/webui/dashboard/DPViews.java | 57 +++++----- 6 files changed, 242 insertions(+), 75 deletions(-) create mode 100644 migration/i1.0b-release/oracle/20130617121500_IDEMPIERE-893.sql create mode 100644 migration/i1.0b-release/postgresql/20130617121500_IDEMPIERE-893.sql diff --git a/migration/i1.0b-release/oracle/20130617121500_IDEMPIERE-893.sql b/migration/i1.0b-release/oracle/20130617121500_IDEMPIERE-893.sql new file mode 100644 index 0000000000..98093e6445 --- /dev/null +++ b/migration/i1.0b-release/oracle/20130617121500_IDEMPIERE-893.sql @@ -0,0 +1,100 @@ +-- Jun 14, 2013 6:22:47 PM COT +-- IDEMPIERE-893 Use AD_InfoWindow_Access instead of DPViews for access to info windows +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:22:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176 +; + +-- Jun 14, 2013 6:22:57 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:22:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170 +; + +-- Jun 14, 2013 6:23:06 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:23:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169 +; + +-- Jun 14, 2013 6:23:17 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:23:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172 +; + +-- Jun 14, 2013 6:23:27 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50173 +; + +-- Jun 14, 2013 6:23:37 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:23:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174 +; + +-- Jun 14, 2013 6:23:50 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:23:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50175 +; + +-- Jun 14, 2013 6:24:04 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_DATE('2013-06-14 18:24:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50177 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=300, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50178 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=310, AD_FieldGroup_ID=50000, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=320, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=330, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174 +; + +-- Jun 17, 2013 6:34:25 PM COT +UPDATE AD_Field SET SeqNo=350, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-17 18:34:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172 +; + +-- Jun 17, 2013 6:34:25 PM COT +UPDATE AD_Field SET SeqNo=370, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-17 18:34:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169 +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_asset='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='A_Asset')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_bpartner='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_BPartner')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_inout='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='M_InOut')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_invoice='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_Invoice')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_order='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_Order')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_payment='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_Payment')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_product='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='M_Product')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_resource='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='S_ResourceAssignment')) +; + +SELECT register_migration_script('20130617121500_IDEMPIERE-893.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/20130617121500_IDEMPIERE-893.sql b/migration/i1.0b-release/postgresql/20130617121500_IDEMPIERE-893.sql new file mode 100644 index 0000000000..56e34db1af --- /dev/null +++ b/migration/i1.0b-release/postgresql/20130617121500_IDEMPIERE-893.sql @@ -0,0 +1,100 @@ +-- Jun 14, 2013 6:22:47 PM COT +-- IDEMPIERE-893 Use AD_InfoWindow_Access instead of DPViews for access to info windows +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:22:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176 +; + +-- Jun 14, 2013 6:22:57 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:22:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170 +; + +-- Jun 14, 2013 6:23:06 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:23:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169 +; + +-- Jun 14, 2013 6:23:17 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:23:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172 +; + +-- Jun 14, 2013 6:23:27 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50173 +; + +-- Jun 14, 2013 6:23:37 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:23:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174 +; + +-- Jun 14, 2013 6:23:50 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:23:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50175 +; + +-- Jun 14, 2013 6:24:04 PM COT +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N & @#UIClient@=''swing''',Updated=TO_TIMESTAMP('2013-06-14 18:24:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50177 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=300, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50178 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=310, AD_FieldGroup_ID=50000, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=320, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170 +; + +-- Jun 17, 2013 6:34:24 PM COT +UPDATE AD_Field SET SeqNo=330, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-17 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174 +; + +-- Jun 17, 2013 6:34:25 PM COT +UPDATE AD_Field SET SeqNo=350, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-17 18:34:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172 +; + +-- Jun 17, 2013 6:34:25 PM COT +UPDATE AD_Field SET SeqNo=370, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-17 18:34:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169 +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_asset='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='A_Asset')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_bpartner='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_BPartner')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_inout='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='M_InOut')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_invoice='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_Invoice')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_order='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_Order')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_payment='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='C_Payment')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_product='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='M_Product')) +; + +update ad_infowindow_access set isactive='N' +where ad_role_id in (select ad_role_id from ad_role where allow_info_resource='N') +and ad_infowindow_id in (select ad_infowindow_id from ad_infowindow where ad_table_id=(select ad_table_id from ad_table where tablename='S_ResourceAssignment')) +; + +SELECT register_migration_script('20130617121500_IDEMPIERE-893.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java index 54c0e7ed07..731dfbbc2f 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java @@ -59,14 +59,20 @@ public class MInfoWindow extends X_AD_InfoWindow } // MInfoWindow public static MInfoWindow get(String tableName, String trxName) { - Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), I_AD_InfoWindow.Table_ID), I_AD_InfoWindow.COLUMNNAME_AD_Table_ID+"=? AND IsValid='Y' ", null); + Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), MInfoWindow.Table_ID), MInfoWindow.COLUMNNAME_AD_Table_ID+"=? AND IsValid='Y' ", null); MTable table = MTable.get(Env.getCtx(), tableName); if (table != null) { - return query.setParameters(table.getAD_Table_ID()) + List iws = query.setParameters(table.getAD_Table_ID()) .setOrderBy("AD_Client_ID Desc, AD_Org_ID Desc, IsDefault Desc, AD_InfoWindow_ID Desc") .setOnlyActiveRecords(true) .setApplyAccessFilter(true) - .first(); + .list(); + // verify role has access and return the first with access / IDEMPIERE-893 + for (MInfoWindow iw : iws) { + Boolean access = MRole.getDefault().getInfoAccess(iw.getAD_InfoWindow_ID()); + if (access != null && access.booleanValue()) + return iw; + } } return null; } diff --git a/org.adempiere.ui.swing-feature/swingclient.product.launch b/org.adempiere.ui.swing-feature/swingclient.product.launch index 9f914eb8d8..313c7257a4 100644 --- a/org.adempiere.ui.swing-feature/swingclient.product.launch +++ b/org.adempiere.ui.swing-feature/swingclient.product.launch @@ -21,7 +21,7 @@ - + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java index da460d60b6..9275a4abfe 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java @@ -369,52 +369,6 @@ public final class AEnv CacheMgt.get().reset(tableName, Record_ID); } // cacheReset - /** - * Validate permissions to access Info queries on the view menu - * @author kstan_79 - * @return true if access is allowed - */ - - public static boolean canAccessInfo(String infoWindowName) - { - boolean result=false; - int roleid= Env.getAD_Role_ID(Env.getCtx()); - String sqlRolePermission="Select COUNT(AD_ROLE_ID) AS ROWCOUNT FROM AD_ROLE WHERE AD_ROLE_ID=" + roleid - + " AND ALLOW_INFO_" + infoWindowName + "='Y'"; - - log.config(sqlRolePermission); - PreparedStatement prolestmt = null; - ResultSet rs = null; - try - { - prolestmt = DB.prepareStatement (sqlRolePermission, null); - - rs = prolestmt.executeQuery (); - - rs.next(); - - if (rs.getInt("ROWCOUNT")>0) - { - result=true; - } - else - { - return false; - } - } - catch (Exception e) - { - log.log(Level.SEVERE, "(1)", e); - } - finally - { - DB.close(rs, prolestmt); - } - - return result; - - } // canAccessInfo - public static void actionRefresh(Lookup lookup, Object value, boolean mandatory, boolean shortList) // IDEMPIERE 90 { if (lookup == null) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java index b0060905fa..cfe9abef94 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java @@ -19,6 +19,15 @@ import org.adempiere.webui.component.Window; import org.adempiere.webui.panel.InfoPanel; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.window.InfoSchedule; +import org.compiere.model.I_A_Asset; +import org.compiere.model.I_C_BPartner; +import org.compiere.model.I_C_Invoice; +import org.compiere.model.I_C_Order; +import org.compiere.model.I_C_Payment; +import org.compiere.model.I_M_InOut; +import org.compiere.model.I_M_Product; +import org.compiere.model.I_S_ResourceAssignment; +import org.compiere.model.MInfoWindow; import org.compiere.model.MRole; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -53,8 +62,8 @@ public class DPViews extends DashboardPanel implements EventListener { private Box createViewPanel() { Vbox vbox = new Vbox(); - - if (MRole.getDefault().isAllow_Info_Product()) + + if (MInfoWindow.get(I_M_Product.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoProduct"); btnViewItem.setSclass("link"); @@ -63,7 +72,7 @@ public class DPViews extends DashboardPanel implements EventListener { btnViewItem.addEventListener(Events.ON_CLICK, this); vbox.appendChild(btnViewItem); } - if (MRole.getDefault().isAllow_Info_BPartner()) + if (MInfoWindow.get(I_C_BPartner.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoBPartner"); btnViewItem.setSclass("link"); @@ -91,7 +100,7 @@ public class DPViews extends DashboardPanel implements EventListener { vbox.appendChild(btnViewItem); } vbox.appendChild(new Separator("horizontal")); - if (MRole.getDefault().isAllow_Info_Order()) + if (MInfoWindow.get(I_C_Order.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoOrder"); btnViewItem.setSclass("link"); @@ -100,7 +109,7 @@ public class DPViews extends DashboardPanel implements EventListener { btnViewItem.addEventListener(Events.ON_CLICK, this); vbox.appendChild(btnViewItem); } - if (MRole.getDefault().isAllow_Info_Invoice()) + if (MInfoWindow.get(I_C_Invoice.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoInvoice"); btnViewItem.setSclass("link"); @@ -109,7 +118,7 @@ public class DPViews extends DashboardPanel implements EventListener { btnViewItem.addEventListener(Events.ON_CLICK, this); vbox.appendChild(btnViewItem); } - if (MRole.getDefault().isAllow_Info_InOut()) + if (MInfoWindow.get(I_M_InOut.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoInOut"); btnViewItem.setSclass("link"); @@ -118,7 +127,7 @@ public class DPViews extends DashboardPanel implements EventListener { btnViewItem.addEventListener(Events.ON_CLICK, this); vbox.appendChild(btnViewItem); } - if (MRole.getDefault().isAllow_Info_Payment()) + if (MInfoWindow.get(I_C_Payment.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoPayment"); btnViewItem.setSclass("link"); @@ -135,7 +144,7 @@ public class DPViews extends DashboardPanel implements EventListener { // btnViewItem.addEventListener(Events.ON_CLICK, this); // vbox.appendChild(btnViewItem); // } - if (MRole.getDefault().isAllow_Info_Resource()) + if (MInfoWindow.get(I_S_ResourceAssignment.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoAssignment"); btnViewItem.setSclass("link"); @@ -144,7 +153,7 @@ public class DPViews extends DashboardPanel implements EventListener { btnViewItem.addEventListener(Events.ON_CLICK, this); vbox.appendChild(btnViewItem); } - if (MRole.getDefault().isAllow_Info_Asset()) + if (MInfoWindow.get(I_A_Asset.Table_Name, null) != null) { ToolBarButton btnViewItem = new ToolBarButton("InfoAsset"); btnViewItem.setSclass("link"); @@ -170,51 +179,49 @@ public class DPViews extends DashboardPanel implements EventListener { String actionCommand = btn.getName(); int WindowNo = 0; - if (actionCommand.equals("InfoProduct") && AEnv.canAccessInfo("PRODUCT")) + if (actionCommand.equals("InfoProduct")) { InfoPanel.showProduct(WindowNo); } - else if (actionCommand.equals("InfoBPartner") && AEnv.canAccessInfo("BPARTNER")) + else if (actionCommand.equals("InfoBPartner")) { InfoPanel.showBPartner(WindowNo); } - else if (actionCommand.equals("InfoAsset") && AEnv.canAccessInfo("ASSET")) + else if (actionCommand.equals("InfoAsset")) { InfoPanel.showAsset(WindowNo); } - else if (actionCommand.equals("InfoAccount") && - MRole.getDefault().isShowAcct() && - AEnv.canAccessInfo("ACCOUNT")) + else if (actionCommand.equals("InfoAccount")) { new org.adempiere.webui.acct.WAcctViewer(); } - else if (actionCommand.equals("InfoSchedule") && AEnv.canAccessInfo("SCHEDULE")) + else if (actionCommand.equals("InfoSchedule")) { InfoSchedule is = new InfoSchedule(null, false); is.setAttribute(Window.MODE_KEY, Mode.EMBEDDED); AEnv.showWindow(is); } - else if (actionCommand.equals("InfoOrder") && AEnv.canAccessInfo("ORDER")) + else if (actionCommand.equals("InfoOrder")) { InfoPanel.showOrder(WindowNo, ""); } - else if (actionCommand.equals("InfoInvoice") && AEnv.canAccessInfo("INVOICE")) + else if (actionCommand.equals("InfoInvoice")) { InfoPanel.showInvoice(WindowNo, ""); } - else if (actionCommand.equals("InfoInOut") && AEnv.canAccessInfo("INOUT")) + else if (actionCommand.equals("InfoInOut")) { InfoPanel.showInOut(WindowNo, ""); } - else if (actionCommand.equals("InfoPayment") && AEnv.canAccessInfo("PAYMENT")) + else if (actionCommand.equals("InfoPayment")) { InfoPanel.showPayment(WindowNo, ""); } - else if (actionCommand.equals("InfoCashLine") && AEnv.canAccessInfo("CASHJOURNAL")) - { - InfoPanel.showCashLine(WindowNo, ""); - } - else if (actionCommand.equals("InfoAssignment") && AEnv.canAccessInfo("RESOURCE")) +// else if (actionCommand.equals("InfoCashLine")) +// { +// InfoPanel.showCashLine(WindowNo, ""); +// } + else if (actionCommand.equals("InfoAssignment")) { InfoPanel.showAssignment(WindowNo, ""); } From 9b499fd67e33ed5c2c26a9d9bb6d2eea5b7aa271 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Jun 2013 19:31:04 -0500 Subject: [PATCH 8/9] IDEMPIERE-1063 Performance of AcctProcessor can be improved with some indexes --- .../oracle/201306171929_IDEMPIERE-1063.sql | 51 +++++++++++++++++++ .../201306171929_IDEMPIERE-1063.sql | 51 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 migration/i1.0b-release/oracle/201306171929_IDEMPIERE-1063.sql create mode 100644 migration/i1.0b-release/postgresql/201306171929_IDEMPIERE-1063.sql diff --git a/migration/i1.0b-release/oracle/201306171929_IDEMPIERE-1063.sql b/migration/i1.0b-release/oracle/201306171929_IDEMPIERE-1063.sql new file mode 100644 index 0000000000..ff5d91e242 --- /dev/null +++ b/migration/i1.0b-release/oracle/201306171929_IDEMPIERE-1063.sql @@ -0,0 +1,51 @@ +/*********** IDEMPIERE-1063 AcctProcessor Performance indexes **************/ + +drop index c_invoice_paid; + +create index c_invoice_paid on c_invoice (ispaid, ad_client_id); + +drop index c_order_processed; + +create index c_order_processed on c_order (processed, ad_client_id); + +create index idxc_allocationhdr_proc_on on c_allocationhdr (posted, processed, processedon, ad_client_id); + +create index idxc_bankstatement_proc_on on c_bankstatement (posted, processed, processedon, ad_client_id); + +create index idxc_cash_proc_on on c_cash (posted, processed, processedon, ad_client_id); + +create index idxc_invoice_proc_on on c_invoice (posted, processed, processedon, ad_client_id); + +create index idxc_order_proc_on on c_order (posted, processed, processedon, ad_client_id); + +create index idxc_payment_proc_on on c_payment (posted, processed, processedon, ad_client_id); + +create index idxc_projectissue_proc_on on c_projectissue (posted, processed, processedon, ad_client_id); + +create index idxdd_order_proc_on on dd_order (posted, processed, processedon, ad_client_id); + +create index idxgl_journal_proc_on on gl_journal (posted, processed, processedon, ad_client_id); + +create index idxhr_process_proc_on on hr_process (posted, processed, processedon, ad_client_id); + +create index idxm_inout_proc_on on m_inout (posted, processed, processedon, ad_client_id); + +create index idxm_inventory_proc_on on m_inventory (posted, processed, processedon, ad_client_id); + +create index idxm_matchinv_proc_on on m_matchinv (posted, processed, processedon, ad_client_id); + +create index idxm_matchpo_proc_on on m_matchpo (posted, processed, processedon, ad_client_id); + +create index idxm_movement_proc_on on m_movement (posted, processed, processedon, ad_client_id); + +create index idxm_production_proc_on on m_production (posted, processed, processedon, ad_client_id); + +create index idxm_requisition_proc_on on m_requisition (posted, processed, processedon, ad_client_id); + +create index idxpp_cost_collector_proc_on on pp_cost_collector (posted, processed, processedon, ad_client_id); + +create index idxpp_order_proc_on on pp_order (posted, processed, processedon, ad_client_id); + +SELECT register_migration_script('201306171929_IDEMPIERE-1063.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/201306171929_IDEMPIERE-1063.sql b/migration/i1.0b-release/postgresql/201306171929_IDEMPIERE-1063.sql new file mode 100644 index 0000000000..ff5d91e242 --- /dev/null +++ b/migration/i1.0b-release/postgresql/201306171929_IDEMPIERE-1063.sql @@ -0,0 +1,51 @@ +/*********** IDEMPIERE-1063 AcctProcessor Performance indexes **************/ + +drop index c_invoice_paid; + +create index c_invoice_paid on c_invoice (ispaid, ad_client_id); + +drop index c_order_processed; + +create index c_order_processed on c_order (processed, ad_client_id); + +create index idxc_allocationhdr_proc_on on c_allocationhdr (posted, processed, processedon, ad_client_id); + +create index idxc_bankstatement_proc_on on c_bankstatement (posted, processed, processedon, ad_client_id); + +create index idxc_cash_proc_on on c_cash (posted, processed, processedon, ad_client_id); + +create index idxc_invoice_proc_on on c_invoice (posted, processed, processedon, ad_client_id); + +create index idxc_order_proc_on on c_order (posted, processed, processedon, ad_client_id); + +create index idxc_payment_proc_on on c_payment (posted, processed, processedon, ad_client_id); + +create index idxc_projectissue_proc_on on c_projectissue (posted, processed, processedon, ad_client_id); + +create index idxdd_order_proc_on on dd_order (posted, processed, processedon, ad_client_id); + +create index idxgl_journal_proc_on on gl_journal (posted, processed, processedon, ad_client_id); + +create index idxhr_process_proc_on on hr_process (posted, processed, processedon, ad_client_id); + +create index idxm_inout_proc_on on m_inout (posted, processed, processedon, ad_client_id); + +create index idxm_inventory_proc_on on m_inventory (posted, processed, processedon, ad_client_id); + +create index idxm_matchinv_proc_on on m_matchinv (posted, processed, processedon, ad_client_id); + +create index idxm_matchpo_proc_on on m_matchpo (posted, processed, processedon, ad_client_id); + +create index idxm_movement_proc_on on m_movement (posted, processed, processedon, ad_client_id); + +create index idxm_production_proc_on on m_production (posted, processed, processedon, ad_client_id); + +create index idxm_requisition_proc_on on m_requisition (posted, processed, processedon, ad_client_id); + +create index idxpp_cost_collector_proc_on on pp_cost_collector (posted, processed, processedon, ad_client_id); + +create index idxpp_order_proc_on on pp_order (posted, processed, processedon, ad_client_id); + +SELECT register_migration_script('201306171929_IDEMPIERE-1063.sql') FROM dual +; + From 465286b73e4f96384297ab6b01080bb87566c4e5 Mon Sep 17 00:00:00 2001 From: Richard Morales Date: Mon, 17 Jun 2013 19:37:31 -0500 Subject: [PATCH 9/9] IDEMPIERE-1049 Not able to close Print format Window --- .../WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java index 83e348ad01..eff06c109e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java @@ -459,7 +459,9 @@ public class ADSortTab extends Panel implements IADTabpanel rs = null; pstmt = null; } - setIsChanged(false); + if (!gridTab.getParentTab().needSave(true, true)) + setIsChanged(false); + bAdd.setEnabled(isReadWrite); bRemove.setEnabled(isReadWrite); bUp.setEnabled(isReadWrite);