hg merge release-2.0 (merge release2 into development)

This commit is contained in:
Carlos Ruiz 2014-03-19 21:53:55 -05:00
commit 8b7260453b
11 changed files with 124 additions and 74 deletions

View File

@ -0,0 +1,17 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 16, 2014 1:24:36 PM ICT
-- IDEMPIERE-1619 Link on third tab pointing to field on first tab instead of second
UPDATE AD_Column SET IsUpdateable='N', DefaultValue='@1|AD_WF_Node_ID@',Updated=TO_DATE('2014-03-16 13:24:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10426
;
-- Mar 16, 2014 1:25:39 PM ICT
UPDATE AD_Column SET IsUpdateable='N', DefaultValue='@1|AD_WF_Node_ID@',Updated=TO_DATE('2014-03-16 13:25:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=304
;
UPDATE AD_Column SET IsUpdateable='N', DefaultValue='@4|AD_WF_NodeNext_ID@',Updated=TO_DATE('2014-03-20 02:22:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11571
;
SELECT register_migration_script('201403161604_IDEMPIERE-1619.sql') FROM dual
;

View File

@ -0,0 +1,14 @@
-- Mar 16, 2014 1:24:36 PM ICT
-- IDEMPIERE-1619 Link on third tab pointing to field on first tab instead of second
UPDATE AD_Column SET IsUpdateable='N', DefaultValue='@1|AD_WF_Node_ID@',Updated=TO_TIMESTAMP('2014-03-16 13:24:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10426
;
-- Mar 16, 2014 1:25:39 PM ICT
UPDATE AD_Column SET IsUpdateable='N', DefaultValue='@1|AD_WF_Node_ID@',Updated=TO_TIMESTAMP('2014-03-16 13:25:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=304
;
UPDATE AD_Column SET IsUpdateable='N', DefaultValue='@4|AD_WF_NodeNext_ID@',Updated=TO_TIMESTAMP('2014-03-20 02:22:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11571
;
SELECT register_migration_script('201403161604_IDEMPIERE-1619.sql') FROM dual
;

View File

@ -104,6 +104,8 @@ public class GridTabCSVExporter implements IGridTabExporter
if(DisplayType.Location == field.getDisplayType()){
specialHDispayType = DisplayType.Location;
continue;
} else if (! (field.isDisplayed() || field.isDisplayedGrid())) {
continue;
}
String headName = resolveColumnName(table, column);
headArray.add(headName);
@ -525,7 +527,10 @@ public class GridTabCSVExporter implements IGridTabExporter
int AD_Field_ID = Integer.parseInt(fieldIdStr);
for (GridField gridField : tmpFields)
{
if(gridField.isVirtualColumn() || gridField.isEncrypted() || gridField.isEncryptedColumn())
if ( gridField.isVirtualColumn()
|| gridField.isEncrypted()
|| gridField.isEncryptedColumn()
|| !(gridField.isDisplayed() || gridField.isDisplayedGrid()))
continue;
if (gridField.getAD_Field_ID() == AD_Field_ID)
@ -549,7 +554,10 @@ public class GridTabCSVExporter implements IGridTabExporter
continue;
if (DisplayType.Button == MColumn.get(Env.getCtx(),field.getAD_Column_ID()).getAD_Reference_ID())
continue;
if (field.isVirtualColumn() || field.isEncrypted() || field.isEncryptedColumn())
if ( field.isVirtualColumn()
|| field.isEncrypted()
|| field.isEncryptedColumn()
|| !(field.isDisplayed() || field.isDisplayedGrid()))
continue;
if (field.isParentValue() || (!field.isReadOnly() && field.isDisplayedGrid()))
gridFieldList.add(field);

View File

@ -810,9 +810,8 @@ public class GridTabCSVImporter implements IGridTabImporter
if (header.get(i).contains(MTable.getTableName(Env.getCtx(),MLocation.Table_ID)))
{
//without Region or Country any address would be invalid
//without Country any address would be invalid
boolean thereIsCountry = false ;
boolean thereIsRegion = false;
boolean isEmptyRow = true;
for(int j= i;j< header.size();j++){
if(!header.get(j).contains(MTable.getTableName(Env.getCtx(),MLocation.Table_ID)))
@ -826,8 +825,6 @@ public class GridTabCSVImporter implements IGridTabImporter
String columnName = header.get(j);
Object value = tmpRow.get(j);
if(value!=null){
if(columnName.contains("RegionName")||columnName.contains("C_Region_ID"))
thereIsRegion = true;
if(columnName.contains("C_Country_ID"))
thereIsCountry= true;
}else
@ -849,8 +846,8 @@ public class GridTabCSVImporter implements IGridTabImporter
isEmptyRow=false;
}
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
if((field.isMandatory(true) || column.isMandatory()) && !isEmptyRow && (!thereIsRegion || !thereIsCountry))
return new StringBuilder(Msg.getMsg(Env.getCtx(), "FillMandatory")+" "+field.getColumnName()+"["+(thereIsRegion==true?"Region":"C_Country_ID")+"]");
if((field.isMandatory(true) || column.isMandatory()) && !isEmptyRow && !thereIsCountry)
return new StringBuilder(Msg.getMsg(Env.getCtx(), "FillMandatory")+" "+field.getColumnName()+"["+"C_Country_ID]");
}
return null;
}

View File

@ -1402,7 +1402,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (!isDetail())
return true;
// Same link column value
String value = Env.getContext(m_vo.ctx, m_vo.WindowNo, getLinkColumnName());
String value = Env.getContext(m_vo.ctx, m_vo.WindowNo, this.getParentTabNo(), getLinkColumnName());
return m_linkValue.equals(value);
} // isCurrent

View File

@ -27,6 +27,7 @@ import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
/**
* Request Mail Template Model.
@ -39,7 +40,7 @@ public class MMailText extends X_R_MailText
/**
*
*/
private static final long serialVersionUID = -9121875595478208460L;
private static final long serialVersionUID = -3278575461023934790L;
/**
* Standard Constructor
@ -79,6 +80,7 @@ public class MMailText extends X_R_MailText
private String m_MailText3 = null;
/** Translation Cache */
private static CCache<String,MMailTextTrl> s_cacheTrl = new CCache<String,MMailTextTrl> (Table_Name, 20);
private String m_language = null;
/**
* Get parsed/translated Mail Text
@ -323,13 +325,19 @@ public class MMailText extends X_R_MailText
*/
private void translate()
{
if (m_bpartner != null && m_bpartner.getAD_Language() != null)
// Default if no Translation
m_MailHeader = super.getMailHeader();
m_MailText = super.getMailText();
m_MailText2 = super.getMailText2();
m_MailText3 = super.getMailText3();
if ((m_bpartner != null && m_bpartner.getAD_Language() != null) || !Util.isEmpty(m_language))
{
StringBuilder key = new StringBuilder().append(m_bpartner.getAD_Language()).append(get_ID());
String adLanguage = m_bpartner != null ? m_bpartner.getAD_Language() : m_language;
StringBuilder key = new StringBuilder().append(adLanguage).append(get_ID());
MMailTextTrl trl = s_cacheTrl.get(key.toString());
if (trl == null)
{
trl = getTranslation(m_bpartner.getAD_Language());
trl = getTranslation(adLanguage);
if (trl != null)
s_cacheTrl.put(key.toString(), trl);
}
@ -341,11 +349,6 @@ public class MMailText extends X_R_MailText
m_MailText3 = trl.MailText3;
}
}
// No Translation
m_MailHeader = super.getMailHeader();
m_MailText = super.getMailText();
m_MailText2 = super.getMailText2();
m_MailText3 = super.getMailText3();
} // translate
/**
@ -406,4 +409,9 @@ public class MMailText extends X_R_MailText
String MailText3 = null;
} // MMailTextTrl
public void setLanguage(String language)
{
m_language = language;
}
} // MMailText

View File

@ -25,6 +25,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
import java.util.UUID;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
@ -345,20 +346,20 @@ public final class MSetup
* Create User-Role
*/
// ClientUser - Admin & User
sql = "INSERT INTO AD_User_Roles(" + m_stdColumns + ",AD_User_ID,AD_Role_ID)"
+ " VALUES (" + m_stdValues + "," + AD_User_ID + "," + admin.getAD_Role_ID() + ")";
no = DB.executeUpdate(sql, m_trx.getTrxName());
sql = "INSERT INTO AD_User_Roles(" + m_stdColumns + ",AD_User_ID,AD_Role_ID,AD_User_Roles_UU)"
+ " VALUES (" + m_stdValues + "," + AD_User_ID + "," + admin.getAD_Role_ID() + "," + DB.TO_STRING(UUID.randomUUID().toString()) + ")";
no = DB.executeUpdateEx(sql, m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "UserRole ClientUser+Admin NOT inserted");
sql = "INSERT INTO AD_User_Roles(" + m_stdColumns + ",AD_User_ID,AD_Role_ID)"
+ " VALUES (" + m_stdValues + "," + AD_User_ID + "," + user.getAD_Role_ID() + ")";
no = DB.executeUpdate(sql, m_trx.getTrxName());
sql = "INSERT INTO AD_User_Roles(" + m_stdColumns + ",AD_User_ID,AD_Role_ID,AD_User_Roles_UU)"
+ " VALUES (" + m_stdValues + "," + AD_User_ID + "," + user.getAD_Role_ID() + "," + DB.TO_STRING(UUID.randomUUID().toString()) + ")";
no = DB.executeUpdateEx(sql, m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "UserRole ClientUser+User NOT inserted");
// OrgUser - User
sql = "INSERT INTO AD_User_Roles(" + m_stdColumns + ",AD_User_ID,AD_Role_ID)"
+ " VALUES (" + m_stdValues + "," + AD_User_U_ID + "," + user.getAD_Role_ID() + ")";
no = DB.executeUpdate(sql, m_trx.getTrxName());
sql = "INSERT INTO AD_User_Roles(" + m_stdColumns + ",AD_User_ID,AD_Role_ID,AD_User_Roles_UU)"
+ " VALUES (" + m_stdValues + "," + AD_User_U_ID + "," + user.getAD_Role_ID() + "," + DB.TO_STRING(UUID.randomUUID().toString()) + ")";
no = DB.executeUpdateEx(sql, m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "UserRole OrgUser+Org NOT inserted");
@ -564,11 +565,11 @@ public final class MSetup
{
sqlCmd = new StringBuffer ("INSERT INTO C_AcctSchema_Element(");
sqlCmd.append(m_stdColumns).append(",C_AcctSchema_Element_ID,C_AcctSchema_ID,")
.append("ElementType,Name,SeqNo,IsMandatory,IsBalanced) VALUES (");
.append("ElementType,Name,SeqNo,IsMandatory,IsBalanced,C_AcctSchema_Element_UU) VALUES (");
sqlCmd.append(m_stdValues).append(",").append(C_AcctSchema_Element_ID).append(",").append(m_as.getC_AcctSchema_ID()).append(",")
.append("'").append(ElementType).append("','").append(name).append("',").append(SeqNo).append(",'")
.append(IsMandatory).append("','").append(IsBalanced).append("')");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
.append(IsMandatory).append("','").append(IsBalanced).append("',").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no == 1)
m_info.append(Msg.translate(m_lang, "C_AcctSchema_Element_ID")).append("=").append(name).append("\n");
@ -577,7 +578,7 @@ public final class MSetup
{
sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET Org_ID=");
sqlCmd.append(getAD_Org_ID()).append(" WHERE C_AcctSchema_Element_ID=").append(C_AcctSchema_Element_ID);
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "Default Org in AcctSchemaElement NOT updated");
}
@ -586,7 +587,7 @@ public final class MSetup
sqlCmd = new StringBuffer ("UPDATE C_AcctSchema_Element SET C_ElementValue_ID=");
sqlCmd.append(C_ElementValue_ID).append(", C_Element_ID=").append(C_Element_ID);
sqlCmd.append(" WHERE C_AcctSchema_Element_ID=").append(C_AcctSchema_Element_ID);
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "Default Account in AcctSchemaElement NOT updated");
}
@ -769,7 +770,7 @@ public final class MSetup
sqlCmd.append("C_AcctSchema1_ID=").append(m_as.getC_AcctSchema_ID())
.append(", C_Calendar_ID=").append(m_calendar.getC_Calendar_ID())
.append(" WHERE AD_Client_ID=").append(m_client.getAD_Client_ID());
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
{
String err = "ClientInfo not updated";
@ -986,19 +987,19 @@ public final class MSetup
int C_Channel_ID = getNextID(getAD_Client_ID(), "C_Channel");
sqlCmd = new StringBuffer("INSERT INTO C_Channel ");
sqlCmd.append("(C_Channel_ID,Name,");
sqlCmd.append(m_stdColumns).append(") VALUES (");
sqlCmd.append(m_stdColumns).append(",C_Channel_UU) VALUES (");
sqlCmd.append(C_Channel_ID).append(",").append(defaultEntry);
sqlCmd.append(m_stdValues).append(")");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append(m_stdValues).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "Channel NOT inserted");
int C_Campaign_ID = getNextID(getAD_Client_ID(), "C_Campaign");
sqlCmd = new StringBuffer("INSERT INTO C_Campaign ");
sqlCmd.append("(C_Campaign_ID,C_Channel_ID,").append(m_stdColumns).append(",");
sqlCmd.append(" Value,Name,Costs) VALUES (");
sqlCmd.append(" Value,Name,Costs,C_Campaign_UU) VALUES (");
sqlCmd.append(C_Campaign_ID).append(",").append(C_Channel_ID).append(",").append(m_stdValues).append(",");
sqlCmd.append(defaultEntry).append(defaultEntry).append("0)");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append(defaultEntry).append(defaultEntry).append("0").append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no == 1)
m_info.append(Msg.translate(m_lang, "C_Campaign_ID")).append("=").append(defaultName).append("\n");
else
@ -1010,7 +1011,7 @@ public final class MSetup
sqlCmd.append("C_Campaign_ID=").append(C_Campaign_ID);
sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID());
sqlCmd.append(" AND ElementType='MC'");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "AcctSchema ELement Campaign NOT updated");
}
@ -1019,10 +1020,10 @@ public final class MSetup
int C_SalesRegion_ID = getNextID(getAD_Client_ID(), "C_SalesRegion");
sqlCmd = new StringBuffer ("INSERT INTO C_SalesRegion ");
sqlCmd.append("(C_SalesRegion_ID,").append(m_stdColumns).append(",");
sqlCmd.append(" Value,Name,IsSummary) VALUES (");
sqlCmd.append(" Value,Name,IsSummary,C_SalesRegion_UU) VALUES (");
sqlCmd.append(C_SalesRegion_ID).append(",").append(m_stdValues).append(", ");
sqlCmd.append(defaultEntry).append(defaultEntry).append("'N')");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append(defaultEntry).append(defaultEntry).append("'N'").append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no == 1)
m_info.append(Msg.translate(m_lang, "C_SalesRegion_ID")).append("=").append(defaultName).append("\n");
else
@ -1034,7 +1035,7 @@ public final class MSetup
sqlCmd.append("C_SalesRegion_ID=").append(C_SalesRegion_ID);
sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID());
sqlCmd.append(" AND ElementType='SR'");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "AcctSchema ELement SalesRegion NOT updated");
}
@ -1073,7 +1074,7 @@ public final class MSetup
sqlCmd.append("C_BPartner_ID=").append(bp.getC_BPartner_ID());
sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID());
sqlCmd.append(" AND ElementType='BP'");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "AcctSchema Element BPartner NOT updated");
createPreference("C_BPartner_ID", String.valueOf(bp.getC_BPartner_ID()), 143);
@ -1098,13 +1099,14 @@ public final class MSetup
int C_TaxCategory_ID = getNextID(getAD_Client_ID(), "C_TaxCategory");
sqlCmd = new StringBuffer ("INSERT INTO C_TaxCategory ");
sqlCmd.append("(C_TaxCategory_ID,").append(m_stdColumns).append(",");
sqlCmd.append(" Name,IsDefault) VALUES (");
sqlCmd.append(" Name,IsDefault,C_TaxCategory_UU) VALUES (");
sqlCmd.append(C_TaxCategory_ID).append(",").append(m_stdValues).append(", ");
if (C_Country_ID == COUNTRY_US) // US
sqlCmd.append("'Sales Tax','Y')");
sqlCmd.append("'Sales Tax','Y',");
else
sqlCmd.append(defaultEntry).append("'Y')");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append(defaultEntry).append("'Y',");
sqlCmd.append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "TaxCategory NOT inserted");
@ -1112,7 +1114,7 @@ public final class MSetup
sqlCmd.append(" SELECT l.AD_Language,t.C_TaxCategory_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, C_TaxCategory t");
sqlCmd.append(" WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.C_TaxCategory_ID=").append(C_TaxCategory_ID);
sqlCmd.append(" AND NOT EXISTS (SELECT * FROM C_TaxCategory_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.C_TaxCategory_ID=t.C_TaxCategory_ID)");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no < 0)
log.log(Level.SEVERE, "TaxCategory Translation NOT inserted");
@ -1141,7 +1143,7 @@ public final class MSetup
sqlCmd.append("M_Product_ID=").append(product.getM_Product_ID());
sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID());
sqlCmd.append(" AND ElementType='PR'");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "AcctSchema Element Product NOT updated");
@ -1155,7 +1157,7 @@ public final class MSetup
loc.saveEx();
sqlCmd = new StringBuffer ("UPDATE AD_OrgInfo SET C_Location_ID=");
sqlCmd.append(loc.getC_Location_ID()).append(" WHERE AD_Org_ID=").append(getAD_Org_ID());
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "Location NOT inserted");
createPreference("C_Country_ID", String.valueOf(C_Country_ID), 0);
@ -1187,7 +1189,7 @@ public final class MSetup
// sqlCmd.append(",C_UOM_Length_ID=");
// sqlCmd.append(",C_UOM_Time_ID=");
sqlCmd.append(" WHERE AD_Client_ID=").append(getAD_Client_ID());
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
{
String err = "ClientInfo not updated";
@ -1246,7 +1248,7 @@ public final class MSetup
// Update User
sqlCmd = new StringBuffer ("UPDATE AD_User SET C_BPartner_ID=");
sqlCmd.append(bpCU.getC_BPartner_ID()).append(" WHERE AD_User_ID=").append(AD_User_U_ID);
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "User of SalesRep (User) NOT updated");
@ -1272,7 +1274,7 @@ public final class MSetup
// Update User
sqlCmd = new StringBuffer ("UPDATE AD_User SET C_BPartner_ID=");
sqlCmd.append(bpCA.getC_BPartner_ID()).append(" WHERE AD_User_ID=").append(AD_User_ID);
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "User of SalesRep (Admin) NOT updated");
@ -1281,10 +1283,10 @@ public final class MSetup
int C_PaymentTerm_ID = getNextID(getAD_Client_ID(), "C_PaymentTerm");
sqlCmd = new StringBuffer ("INSERT INTO C_PaymentTerm ");
sqlCmd.append("(C_PaymentTerm_ID,").append(m_stdColumns).append(",");
sqlCmd.append("Value,Name,NetDays,GraceDays,DiscountDays,Discount,DiscountDays2,Discount2,IsDefault) VALUES (");
sqlCmd.append("Value,Name,NetDays,GraceDays,DiscountDays,Discount,DiscountDays2,Discount2,IsDefault,C_PaymentTerm_UU) VALUES (");
sqlCmd.append(C_PaymentTerm_ID).append(",").append(m_stdValues).append(",");
sqlCmd.append("'Immediate','Immediate',0,0,0,0,0,0,'Y')");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append("'Immediate','Immediate',0,0,0,0,0,0,'Y'").append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "PaymentTerm NOT inserted");
@ -1292,10 +1294,10 @@ public final class MSetup
C_Cycle_ID = getNextID(getAD_Client_ID(), "C_Cycle");
sqlCmd = new StringBuffer ("INSERT INTO C_Cycle ");
sqlCmd.append("(C_Cycle_ID,").append(m_stdColumns).append(",");
sqlCmd.append(" Name,C_Currency_ID) VALUES (");
sqlCmd.append(" Name,C_Currency_ID,C_Cycle_UU) VALUES (");
sqlCmd.append(C_Cycle_ID).append(",").append(m_stdValues).append(", ");
sqlCmd.append(defaultEntry).append(C_Currency_ID).append(")");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append(defaultEntry).append(C_Currency_ID).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "Cycle NOT inserted");
@ -1307,10 +1309,10 @@ public final class MSetup
int C_Project_ID = getNextID(getAD_Client_ID(), "C_Project");
sqlCmd = new StringBuffer ("INSERT INTO C_Project ");
sqlCmd.append("(C_Project_ID,").append(m_stdColumns).append(",");
sqlCmd.append(" Value,Name,C_Currency_ID,IsSummary) VALUES (");
sqlCmd.append(" Value,Name,C_Currency_ID,IsSummary,C_Project_UU) VALUES (");
sqlCmd.append(C_Project_ID).append(",").append(m_stdValuesOrg).append(", ");
sqlCmd.append(defaultEntry).append(defaultEntry).append(C_Currency_ID).append(",'N')");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
sqlCmd.append(defaultEntry).append(defaultEntry).append(C_Currency_ID).append(",'N'").append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(")");
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no == 1)
m_info.append(Msg.translate(m_lang, "C_Project_ID")).append("=").append(defaultName).append("\n");
else
@ -1322,7 +1324,7 @@ public final class MSetup
sqlCmd.append("C_Project_ID=").append(C_Project_ID);
sqlCmd.append(" WHERE C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID());
sqlCmd.append(" AND ElementType='PJ'");
no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "AcctSchema ELement Project NOT updated");
}
@ -1352,15 +1354,15 @@ public final class MSetup
{
int AD_Preference_ID = getNextID(getAD_Client_ID(), "AD_Preference");
StringBuilder sqlCmd = new StringBuilder ("INSERT INTO AD_Preference ");
sqlCmd.append("(AD_Preference_ID,").append(m_stdColumns).append(",");
sqlCmd.append("(AD_Preference_ID,").append("AD_Preference_UU,").append(m_stdColumns).append(",");
sqlCmd.append("Attribute,Value,AD_Window_ID) VALUES (");
sqlCmd.append(AD_Preference_ID).append(",").append(m_stdValues).append(",");
sqlCmd.append(AD_Preference_ID).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(",").append(m_stdValues).append(",");
sqlCmd.append("'").append(Attribute).append("','").append(Value).append("',");
if (AD_Window_ID == 0)
sqlCmd.append("NULL)");
else
sqlCmd.append(AD_Window_ID).append(")");
int no = DB.executeUpdate(sqlCmd.toString(), m_trx.getTrxName());
int no = DB.executeUpdateEx(sqlCmd.toString(), m_trx.getTrxName());
if (no != 1)
log.log(Level.SEVERE, "Preference NOT inserted - " + Attribute);
} // createPreference

