FR [ 1920314 ] Make configurable the changelog for insert

This commit is contained in:
Carlos Ruiz 2008-03-20 00:46:18 +00:00
parent 19f6725583
commit 0423542a2f
5 changed files with 25 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution * * Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it * * 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 * * under the terms version 2 of the GNU General Public License as published *
@ -2412,23 +2412,25 @@ public abstract class PO
throw new DBException(e); // fini throw new DBException(e); // fini
} }
// Change Log - Only // Change Log - Only
if (session != null String insertLog = MSysConfig.getValue("SYSTEM_INSERT_CHANGELOG", "Y", getAD_Client_ID());
if ( session != null
&& m_IDs.length == 1 && m_IDs.length == 1
&& !p_info.isEncrypted(i) // not encrypted && !p_info.isEncrypted(i) // not encrypted
&& !p_info.isVirtualColumn(i) // no virtual column && !p_info.isVirtualColumn(i) // no virtual column
&& !"Password".equals(columnName) && !"Password".equals(columnName)
// && p_info.getColumn(i).IsKey // log all record - to log just ID uncomment this line && (insertLog.equalsIgnoreCase("Y"))
|| (insertLog.equalsIgnoreCase("K") && p_info.getColumn(i).IsKey)
) )
{ {
// change log on new // change log on new
MChangeLog cLog = session.changeLog ( MChangeLog cLog = session.changeLog (
m_trxName, AD_ChangeLog_ID, m_trxName, AD_ChangeLog_ID,
p_info.getAD_Table_ID(), p_info.getColumn(i).AD_Column_ID, p_info.getAD_Table_ID(), p_info.getColumn(i).AD_Column_ID,
get_ID(), getAD_Client_ID(), getAD_Org_ID(), null, value, MChangeLog.EVENTCHANGELOG_Insert); get_ID(), getAD_Client_ID(), getAD_Org_ID(), null, value, MChangeLog.EVENTCHANGELOG_Insert);
if (cLog != null) if (cLog != null)
AD_ChangeLog_ID = cLog.getAD_ChangeLog_ID(); AD_ChangeLog_ID = cLog.getAD_ChangeLog_ID();
} }
} }
// Custom Columns // Custom Columns

View File

@ -0,0 +1,5 @@
-- Mar 19, 2008 7:17:07 PM COT
-- 1920314 - Make configurable the changelog for insert
INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50015,'C',TO_DATE('2008-03-19 19:17:05','YYYY-MM-DD HH24:MI:SS'),100,'Keep change log for inserts: Y - Yes, N - No, K - just the key _ID','D','Y','SYSTEM_INSERT_CHANGELOG',TO_DATE('2008-03-19 19:17:05','YYYY-MM-DD HH24:MI:SS'),100,'Y')
;

View File

@ -0,0 +1,5 @@
-- Mar 19, 2008 7:17:07 PM COT
-- 1920314 - Make configurable the changelog for insert
INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50015,'C',TO_TIMESTAMP('2008-03-19 19:17:05','YYYY-MM-DD HH24:MI:SS'),100,'Keep change log for inserts: Y - Yes, N - No, K - just the key _ID','D','Y','SYSTEM_INSERT_CHANGELOG',TO_TIMESTAMP('2008-03-19 19:17:05','YYYY-MM-DD HH24:MI:SS'),100,'Y')
;