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

This commit is contained in:
Carlos Ruiz 2015-02-26 21:45:32 -05:00
commit 458fd1282d
6 changed files with 67 additions and 14 deletions

View File

@ -0,0 +1,27 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-1800 Reset Locked Account shows all clients
-- Feb 26, 2015 7:56:16 PM COT
UPDATE AD_Process_Para SET AD_Val_Rule_ID=116, DefaultValue='@#AD_Client_ID@',Updated=TO_DATE('2015-02-26 19:56:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029
;
-- Feb 26, 2015 7:58:22 PM COT
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200067,'AD_User Locked of Client','S','AD_User.AD_Client_ID=@#AD_Client_ID@ AND IsLocked=''Y''',0,0,'Y',TO_DATE('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,'D','13699034-b9eb-493f-9156-2d6864f366d1')
;
-- Feb 26, 2015 7:58:33 PM COT
UPDATE AD_Process_Para SET AD_Val_Rule_ID=200067,Updated=TO_DATE('2015-02-26 19:58:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200030
;
-- Feb 26, 2015 7:58:42 PM COT
UPDATE AD_Process_Para SET IsActive='N',Updated=TO_DATE('2015-02-26 19:58:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029
;
-- Feb 26, 2015 8:21:57 PM COT
UPDATE AD_Process SET Help='Select a locked user from the list to unlock it. Alternatively you can run the process without selecting any user, in this case the process will unlock all locked users from the client applying accordingly the policies configured for "max account lock" and "max inactive period".',Updated=TO_DATE('2015-02-26 20:21:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=200008
;
SELECT register_migration_script('201502261959_IDEMPIERE-1800.sql') FROM dual
;

View File

@ -0,0 +1,24 @@
-- IDEMPIERE-1800 Reset Locked Account shows all clients
-- Feb 26, 2015 7:56:16 PM COT
UPDATE AD_Process_Para SET AD_Val_Rule_ID=116, DefaultValue='@#AD_Client_ID@',Updated=TO_TIMESTAMP('2015-02-26 19:56:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029
;
-- Feb 26, 2015 7:58:22 PM COT
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200067,'AD_User Locked of Client','S','AD_User.AD_Client_ID=@#AD_Client_ID@ AND IsLocked=''Y''',0,0,'Y',TO_TIMESTAMP('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,'D','13699034-b9eb-493f-9156-2d6864f366d1')
;
-- Feb 26, 2015 7:58:33 PM COT
UPDATE AD_Process_Para SET AD_Val_Rule_ID=200067,Updated=TO_TIMESTAMP('2015-02-26 19:58:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200030
;
-- Feb 26, 2015 7:58:42 PM COT
UPDATE AD_Process_Para SET IsActive='N',Updated=TO_TIMESTAMP('2015-02-26 19:58:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029
;
-- Feb 26, 2015 8:21:57 PM COT
UPDATE AD_Process SET Help='Select a locked user from the list to unlock it. Alternatively you can run the process without selecting any user, in this case the process will unlock all locked users from the client applying accordingly the policies configured for "max account lock" and "max inactive period".',Updated=TO_TIMESTAMP('2015-02-26 20:21:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=200008
;
SELECT register_migration_script('201502261959_IDEMPIERE-1800.sql') FROM dual
;

View File

@ -47,12 +47,12 @@ public class ResetLockedAccount extends SvrProcess {
if (!user.isLocked())
throw new AdempiereException("User " + user.getName() + " is not locked");
StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ")
StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, Updated=SysDate ")
.append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ")
.append(" AND DateAccountLocked IS NOT NULL ")
.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)
if (no <= 0)
throw new AdempiereException("Could not unlock user account" + user.toString());
StringBuilder msgreturn = new StringBuilder("@OK@ - The user '").append(user.getName()).append("' has been unlocked");
@ -63,8 +63,8 @@ public class ResetLockedAccount extends SvrProcess {
int MAX_ACCOUNT_LOCK_MINUTES = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES, 0);
int MAX_INACTIVE_PERIOD = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_INACTIVE_PERIOD_DAY, 0);
StringBuilder sql = new StringBuilder("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ")
.append(" WHERE IsLocked='Y' AND AD_Client_ID IN (0, ?) ")
StringBuilder sql = new StringBuilder("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, Updated=SysDate ")
.append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ")
.append(" AND DateAccountLocked IS NOT NULL");
if (DB.isPostgreSQL())

View File

@ -37,8 +37,10 @@ import org.compiere.util.Env;
* @author Jorg Janke
* @author Trifon Trifonov, Catura AG (www.catura.de)
* <li>FR [ 3010957 ] Custom Separator Character, http://sourceforge.net/tracker/?func=detail&aid=3010957&group_id=176962&atid=879335 </li>
* @version $Id: ImpFormat.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
* @author eugen.hanussek@klst.com
* <li>BF [ 3564464 ] Import File Loader discards input records , https://sourceforge.net/tracker/?func=detail&aid=3564464&group_id=176962&atid=879332 </li>
*
* @version $Id$
*/
public final class ImpFormat
{
@ -617,8 +619,10 @@ public final class ImpFormat
}
if (log.isLoggable(Level.FINER)) log.finer("New ID=" + ID + " " + find);
}
else
if (log.isLoggable(Level.FINER)) log.finer("Old ID=" + ID + " " + find);
else {
log.warning("Not Inserted, Old ID=" + ID + " " + find);
return false;
}
// Update Info -------------------------------------------------------
sql = new StringBuilder ("UPDATE ")

View File

@ -3207,12 +3207,8 @@ public class GridTable extends AbstractTableModel
GridField field = (GridField)m_fields.get(j);
columnName = field.getColumnName();
displayType = field.getDisplayType();
// Integer, ID, Lookup (UpdatedBy is a numeric column)
if (displayType == DisplayType.Integer
|| (DisplayType.isID(displayType)
&& (columnName.endsWith("_ID") || columnName.endsWith("_Acct")
|| columnName.equals("AD_Key") || columnName.equals("AD_Display")))
|| columnName.endsWith("atedBy"))
// Integer, ID, Lookup
if (displayType == DisplayType.Integer || (DisplayType.isID(displayType) && !(columnName.equals("EntityType") || columnName.equals("AD_Language"))))
{
rowData[j] = new Integer(rs.getInt(j+1)); // Integer
if (rs.wasNull())

View File

@ -2115,6 +2115,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
* Set the definite document number after completed
*/
private void setDefiniteDocumentNo() {
if (isReversal() && ! MSysConfig.getBooleanValue(MSysConfig.Invoice_ReverseUseNewNumber, true, getAD_Client_ID())) // IDEMPIERE-1771
return;
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) {
setDateInvoiced(new Timestamp (System.currentTimeMillis()));