hg merge release-2.1 (merge release2.1 into development)

This commit is contained in:
Carlos Ruiz 2015-03-14 08:14:39 -05:00
commit 3a53bbcc32
18 changed files with 239 additions and 31 deletions

View File

@ -1,12 +1,12 @@
CREATE OR REPLACE VIEW ad_sessioninfo_v AS
SELECT s.ad_session_id,0 as ad_client_id,0 as ad_org_id, s.isactive,
s.created, s.createdby, s.updated, s.updatedby, s.websession,
s.remote_addr, s.remote_host, r.name as roleName, s.logindate, s.ad_session_uu,
s.servername, c.name AS ClientName,o.name as orgName,s.ad_session_id as ad_sessioninfo_v_id,
s.ad_session_uu as ad_sessioninfo_v_uu,u.name as LoginName,u.email as email
SELECT s.ad_session_id,0 as ad_client_id,0 as ad_org_id, s.isactive,
s.created, s.createdby, s.updated, s.updatedby, substr(s.websession,1,40) as websession,
substr(s.remote_addr,1,60) as remote_addr, substr(s.remote_host,1,120) as remote_host, substr(r.name,1,60) as roleName, s.logindate, s.ad_session_uu,
substr(s.servername,1,80) as servername, substr(c.name,1,60) AS ClientName,substr(o.name,1,60) as orgName,s.ad_session_id as ad_sessioninfo_v_id,
s.ad_session_uu as ad_sessioninfo_v_uu,substr(u.name,1,60) as LoginName,substr(u.email,1,60) as email
FROM ad_session s
inner join AD_User u on (s.createdby = u.AD_User_ID)
left join AD_Role r on (s.ad_role_id=r.ad_role_id)
inner join AD_Client c on (s.ad_client_id=c.ad_client_id)
left join AD_Org o on (s.ad_org_id=o.ad_org_id)
WHERE s.processed = 'N';
WHERE s.processed = 'N';

View File

@ -1,13 +1,13 @@
drop view ad_sessioninfo_v;
CREATE OR REPLACE VIEW ad_sessioninfo_v AS
SELECT s.ad_session_id, 0::numeric(10,0) AS ad_client_id, 0::numeric(10,0) AS ad_org_id, s.isactive,
s.created, s.createdby, s.updated, s.updatedby, s.websession,
s.remote_addr, s.remote_host, r.name as roleName, s.logindate, s.ad_session_uu,
s.servername, c.name AS ClientName,o.name as orgName,s.ad_session_id as ad_sessioninfo_v_id,
s.ad_session_uu as ad_sessioninfo_v_uu,u.name as LoginName,u.email as email
SELECT s.ad_session_id, 0::numeric(10,0) AS ad_client_id, 0::numeric(10,0) AS ad_org_id, s.isactive,
s.created, s.createdby, s.updated, s.updatedby, substr(s.websession,1,40) as websession,
substr(s.remote_addr,1,60) as remote_addr, substr(s.remote_host,1,120) as remote_host, substr(r.name,1,60) as roleName, s.logindate, s.ad_session_uu,
substr(s.servername,1,80) as servername, substr(c.name,1,60) AS ClientName,substr(o.name,1,60) as orgName,s.ad_session_id as ad_sessioninfo_v_id,
s.ad_session_uu as ad_sessioninfo_v_uu,substr(u.name,1,60) as LoginName,substr(u.email,1,60) as email
FROM ad_session s
inner join AD_User u on (s.createdby = u.AD_User_ID)
left join AD_Role r on (s.ad_role_id=r.ad_role_id)
inner join AD_Client c on (s.ad_client_id=c.ad_client_id)
left join AD_Org o on (s.ad_org_id=o.ad_org_id)
WHERE s.processed = 'N'::bpchar;
WHERE s.processed = 'N'::bpchar;

View File