View File

@ -190,12 +190,13 @@ public class WindowElementHandler extends AbstractElementHandler {
}
// Preference Tag
sql = "SELECT AD_Preference_ID FROM AD_PREFERENCE WHERE AD_WINDOW_ID = ?";
sql = "SELECT AD_Preference_ID FROM AD_PREFERENCE WHERE AD_WINDOW_ID = ? AND AD_CLIENT_ID = ?";
pstmt = null;
rs = null;
try {
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
pstmt.setInt(1, AD_Window_ID);
pstmt.setInt(2, Env.getAD_Client_ID(ctx.ctx));
rs = pstmt.executeQuery();
while (rs.next()) {
createPreference(ctx, document, rs.getInt("AD_Preference_ID"));

View File

@ -25,6 +25,7 @@ import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Properties;
import java.util.UUID;
import java.util.logging.Level;
import javax.swing.BorderFactory;
@ -494,9 +495,9 @@ public class ValuePreference extends CDialog
int AD_Preference_ID = DB.getNextID(m_ctx, "AD_Preference", null);
//
StringBuilder sql = new StringBuilder ("INSERT INTO AD_Preference ("
+ "AD_Preference_ID, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy,"
+ "AD_Preference_ID, AD_Preference_UU, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy,"
+ "AD_Window_ID, AD_User_ID, Attribute, Value) VALUES (");
sql.append(AD_Preference_ID).append(",").append(Client_ID).append(",").append(Org_ID)
sql.append(AD_Preference_ID).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(",").append(Client_ID).append(",").append(Org_ID)
.append(", 'Y',SysDate,").append(m_AD_User_ID).append(",SysDate,").append(m_AD_User_ID).append(", ");
if (cbWindow.isSelected())
sql.append(m_AD_Window_ID).append(",");

View File

@ -17,6 +17,7 @@
package org.adempiere.webui;
import java.util.Properties;
import java.util.UUID;
import java.util.logging.Level;
import org.adempiere.webui.adwindow.ADWindow;
@ -65,7 +66,7 @@ public class ValuePreference extends Window implements EventListener<Event>
/**
*
*/
private static final long serialVersionUID = -8490929927886340040L;
private static final long serialVersionUID = 471820722501563271L;
/**
* Factory
@ -533,9 +534,9 @@ public class ValuePreference extends Window implements EventListener<Event>
int AD_Preference_ID = DB.getNextID(m_ctx, "AD_Preference", null);
//
StringBuilder sql = new StringBuilder ("INSERT INTO AD_Preference ("
+ "AD_Preference_ID, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy,"
+ "AD_Preference_ID, AD_Preference_UU, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy,"
+ "AD_Window_ID, AD_User_ID, Attribute, Value) VALUES (");
sql.append(AD_Preference_ID).append(",").append(Client_ID).append(",").append(Org_ID)
sql.append(AD_Preference_ID).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(",").append(Client_ID).append(",").append(Org_ID)
.append(", 'Y',SysDate,").append(m_AD_User_ID).append(",SysDate,").append(m_AD_User_ID).append(", ");
if (cbWindow.isChecked())
sql.append(m_AD_Window_ID).append(",");

View File

@ -506,6 +506,7 @@ public class ResetPasswordPanel extends Window implements EventListener<Event>
return false;
MMailText mailText = new MMailText(m_ctx, R_MailText_ID, null);
mailText.setLanguage(Env.getContext(m_ctx, "#AD_Language"));
to.set_ValueOfColumn("Password", newPassword); // will be hashed and validate on saveEx
mailText.setUser(to);
String message = mailText.getMailText(true);