hg merge release-2.0 (merge release2 into development)

This commit is contained in:
Carlos Ruiz 2013-11-21 16:35:59 -05:00
commit 1eadccbc82
12 changed files with 148 additions and 21 deletions

View File

@ -0,0 +1,26 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 20, 2013 10:07:29 AM CET
-- IDEMPIERE-1520 Ability to delete an index within AD
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202628,'e7399236-2b73-40af-a72e-16158c2df11f',0,'TableIndexDrop',TO_DATE('2013-11-20 10:07:27','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Drop table index','Drop table index',TO_DATE('2013-11-20 10:07:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Nov 20, 2013 10:08:06 AM CET
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_UU,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200065,'e93b81bb-e3a1-4fb4-b825-39ebfbbe212f','4','org.compiere.process.TableIndexDrop','N',TO_DATE('2013-11-20 10:08:06','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','N','Drop Table Index','Y',0,0,TO_DATE('2013-11-20 10:08:06','YYYY-MM-DD HH24:MI:SS'),100,'TableIndexDrop')
;
-- Nov 20, 2013 10:08:30 AM CET
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210889,'5a7e6f14-4e5f-4051-ae2d-88cc6642fa24',202628,0,200065,28,200085,'TableIndexDrop',TO_DATE('2013-11-20 10:08:30','YYYY-MM-DD HH24:MI:SS'),100,'D','N',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','N','Y','Drop table index',0,0,TO_DATE('2013-11-20 10:08:30','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Nov 20, 2013 10:08:33 AM CET
ALTER TABLE AD_TableIndex ADD TableIndexDrop CHAR(1) DEFAULT NULL
;
-- Nov 20, 2013 10:09:27 AM CET
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210889,202535,'25be136d-efd6-4afc-8792-c47e3e0b53ef',0,200096,2,TO_DATE('2013-11-20 10:09:26','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Drop table index',130,TO_DATE('2013-11-20 10:09:26','YYYY-MM-DD HH24:MI:SS'),100,2)
;
SELECT register_migration_script('201311201011_IDEMPIERE-1520.sql') FROM dual
;

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 20, 2013 2:41:50 PM CET
-- IDEMPIERE-1553
UPDATE AD_Column SET DefaultValue=NULL, ValueMax=NULL, ValueMin=NULL,Updated=TO_DATE('2013-11-20 14:41:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200484
;
SELECT register_migration_script('201311201442_IDEMPIERE-1553.sql') FROM dual
;

View File

@ -0,0 +1,23 @@
-- Nov 20, 2013 10:07:29 AM CET
-- IDEMPIERE-1520 Ability to delete an index within AD
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202628,'e7399236-2b73-40af-a72e-16158c2df11f',0,'TableIndexDrop',TO_TIMESTAMP('2013-11-20 10:07:27','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Drop table index','Drop table index',TO_TIMESTAMP('2013-11-20 10:07:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Nov 20, 2013 10:08:06 AM CET
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_UU,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200065,'e93b81bb-e3a1-4fb4-b825-39ebfbbe212f','4','org.compiere.process.TableIndexDrop','N',TO_TIMESTAMP('2013-11-20 10:08:06','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','N','Drop Table Index','Y',0,0,TO_TIMESTAMP('2013-11-20 10:08:06','YYYY-MM-DD HH24:MI:SS'),100,'TableIndexDrop')
;
-- Nov 20, 2013 10:08:30 AM CET
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210889,'5a7e6f14-4e5f-4051-ae2d-88cc6642fa24',202628,0,200065,28,200085,'TableIndexDrop',TO_TIMESTAMP('2013-11-20 10:08:30','YYYY-MM-DD HH24:MI:SS'),100,'D','N',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','N','Y','Drop table index',0,0,TO_TIMESTAMP('2013-11-20 10:08:30','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Nov 20, 2013 10:08:33 AM CET
ALTER TABLE AD_TableIndex ADD COLUMN TableIndexDrop CHAR(1) DEFAULT NULL
;
-- Nov 20, 2013 10:09:27 AM CET
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210889,202535,'25be136d-efd6-4afc-8792-c47e3e0b53ef',0,200096,2,TO_TIMESTAMP('2013-11-20 10:09:26','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Drop table index',130,TO_TIMESTAMP('2013-11-20 10:09:26','YYYY-MM-DD HH24:MI:SS'),100,2)
;
SELECT register_migration_script('201311201011_IDEMPIERE-1520.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- Nov 20, 2013 2:41:50 PM CET
-- IDEMPIERE-1553
UPDATE AD_Column SET DefaultValue=NULL, ValueMax=NULL, ValueMin=NULL,Updated=TO_TIMESTAMP('2013-11-20 14:41:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200484
;
SELECT register_migration_script('201311201442_IDEMPIERE-1553.sql') FROM dual
;

View File

@ -0,0 +1,39 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* 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.compiere.process;
import org.compiere.model.MTableIndex;
import org.compiere.util.DB;
public class TableIndexDrop extends SvrProcess {
private int p_AD_TableIndex_ID = 0;
@Override
protected void prepare()
{
p_AD_TableIndex_ID = getRecord_ID();
}
protected String doIt() throws Exception
{
MTableIndex index = new MTableIndex(getCtx(), p_AD_TableIndex_ID, get_TrxName());
log.info(index.toString());
String sql = "DROP INDEX " + index.getName();
int rvalue = DB.executeUpdateEx(sql, get_TrxName());
return rvalue + " - " + sql;
}
} // TableIndexDrop

View File

@ -95,13 +95,10 @@ public class TableIndexValidate extends SvrProcess {
else if (!found)
{
String sql = index.getDDL();
int rvalue = DB.executeUpdate(sql, (Object[]) null, true, trxName);
int rvalue = DB.executeUpdateEx(sql, (Object[]) null, trxName);
if (pi != null)
pi.addLog(0, null, new BigDecimal(rvalue), sql);
if (rvalue == -1)
throw new AdempiereException(Msg.getMsg(ctx, "Failed to create index"));
else
return Msg.getMsg(ctx, "CreatedIndexSuccess");
return Msg.getMsg(ctx, "CreatedIndexSuccess");
}
else
{

View File

@ -34,6 +34,8 @@ import javax.swing.table.DefaultTableModel;
import org.compiere.grid.VTable;
import org.compiere.model.DataStatusEvent;
import org.compiere.model.GridTab;
import org.compiere.model.GridTable;
import org.compiere.model.MChangeLog;
import org.compiere.model.MColumn;
import org.compiere.model.MLookup;
@ -41,6 +43,7 @@ import org.compiere.model.MLookupFactory;
import org.compiere.model.MRole;
import org.compiere.model.MTable;
import org.compiere.model.MUser;
import org.compiere.model.PO;
import org.compiere.swing.CDialog;
import org.compiere.swing.CPanel;
import org.compiere.swing.CScrollPane;
@ -51,6 +54,7 @@ import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.NamePair;
import org.compiere.util.Util;
/**
* Record Info (Who) With Change History
@ -182,8 +186,30 @@ public class RecordInfo extends CDialog
.append(" - ").append(m_dateTimeFormat.format(dse.Updated)).append("\n");
}
if (dse.Info != null && dse.Info.length() > 0)
m_info.append("\n (").append(dse.Info).append(")");
m_info.append("\n ").append(dse.Info).append("");
//get uuid
GridTable gridTable = null;
if (dse.getSource() instanceof GridTab)
{
GridTab gridTab = (GridTab) dse.getSource();
gridTable = gridTab.getTableModel();
}
else if (dse.getSource() instanceof GridTable)
{
gridTable = (GridTable) dse.getSource();
}
if (gridTable != null && dse.getCurrentRow() >= 0 && dse.getCurrentRow() < gridTable.getRowCount())
{
PO po = gridTable.getPO(dse.getCurrentRow());
if (po != null) {
String uuidcol = po.getUUIDColumnName();
String uuid = po.get_ValueAsString(uuidcol);
if (!Util.isEmpty(uuid))
m_info.append("\n ").append(uuidcol).append("=").append(uuid);
}
}
// Title
if (dse.AD_Table_ID != 0)
{

View File

@ -135,7 +135,7 @@ public class DefaultInfoFactory implements IInfoFactory {
if (col.equals("M_Product_ID"))
{
InfoWindow infoWindow = new InfoProductWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, multiSelection, whereClause, AD_InfoWindow_ID);
InfoWindow infoWindow = new InfoProductWindow(lookup.getWindowNo(), tableName, keyColumn, queryValue, true, whereClause, AD_InfoWindow_ID);
if (infoWindow.loadedOK())
return infoWindow;

View File

@ -163,7 +163,7 @@ public class InfoProductWindow extends InfoWindow {
warehouseTbl.setMultiSelection(false);
warehouseTbl.setShowTotals(true);
warehouseTbl.autoSize();
warehouseTbl.getModel().addTableModelListener(this);
// warehouseTbl.getModel().addTableModelListener(this);
ColumnInfo[] s_layoutSubstitute = new ColumnInfo[]{
new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class),
@ -182,7 +182,7 @@ public class InfoProductWindow extends InfoWindow {
m_sqlSubstitute = substituteTbl.prepareTable(s_layoutSubstitute, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
substituteTbl.setMultiSelection(false);
substituteTbl.autoSize();
substituteTbl.getModel().addTableModelListener(this);
// substituteTbl.getModel().addTableModelListener(this);
ColumnInfo[] s_layoutRelated = new ColumnInfo[]{
new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class),
@ -201,7 +201,7 @@ public class InfoProductWindow extends InfoWindow {
m_sqlRelated = relatedTbl.prepareTable(s_layoutRelated, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
relatedTbl.setMultiSelection(false);
relatedTbl.autoSize();
relatedTbl.getModel().addTableModelListener(this);
// relatedTbl.getModel().addTableModelListener(this);
//Available to Promise Tab
m_tableAtp = ListboxFactory.newDataTable();
@ -227,7 +227,7 @@ public class InfoProductWindow extends InfoWindow {
m_sqlProductprice = productpriceTbl.prepareTable(s_layoutProductPrice, s_sqlFrom, s_sqlWhere, false, "pp") + " ORDER BY plv.ValidFrom DESC";
productpriceTbl.setMultiSelection(false);
productpriceTbl.autoSize();
productpriceTbl.getModel().addTableModelListener(this);
// productpriceTbl.getModel().addTableModelListener(this);
tabbedPane = new Tabbox();
tabbedPane.setHeight("100%");

View File

@ -822,7 +822,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
@Override
protected boolean hasZoom() {
return !isLookup() && infoWindow != null && !infoWindow.getAD_Table().isView();
return !isLookup() && infoWindow != null && !MTable.get(Env.getCtx(), infoWindow.getAD_Table_ID()).isView();
}
@Override

View File

@ -557,6 +557,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
model = new ListModelTable(subList);
model.setSorter(this);
model.addTableModelListener(this);
model.setMultiple(p_multipleSelection);
contentPanel.setData(model, null);
pageNo = 0;
@ -572,6 +573,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
model = new ListModelTable(readLine(0, -1));
model.setSorter(this);
model.addTableModelListener(this);
model.setMultiple(p_multipleSelection);
contentPanel.setData(model, null);
}
}
@ -586,6 +588,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
model = new ListModelTable(new ArrayList<Object>());
model.setSorter(this);
model.addTableModelListener(this);
model.setMultiple(p_multipleSelection);
contentPanel.setData(model, null);
}
int no = m_count;
@ -1177,6 +1180,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
model = new ListModelTable(subList);
model.setSorter(this);
model.addTableModelListener(this);
model.setMultiple(p_multipleSelection);
contentPanel.setData(model, null);
contentPanel.setSelectedIndex(0);

View File

@ -48,12 +48,7 @@ public abstract class CreateFromRMA extends CreateFrom {
public boolean dynInit() throws Exception
{
log.config("");
boolean isSOTrx = true;
String value = Env.getContext(Env.getCtx(), getGridTab().getWindowNo(), MRMA.COLUMNNAME_IsSOTrx);
if (value != null && value.equalsIgnoreCase("N"))
isSOTrx = false;
setTitle(isSOTrx ? "Customer" : "Vendor" + " RMA - Create Lines From");
setTitle(Msg.getElement(Env.getCtx(), "M_RMA_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
return true;
}
@ -187,9 +182,9 @@ public abstract class CreateFromRMA extends CreateFrom {
// Header Info
Vector<String> columnNames = new Vector<String>(7);
columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
columnNames.add("Line");
columnNames.add(Msg.translate(Env.getCtx(), "Line"));
columnNames.add(Msg.translate(Env.getCtx(), "M_Product_ID"));
columnNames.add("ASI");
columnNames.add(Msg.translate(Env.getCtx(), "SerNo"));
columnNames.add(Msg.translate(Env.getCtx(), "Quantity"));
columnNames.add(Msg.getElement(Env.getCtx(), "QtyDelivered", false));