hg merge release-6.2 (merge release6.2 into default)

This commit is contained in:
Carlos Ruiz 2019-02-25 12:41:27 +01:00
commit 8acf0ae50f
12 changed files with 67 additions and 9 deletions

View File

@ -0,0 +1,4 @@
UPDATE AD_Column SET SeqNoSelection=SeqNoSelection*10 WHERE SeqNoSelection>0 AND IsSelectionColumn='Y' AND IsActive='Y';
SELECT register_migration_script('201902211352_IDEMPIERE-3707.sql') FROM dual
;

View File

@ -0,0 +1,5 @@
UPDATE ad_column SET isautocomplete='Y' WHERE ad_reference_id IN (17,18,19) AND isautocomplete!='Y';
SELECT register_migration_script('201902221447_IDEMPIERE-3851.sql') FROM dual
;

View File

@ -0,0 +1,4 @@
UPDATE AD_Column SET SeqNoSelection=SeqNoSelection*10 WHERE SeqNoSelection>0 AND IsSelectionColumn='Y' AND IsActive='Y';
SELECT register_migration_script('201902211352_IDEMPIERE-3707.sql') FROM dual
;

View File

@ -0,0 +1,5 @@
UPDATE ad_column SET isautocomplete='Y' WHERE ad_reference_id IN (17,18,19) AND isautocomplete!='Y';
SELECT register_migration_script('201902221447_IDEMPIERE-3851.sql') FROM dual
;

View File

@ -58,10 +58,14 @@ extends AbstractExcelExporter
m_printData.setRowIndex(row);
//
MPrintFormatItem item = m_printFormat.getItem(col);
int AD_Column_ID = item.getAD_Column_ID();
Object obj = null;
if (AD_Column_ID > 0)
obj = m_printData.getNode(Integer.valueOf(AD_Column_ID));
if (item.isTypeField() || item.isTypePrintFormat() && item.isImageField()) {
int AD_Column_ID = item.getAD_Column_ID();
if (AD_Column_ID > 0)
obj = m_printData.getNode(Integer.valueOf(AD_Column_ID));
}
if (obj != null && obj instanceof PrintDataElement) {
return (PrintDataElement)obj;
}

View File

@ -424,6 +424,13 @@ public class MColumn extends X_AD_Column
}
}
if (isSelectionColumn() && getSeqNoSelection() <= 0) {
int next = DB.getSQLValueEx(get_TrxName(),
"SELECT ROUND((COALESCE(MAX(SeqNoSelection),0)+10)/10,0)*10 FROM AD_Column WHERE AD_Table_ID=? AND IsSelectionColumn='Y' AND IsActive='Y'",
getAD_Table_ID());
setSeqNoSelection(next);
}
return true;
} // beforeSave

View File

@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.adempiere.model.IInfoColumn;
import org.compiere.model.AccessSqlParser.TableInfo;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Evaluatee;
import org.compiere.util.Evaluator;
@ -143,6 +144,14 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
M_Element element = new M_Element (getCtx(), getAD_Element_ID (), get_TrxName());
setName (element.getName());
}
if (isQueryCriteria() && getSeqNoSelection() <= 0) {
int next = DB.getSQLValueEx(get_TrxName(),
"SELECT ROUND((COALESCE(MAX(SeqNoSelection),0)+10)/10,0)*10 FROM AD_InfoColumn WHERE AD_InfoWindow_ID=? AND IsQueryCriteria='Y' AND IsActive='Y'",
getAD_InfoWindow_ID());
setSeqNoSelection(next);
}
return true;
}

View File

@ -649,6 +649,9 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem
setImageIsAttached(false);
setImageURL(null);
}
if (!isTypeField() && !isTypePrintFormat() && !isImageField()) {
setAD_Column_ID(0);
}
return true;
} // beforeSave

View File

@ -155,7 +155,9 @@ public final class EMail implements Serializable
setSmtpHost(smtpHost);
setFrom(from);
String bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
String bccAddressForAllMails = null;
if (DB.isConnected())
bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
if (! Util.isEmpty(bccAddressForAllMails, true))
addBcc(bccAddressForAllMails);
addTo(to);
@ -263,13 +265,17 @@ public final class EMail implements Serializable
Session session = null;
try
{
boolean isGmail = m_smtpHost.equalsIgnoreCase("smtp.gmail.com");
if (m_auth != null) // createAuthenticator was called
props.put("mail.smtp.auth", "true");
if (m_smtpPort > 0)
{
props.put("mail.smtp.port", String.valueOf(m_smtpPort));
} else if (isGmail)
{
props.put("mail.smtp.port", "587");
}
if (m_secureSmtp)
if (m_secureSmtp || isGmail)
{
props.put("mail.smtp.starttls.enable", "true");
}
@ -299,7 +305,9 @@ public final class EMail implements Serializable
m_msg.setFrom(m_from);
// IDEMPIERE-2104 - intended for test or dev systems to not send undesired emails
boolean isDontSendToAddress = MSysConfig.getBooleanValue(MSysConfig.MAIL_DONT_SEND_TO_ADDRESS, false, Env.getAD_Client_ID(Env.getCtx()));
boolean isDontSendToAddress = false;
if (DB.isConnected())
isDontSendToAddress = MSysConfig.getBooleanValue(MSysConfig.MAIL_DONT_SEND_TO_ADDRESS, false, Env.getAD_Client_ID(Env.getCtx()));
if (! isDontSendToAddress) {
InternetAddress[] rec = getTos();
@ -316,7 +324,9 @@ public final class EMail implements Serializable
if (m_replyTo != null)
m_msg.setReplyTo(new Address[] {m_replyTo});
} else {
String bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
String bccAddressForAllMails = null;
if (DB.isConnected())
bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
if (! Util.isEmpty(bccAddressForAllMails, true)) {
m_msg.setRecipients (Message.RecipientType.TO, bccAddressForAllMails);
}
@ -603,7 +613,7 @@ public final class EMail implements Serializable
try
{
m_from = createInternetAddress(newFrom);
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())))
if (DB.isConnected() && MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())))
addBcc(newFrom);
}
catch (Exception e)

View File

@ -819,6 +819,11 @@ public class Login
Env.setContext(m_ctx, Env.M_WAREHOUSE_ID, warehouse.getKey());
Ini.setProperty(Ini.P_WAREHOUSE, warehouse.getName());
}
else
{
Env.setContext(m_ctx, Env.M_WAREHOUSE_ID, "");
Ini.setProperty(Ini.P_WAREHOUSE, "");
}
// Date (default today)
long today = System.currentTimeMillis();

View File

@ -659,7 +659,7 @@ public class ConfigurationData
props.put("mail.user", mailUser);
props.put("mail.smtp.auth", "true");
if (isGmail) {
props.put("impa.smtp.port", "993");
props.put("mail.imaps.port", "993");
props.put("mail.store.protocol", "imaps");
}

View File

@ -118,6 +118,8 @@ public class Incremental2PackActivator extends AbstractActivator {
//2Pack_1.0.0.zip, 2Pack_1.0.1.zip, etc
Enumeration<URL> urls = context.getBundle().findEntries("/META-INF", "2Pack_*.zip", false);
if (urls == null)
return;
while(urls.hasMoreElements()) {
URL u = urls.nextElement();
String version = extractVersionString(u);