@ -0,0 +1,25 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-2440
-- Mar 11, 2015 9:43:16 AM COT
UPDATE AD_Column SET FieldLength=60,Updated=TO_DATE('2015-03-11 09:43:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200702
;
CREATE OR REPLACE VIEW ad_sessioninfo_v AS
SELECT s.ad_session_id,0 as ad_client_id,0 as ad_org_id, s.isactive,
s.created, s.createdby, s.updated, s.updatedby, substr(s.websession,1,40) as websession,
substr(s.remote_addr,1,60) as remote_addr, substr(s.remote_host,1,120) as remote_host, substr(r.name,1,60) as roleName, s.logindate, s.ad_session_uu,
substr(s.servername,1,80) as servername, substr(c.name,1,60) AS ClientName,substr(o.name,1,60) as orgName,s.ad_session_id as ad_sessioninfo_v_id,
s.ad_session_uu as ad_sessioninfo_v_uu,substr(u.name,1,60) as LoginName,substr(u.email,1,60) as email
FROM ad_session s
inner join AD_User u on (s.createdby = u.AD_User_ID)
left join AD_Role r on (s.ad_role_id=r.ad_role_id)
inner join AD_Client c on (s.ad_client_id=c.ad_client_id)
left join AD_Org o on (s.ad_org_id=o.ad_org_id)
WHERE s.processed = 'N'
;
SELECT register_migration_script('201503110943_IDEMPIERE-2440.sql') FROM dual
;

View File

@ -0,0 +1,26 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 11, 2015 10:13:08 AM CET
-- IDEMPIERE-2509 ResetLockedAccount messages are hardcoded
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200331,'2483519c-32fb-496d-86d0-55b59ec42939',0,TO_DATE('2015-03-11 10:13:07','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','User {0} is not locked','I',TO_DATE('2015-03-11 10:13:07','YYYY-MM-DD HH24:MI:SS'),100,'UserIsNotLocked')
;
-- Mar 11, 2015 10:13:29 AM CET
UPDATE AD_Message SET EntityType='D',Updated=TO_DATE('2015-03-11 10:13:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200331
;
-- Mar 11, 2015 10:13:41 AM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200332,'04e54944-1af1-4d0c-89a6-0240201e529e',0,TO_DATE('2015-03-11 10:13:41','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Could not unlock user account','I',TO_DATE('2015-03-11 10:13:41','YYYY-MM-DD HH24:MI:SS'),100,'CouldNotUnlockAccount')
;
-- Mar 11, 2015 10:14:11 AM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200333,'a84c1b33-f127-4b3b-a526-a2fd35efafa7',0,TO_DATE('2015-03-11 10:14:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','The user {0} has been unlocked','I',TO_DATE('2015-03-11 10:14:11','YYYY-MM-DD HH24:MI:SS'),100,'UserUnlocked')
;
-- Mar 11, 2015 10:14:23 AM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200334,'9857d80f-65fd-465b-98ec-398644fd93cf',0,TO_DATE('2015-03-11 10:14:22','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','locked account has been reset','I',TO_DATE('2015-03-11 10:14:22','YYYY-MM-DD HH24:MI:SS'),100,'LockedAccountResetted')
;
SELECT register_migration_script('201503111036_IDEMPIERE-2509.sql') FROM dual
;

View File

@ -0,0 +1,24 @@
-- IDEMPIERE-2440
-- Mar 11, 2015 9:43:16 AM COT
UPDATE AD_Column SET FieldLength=60,Updated=TO_TIMESTAMP('2015-03-11 09:43:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200702
;
DROP VIEW ad_sessioninfo_v;
CREATE OR REPLACE VIEW ad_sessioninfo_v AS
SELECT s.ad_session_id, 0::numeric(10,0) AS ad_client_id, 0::numeric(10,0) AS ad_org_id, s.isactive,
s.created, s.createdby, s.updated, s.updatedby, substr(s.websession,1,40) as websession,
substr(s.remote_addr,1,60) as remote_addr, substr(s.remote_host,1,120) as remote_host, substr(r.name,1,60) as roleName, s.logindate, s.ad_session_uu,
substr(s.servername,1,80) as servername, substr(c.name,1,60) AS ClientName,substr(o.name,1,60) as orgName,s.ad_session_id as ad_sessioninfo_v_id,
s.ad_session_uu as ad_sessioninfo_v_uu,substr(u.name,1,60) as LoginName,substr(u.email,1,60) as email
FROM ad_session s
inner join AD_User u on (s.createdby = u.AD_User_ID)
left join AD_Role r on (s.ad_role_id=r.ad_role_id)
inner join AD_Client c on (s.ad_client_id=c.ad_client_id)
left join AD_Org o on (s.ad_org_id=o.ad_org_id)
WHERE s.processed = 'N'::bpchar
;
SELECT register_migration_script('201503110943_IDEMPIERE-2440.sql') FROM dual
;

View File

@ -0,0 +1,23 @@
-- Mar 11, 2015 10:13:08 AM CET
-- IDEMPIERE-2509 ResetLockedAccount messages are hardcoded
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200331,'2483519c-32fb-496d-86d0-55b59ec42939',0,TO_TIMESTAMP('2015-03-11 10:13:07','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','User {0} is not locked','I',TO_TIMESTAMP('2015-03-11 10:13:07','YYYY-MM-DD HH24:MI:SS'),100,'UserIsNotLocked')
;
-- Mar 11, 2015 10:13:29 AM CET
UPDATE AD_Message SET EntityType='D',Updated=TO_TIMESTAMP('2015-03-11 10:13:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200331
;
-- Mar 11, 2015 10:13:41 AM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200332,'04e54944-1af1-4d0c-89a6-0240201e529e',0,TO_TIMESTAMP('2015-03-11 10:13:41','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Could not unlock user account','I',TO_TIMESTAMP('2015-03-11 10:13:41','YYYY-MM-DD HH24:MI:SS'),100,'CouldNotUnlockAccount')
;
-- Mar 11, 2015 10:14:11 AM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200333,'a84c1b33-f127-4b3b-a526-a2fd35efafa7',0,TO_TIMESTAMP('2015-03-11 10:14:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','The user {0} has been unlocked','I',TO_TIMESTAMP('2015-03-11 10:14:11','YYYY-MM-DD HH24:MI:SS'),100,'UserUnlocked')
;
-- Mar 11, 2015 10:14:23 AM CET
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200334,'9857d80f-65fd-465b-98ec-398644fd93cf',0,TO_TIMESTAMP('2015-03-11 10:14:22','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','locked account has been reset','I',TO_TIMESTAMP('2015-03-11 10:14:22','YYYY-MM-DD HH24:MI:SS'),100,'LockedAccountResetted')
;
SELECT register_migration_script('201503111036_IDEMPIERE-2509.sql') FROM dual
;

View File

@ -21,6 +21,7 @@ import java.sql.ResultSet;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.Adempiere;
import org.compiere.model.MClient;
import org.compiere.model.MSequence;
@ -79,6 +80,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log(Level.SEVERE, "validate", e);
throw new AdempiereException(e);
}
} // validate
@ -124,6 +126,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log(Level.SEVERE, sql, e);
throw new AdempiereException(e);
}
finally
{
@ -173,6 +176,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log (Level.SEVERE, sql, e);
throw new AdempiereException(e);
}
finally
{
@ -233,6 +237,7 @@ public class SequenceCheck extends SvrProcess
catch (Exception e)
{
s_log.log(Level.SEVERE, sql, e);
throw new AdempiereException(e);
}
finally
{

View File

@ -30,6 +30,7 @@ import org.adempiere.model.IShipmentProcessor;
import org.adempiere.model.ITaxProvider;
import org.adempiere.model.MShipperFacade;
import org.compiere.impexp.BankStatementLoaderInterface;
import org.compiere.impexp.BankStatementMatcherInterface;
import org.compiere.model.MAddressValidation;
import org.compiere.model.MBankAccountProcessor;
import org.compiere.model.MPaymentProcessor;
@ -203,13 +204,47 @@ public class Core {
}
if (myBankStatementLoader == null) {
s_log.log(Level.SEVERE, "Not found in service/extension registry and classpath");
s_log.log(Level.CONFIG, className + " not found in service/extension registry and classpath");
return null;
}
return myBankStatementLoader;
}
/**
* get BankStatementMatcher instance
*
* @param className
* @return instance of the BankStatementMatcherInterface or null
*/
public static BankStatementMatcherInterface getBankStatementMatcher(String className){
if (className == null || className.length() == 0) {
s_log.log(Level.SEVERE, "No BankStatementMatcherInterface class name");
return null;
}
BankStatementMatcherInterface myBankStatementMatcher = null;
List<IBankStatementMatcherFactory> factoryList =
Service.locator().list(IBankStatementMatcherFactory.class).getServices();
if (factoryList != null) {
for(IBankStatementMatcherFactory factory : factoryList) {
BankStatementMatcherInterface matcher = factory.newBankStatementMatcherInstance(className);
if (matcher != null) {
myBankStatementMatcher = matcher;
break;
}
}
}
if (myBankStatementMatcher == null) {
s_log.log(Level.CONFIG, className + " not found in service/extension registry and classpath");
return null;
}
return myBankStatementMatcher;
}
/**
*
* @param sf

View File

@ -0,0 +1,34 @@
/******************************************************************************
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.base;
import org.compiere.impexp.BankStatementMatcherInterface;
/**
* Factory Interface for plugins to connect to the iDempiere core and provide a
* way to match Bank statements
*
* @author tsvikruha, inspired by tbayen IBankStatementLoaderFactory
*/
public interface IBankStatementMatcherFactory {
/**
* This class will be implemented in OSGi plugins. Every plugin that
* provides this service may or may not provide an BankStatementMatcher
* depending on the given classname. By convention this classname is
* the fully qualified classname of the Loader class you want to use.
*
* @param className
* @return BankStatementMatcher instance
*/
public BankStatementMatcherInterface newBankStatementMatcherInstance(String className);
}

View File

@ -9,6 +9,7 @@ import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
public class ResetLockedAccount extends SvrProcess {
@ -45,7 +46,7 @@ public class ResetLockedAccount extends SvrProcess {
MUser user = new MUser(getCtx(), p_AD_User_ID, null);
if (!user.isLocked())
throw new AdempiereException("User " + user.getName() + " is not locked");
throw new AdempiereException(Msg.getMsg(getCtx(), "UserIsNotLocked", new Object[] {user.getName()}));
StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, Updated=SysDate ")
.append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ")
@ -53,9 +54,9 @@ public class ResetLockedAccount extends SvrProcess {
.append(" AND AD_User_ID = " + user.getAD_User_ID());
int no = DB.executeUpdate(sql.toString(), new Object[] { p_AD_Client_ID }, false, get_TrxName());
if (no <= 0)
throw new AdempiereException("Could not unlock user account" + user.toString());
throw new AdempiereException(Msg.getMsg(getCtx(), "CouldNotUnlockAccount") + user.toString());
StringBuilder msgreturn = new StringBuilder("@OK@ - The user '").append(user.getName()).append("' has been unlocked");
StringBuilder msgreturn = new StringBuilder(Msg.getMsg(getCtx(), "ProcessOK")).append(" - ").append(Msg.getMsg(getCtx(), "UserUnlocked", new Object[] {user.getName()}));
return msgreturn.toString();
}
else
@ -84,9 +85,9 @@ public class ResetLockedAccount extends SvrProcess {
int no = DB.executeUpdate(sql.toString(), p_AD_Client_ID, get_TrxName());
if (no < 0)
throw new AdempiereException("Could not unlock user account");
StringBuilder msgreturn = new StringBuilder().append(no).append(" locked account has been reset");
throw new AdempiereException(Msg.getMsg(getCtx(), "CouldNotUnlockAccount"));
StringBuilder msgreturn = new StringBuilder().append(no).append(" ").append(Msg.getMsg(getCtx(), "LockedAccountResetted"));
return msgreturn.toString();
}
}
}
}

View File

@ -38,6 +38,7 @@ import java.util.Properties;
import java.util.Vector;
import java.util.logging.Level;
import org.compiere.model.I_C_Payment;
import org.compiere.model.MColumn;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
@ -158,15 +159,20 @@ public abstract class AbstractDocumentSearch {
sqlSO.append(Env.parseContext(Env.getCtx(), -1, " AND AD_Client_ID=@#AD_Client_ID@", false, true));
if (msd.getPO_Window_ID() != 0) {
sqlPO = new StringBuilder(sqlSO.toString()).append(" AND IsSOTrx='N'");
sqlSO.append(" AND IsSOTrx='Y'");
sqlPO = new StringBuilder(sqlSO.toString());
String columntrx = "IsSOTrx";
if (I_C_Payment.Table_Name.equals(table.getTableName())) {
columntrx = "IsReceipt";
}
sqlPO.append(" AND ").append(columntrx).append("='N'");
sqlSO.append(" AND ").append(columntrx).append("='Y'");
pstmtPO = DB.prepareStatement(sqlPO.toString(), null);
}
pstmtSO = DB.prepareStatement(sqlSO.toString(), null);
pstmtPO = DB.prepareStatement(sqlPO.toString(), null);
// search for a Integer
if (msd.getDataType().equals(MSearchDefinition.DATATYPE_INTEGER)) {
pstmtSO.setInt(1, Integer.valueOf(searchString.replaceAll("\\D", "")));
if (msd.getPO_Window_ID() != 0) {
if (pstmtPO != null) {
pstmtPO.setInt(1, Integer.valueOf(searchString.replaceAll("\\D", "")));
}
// search for a String
@ -175,7 +181,7 @@ public abstract class AbstractDocumentSearch {
pstmtSO.setString(1, searchString);
else
pstmtSO.setString(1, searchString+"%");
if (msd.getPO_Window_ID() != 0) {
if (pstmtPO != null) {
if (searchString.endsWith("%"))
pstmtPO.setString(1, searchString);
else

View File

@ -30,6 +30,7 @@ import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.MimeType;
import org.compiere.util.Util;
/**
@ -489,6 +490,8 @@ public class MAttachment extends X_AD_Attachment
*/
protected boolean beforeSave (boolean newRecord)
{
if (Util.isEmpty(getTitle()))
setTitle(NONE);
return saveLOBData(); // save in BinaryData
} // beforeSave

View File

@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.base.Core;
import org.compiere.impexp.BankStatementMatcherInterface;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -134,8 +135,14 @@ public class MBankStatementMatcher extends X_C_BankStatementMatcher
try
{
Class<?> matcherClass = Class.forName(className);
m_matcher = (BankStatementMatcherInterface)matcherClass.newInstance();
if (log.isLoggable(Level.INFO)) log.info( "MBankStatementMatch Class Name=" + className);
// load the BankStatementMatcher class via OSGi Service definition from a plugin
m_matcher = Core.getBankStatementMatcher(className);
if(m_matcher==null){
// if no OSGi plugin is found try the legacy way (in my own classpath)
Class<?> bsrClass = Class.forName(className);
m_matcher = (BankStatementMatcherInterface) bsrClass.newInstance();
}
m_matcherValid = Boolean.TRUE;
}
catch (Exception e)

View File

@ -902,6 +902,7 @@ public class MSequence extends X_AD_Sequence
+ "FROM AD_Table t"
+ " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) "
+ "WHERE t.TableName='" + tableName + "'"
+ " AND t.IsView='N'" // ignore for views -- IDEMPIERE-2513
+ " AND c.ColumnName='" + tableName + "_ID'");
if (AD_Column_ID <= 0)
return null;

View File

@ -548,7 +548,6 @@ public class Login
+" INNER JOIN AD_Client c on (c.AD_Client_ID=?)"
+" WHERE o.IsActive='Y' "
+" AND o.AD_Client_ID IN (0, c.AD_Client_ID)"
+" AND o.IsSummary='N'"
+" AND (r.IsAccessAllOrgs='Y'"
+" OR (r.IsUseUserOrgAccess='N' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ra"
+" WHERE ra.AD_Role_ID=r.AD_Role_ID AND ra.IsActive='Y')) "

View File

@ -96,7 +96,7 @@ public class EntityTypeElementHandler extends AbstractElementHandler{
} else {
logImportDetail(ctx, impDetail, 0, m_EntityType.getName(),
m_EntityType.get_ID(), action);
throw new POSaveFailedException("Failed to save Model Validator " + m_EntityType.getName());
throw new POSaveFailedException("Failed to save Entity Type " + m_EntityType.getName());
}
}

View File

@ -97,6 +97,7 @@ public class DPActivitiesModel {
+ ") AND a.AD_Client_ID=?"; // #5
int AD_User_ID = Env.getAD_User_ID(Env.getCtx());
int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());
sql = MRole.getDefault().addAccessSQL(sql, "a", true, false);
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -16,12 +16,15 @@
*****************************************************************************/
package org.adempiere.webui.window;
import org.adempiere.util.ContextRunnable;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.compiere.Adempiere;
import org.compiere.print.ReportEngine;
import org.compiere.print.ReportViewerProvider;
import org.zkoss.zk.ui.Executions;
/**
*
@ -29,9 +32,9 @@ import org.compiere.print.ReportViewerProvider;
*
*/
public class ZkReportViewerProvider implements ReportViewerProvider {
public void openViewer(final ReportEngine report) {
Runnable runnable = new Runnable() {
final Runnable runnable = new Runnable() {
@Override
public void run() {
Window viewer = new ZkReportViewer(report, report.getName());
@ -42,6 +45,21 @@ public class ZkReportViewerProvider implements ReportViewerProvider {
SessionManager.getAppDesktop().showWindow(viewer);
}
};
AEnv.executeAsyncDesktopTask(runnable);
// IDEMPIERE-2499
// detect ui thread by value of Executions.getCurrent(), not office method but work
if (Executions.getCurrent() != null){
Adempiere.getThreadPoolExecutor().submit(new ContextRunnable(){
protected void doRun(){
// load layout, with big report it's heavy job, do in non ui thread to don't lock gui
report.getLayout();
AEnv.executeAsyncDesktopTask(runnable);
}
});
}else{
// load layout in non ui thread before run into ui thread
report.getLayout();
AEnv.executeAsyncDesktopTask(runnable);
}
}
}