From 319e2d27b8af67cb767db3bcb640815efb7735bc Mon Sep 17 00:00:00 2001 From: Juan David Arboleda Date: Wed, 12 Mar 2014 08:36:13 -0500 Subject: [PATCH 01/16] IDEMPIERE-1775 PackOut process is not exporting UUIDs references for fields M_Locator_ID and C_Location_ID --- org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java index fbe671655d..dd7b83cf99 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java @@ -12,6 +12,8 @@ import org.compiere.model.PO; import org.compiere.model.POInfo; import org.compiere.model.X_AD_Client; import org.compiere.model.X_AD_Org; +import org.compiere.model.X_C_Location; +import org.compiere.model.X_M_Locator; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; import org.xml.sax.SAXException; @@ -275,6 +277,10 @@ public class PoExporter { addBlob(columnName); } else if (columnName.equals(po.getUUIDColumnName()) && po.get_Value(columnName) == null) { continue; + } else if (DisplayType.Locator == displayType) { + addTableReference(columnName, X_M_Locator.Table_Name, new AttributesImpl()); + } else if (DisplayType.Location == displayType) { + addTableReference(columnName, X_C_Location.Table_Name, new AttributesImpl()); } else { add(columnName, "", new AttributesImpl()); } From d8f3f0d6b7787780b976d192942f9c23580a2889 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 09:54:14 -0500 Subject: [PATCH 02/16] Fix IDEMPIERE-1707 A single default country for all tenant --- .../src/org/compiere/model/MCountry.java | 102 ++++++++++-------- 1 file changed, 58 insertions(+), 44 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MCountry.java b/org.adempiere.base/src/org/compiere/model/MCountry.java index f01b397169..3fad08c014 100644 --- a/org.adempiere.base/src/org/compiere/model/MCountry.java +++ b/org.adempiere.base/src/org/compiere/model/MCountry.java @@ -16,21 +16,21 @@ *****************************************************************************/ package org.compiere.model; +import static org.compiere.model.SystemIDs.COUNTRY_US; + import java.io.Serializable; import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; import java.util.Arrays; import java.util.Comparator; +import java.util.List; +import java.util.Map.Entry; import java.util.Properties; import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.CLogger; -import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Language; -import static org.compiere.model.SystemIDs.*; /** * Location Country Model (Value Object) @@ -47,8 +47,7 @@ public class MCountry extends X_C_Country /** * */ - private static final long serialVersionUID = -3098295201595847612L; - + private static final long serialVersionUID = -4015127112992493778L; /** * Get Country (cached) @@ -59,14 +58,13 @@ public class MCountry extends X_C_Country public static MCountry get (Properties ctx, int C_Country_ID) { loadAllCountriesIfNeeded(ctx); - String key = String.valueOf(C_Country_ID); - MCountry c = (MCountry)s_countries.get(key); + MCountry c = s_countries.get(C_Country_ID); if (c != null) return c; c = new MCountry (ctx, C_Country_ID, null); if (c.getC_Country_ID() == C_Country_ID) { - s_countries.put(key, c); + s_countries.put(C_Country_ID, c); return c; } return null; @@ -79,8 +77,14 @@ public class MCountry extends X_C_Country */ public static MCountry getDefault (Properties ctx) { - loadAllCountriesIfNeeded(ctx); - return s_default; + int clientID = Env.getAD_Client_ID(ctx); + MCountry c = s_default.get(clientID); + if (c != null) + return c; + + loadDefaultCountry(ctx); + c = s_default.get(clientID); + return c; } // get /** @@ -112,43 +116,53 @@ public class MCountry extends X_C_Country { MClient client = MClient.get (ctx); MLanguage lang = MLanguage.get(ctx, client.getAD_Language()); - MCountry usa = null; // - s_countries = new CCache(Table_Name, 250); - String sql = "SELECT * FROM C_Country WHERE IsActive='Y'"; - Statement stmt = null; - ResultSet rs = null; - try - { - stmt = DB.createStatement(); - rs = stmt.executeQuery(sql); - while(rs.next()) - { - MCountry c = new MCountry (ctx, rs, null); - s_countries.put(String.valueOf(c.getC_Country_ID()), c); - // Country code of Client Language - if (lang != null && lang.getCountryCode().equals(c.getCountryCode())) - s_default = c; - if (c.getC_Country_ID() == COUNTRY_US) // USA - usa = c; - } + s_countries = new CCache(Table_Name, 250); + List countries = new Query(ctx, Table_Name, "", null) + .setOnlyActiveRecords(true) + .list(); + for (MCountry c : countries) { + s_countries.put(c.getC_Country_ID(), c); + // Country code of Client Language + if (lang != null && lang.getCountryCode().equals(c.getCountryCode())) + s_default.put(client.getAD_Client_ID(), c); } - catch (SQLException e) - { - s_log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, stmt); - rs = null; - stmt = null; - } - if (s_default == null) - s_default = usa; if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + s_countries.size() + " - Default=" + s_default); } // loadAllCountries + /** + * Load Default Country for actual client on context + * @param ctx + */ + private static void loadDefaultCountry(Properties ctx) { + loadAllCountriesIfNeeded(ctx); + MClient client = MClient.get (ctx); + MCountry found = s_default.get(client.getAD_Client_ID()); + if (found != null) + return; + + MLanguage lang = MLanguage.get(ctx, client.getAD_Language()); + MCountry usa = null; + + for (Entry cachedEntry : s_countries.entrySet()) { + MCountry c = cachedEntry.getValue(); + // Country code of Client Language + if (lang != null && lang.getCountryCode().equals(c.getCountryCode())) { + found = c; + break; + } + if (c.getC_Country_ID() == COUNTRY_US) // USA + usa = c; + } + if (found != null) + s_default.put(client.getAD_Client_ID(), found); + else + s_default.put(client.getAD_Client_ID(), usa); + if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + s_countries.size() + + " - Default=" + s_default); + } + /** * Return Language * @return Name @@ -177,9 +191,9 @@ public class MCountry extends X_C_Country private static String s_AD_Language = null; /** Country Cache */ - private static CCache s_countries = null; + private static CCache s_countries = null; /** Default Country */ - private static MCountry s_default = null; + private static CCache s_default = new CCache(Table_Name, 3); /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MCountry.class); // Default DisplaySequence */ From 1afe37e25b56776e762d739230156ce48468d76a Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 7 Mar 2014 20:59:32 +0700 Subject: [PATCH 03/16] IDEMPIERE-1670:log-in with ldap account fail --- .../src/org/compiere/util/Login.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 0eb8185a9d..50c3e3df76 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -1240,11 +1240,7 @@ public class Login if (system.isLDAP()) { - authenticated = system.isLDAP(app_user, app_pwd); - if (authenticated){ - app_pwd = null; - authenticated=true; - } + authenticated = system.isLDAP(app_user, app_pwd); // if not authenticated, use AD_User as backup } @@ -1328,12 +1324,16 @@ public class Login } clientsValidated.add(user.getAD_Client_ID()); boolean valid = false; - if (hash_password) { + // authenticated by ldap + if (authenticated){ + valid = true; + } else if (hash_password) { valid = user.authenticateHash(app_pwd); } else { // password not hashed valid = user.getPassword() != null && user.getPassword().equals(app_pwd); - } + } + if (valid ) { if (user.isLocked()) { @@ -1341,7 +1341,10 @@ public class Login continue; } - if (user.isExpired()) + if (authenticated){ + // use Ldap because don't check password age + } + else if (user.isExpired()) isPasswordExpired = true; else if (MAX_PASSWORD_AGE > 0 && !user.isNoPasswordReset()) { From ea3620f953a698ec8eae4558394d875993a82a57 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 15:14:28 -0500 Subject: [PATCH 04/16] IDEMPIERE-604 Fix implementation hiding SQL errors from user - all SQL errors are being shown as "timeout error" --- org.adempiere.base/src/org/compiere/model/GridTable.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 55b065330c..6edf5aca40 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -1056,6 +1056,12 @@ public class GridTable extends AbstractTableModel {} loops++; } + if (m_sort.size() == 0) { + // check if there is a DB error saved to show + Exception savedEx = CLogger.retrieveException(); + if (savedEx != null) + throw new IllegalStateException(savedEx); + } if (row >= m_sort.size()) { throw new IllegalStateException("Timeout loading row " + (row+1)); } @@ -3512,7 +3518,8 @@ public class GridTable extends AbstractTableModel } catch (SQLException e) { - log.log(Level.SEVERE, m_SQL, e); + log.saveError(e.getLocalizedMessage(), e); + throw new DBException(e); } } From f3321a3eba85be1f38ea97f9d38efd073f31a794 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 15:59:58 -0500 Subject: [PATCH 05/16] =?UTF-8?q?IDEMPIERE-1536=20Error=20running=20a=20re?= =?UTF-8?q?port=20with=20SQL=20columns=20/=20thanks=20to=20Antonio=20Ca?= =?UTF-8?q?=C3=B1averal=20for=20suggested=20patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- org.adempiere.base/src/org/compiere/model/MLookupFactory.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/report/HTMLExtension.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index 992989a880..59f6e7b4a1 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -675,9 +675,9 @@ public class MLookupFactory embedSQL.append(BaseTable).append(".").append(BaseColumn); embedSQL.append("=").append(TableNameAlias).append(".").append(KeyColumn); } else if (translated) { - embedSQL.append(TableNameAlias).append(".").append(BaseColumn).append("=").append(column.getColumnSQL()); + embedSQL.append(TableNameAlias).append(".").append(KeyColumn).append("=").append(column.getColumnSQL()); } else { - embedSQL.append(BaseColumn).append("=").append(column.getColumnSQL()); + embedSQL.append(KeyColumn).append("=").append(column.getColumnSQL()); } return embedSQL.toString(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/report/HTMLExtension.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/report/HTMLExtension.java index 6a49334c0f..bcfbfa902c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/report/HTMLExtension.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/report/HTMLExtension.java @@ -61,7 +61,7 @@ public class HTMLExtension implements IHTMLExtension { href.setStyle("text-decoration: none; font-size: 11px; vertical-align: middle;"); href.addAttribute("onclick", "parent.zoom('" + componentId + "', '" - + dataElement.getColumnName() + "', '" + + dataElement.getForeignColumnName() + "', '" + dataElement.getValueAsString() + "')"); window.addElement(href); menu.addElement(window); From 9a3b47b3a0c6f862a2a373613969ad9e50a04839 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 16:07:48 -0500 Subject: [PATCH 06/16] IDEMPIERE-1679 Remove MGoal.getUserGoals: No Records found message from log --- org.adempiere.base/src/org/compiere/model/MGoal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MGoal.java b/org.adempiere.base/src/org/compiere/model/MGoal.java index 7a82f81224..be8ff1d75a 100644 --- a/org.adempiere.base/src/org/compiere/model/MGoal.java +++ b/org.adempiere.base/src/org/compiere/model/MGoal.java @@ -95,7 +95,7 @@ public class MGoal extends X_PA_Goal rs = null; pstmt = null; } if (list.size() == 0) - s_log.log (Level.WARNING, Msg.getMsg(ctx, "FindZeroRecords")); + s_log.log (Level.INFO, Msg.getMsg(ctx, "FindZeroRecords")); MGoal[] retValue = new MGoal[list.size ()]; list.toArray (retValue); return retValue; From 6cb2efc0294d0134969de814685a766e4176525b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 17:52:44 -0500 Subject: [PATCH 07/16] IDEMPIERE-1662 Replenish Report with Production does not differentiate IsSOTrx in M_StorageReservation / thanks to Chuck Boecking for the patch --- .../src/org/compiere/process/ReplenishReport.java | 4 ++-- .../src/org/compiere/process/ReplenishReportProduction.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java index 4915e14b0c..095b6088ec 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java @@ -252,9 +252,9 @@ public class ReplenishReport extends SvrProcess sql.append("QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_StorageOnHand s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID),"); sql.append("QtyReserved = (SELECT COALESCE(SUM(Qty),0) FROM M_StorageReservation s WHERE t.M_Product_ID=s.M_Product_ID"); - sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID),"); + sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID AND s.IsSOTrx='Y'),"); sql.append("QtyOrdered = (SELECT COALESCE(SUM(Qty),0) FROM M_StorageReservation s WHERE t.M_Product_ID=s.M_Product_ID"); - sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID)"); + sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID AND s.IsSOTrx='N')"); if (p_C_DocType_ID != 0) sql.append(", C_DocType_ID=").append(p_C_DocType_ID); sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java index 6eb1fd8898..8205b71451 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java @@ -272,9 +272,9 @@ public class ReplenishReportProduction extends SvrProcess sql.append("QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_StorageOnHand s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID),"); sql.append("QtyReserved = (SELECT COALESCE(SUM(Qty),0) FROM M_StorageReservation s WHERE t.M_Product_ID=s.M_Product_ID"); - sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID),"); + sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID AND s.IsSOTrx='Y'),"); sql.append("QtyOrdered = (SELECT COALESCE(SUM(Qty),0) FROM M_StorageReservation s WHERE t.M_Product_ID=s.M_Product_ID"); - sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID)"); + sql.append(" AND t.M_Warehouse_ID=s.M_Warehouse_ID AND s.IsSOTrx='N')"); if (p_C_DocType_ID != 0) sql.append(", C_DocType_ID=").append(p_C_DocType_ID); sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); From 367ca9794ed82882f7fb550152ae6e0faae9d88e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 21:03:05 -0500 Subject: [PATCH 08/16] IDEMPIERE-1730 Counter Document can not create at Order and Invoice / integrate patch from Hagiwara Hideaki --- .../src/org/compiere/model/MInvoice.java | 9 +++++++-- .../src/org/compiere/model/MOrder.java | 13 +++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 069c02478d..ec73c55afe 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -163,6 +163,11 @@ public class MInvoice extends X_C_Invoice implements DocAction if (counter) { to.setRef_Invoice_ID(from.getC_Invoice_ID()); + MOrg org = MOrg.get(from.getCtx(), from.getAD_Org_ID()); + int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(trxName); + if (counterC_BPartner_ID == 0) + return null; + to.setBPartner(MBPartner.get(from.getCtx(), counterC_BPartner_ID)); // Try to find Order link if (from.getC_Order_ID() != 0) { @@ -2169,8 +2174,8 @@ public class MInvoice extends X_C_Invoice implements DocAction counter.setAD_Org_ID(counterAD_Org_ID); // counter.setM_Warehouse_ID(counterOrgInfo.getM_Warehouse_ID()); // - counter.setBPartner(counterBP); - // Refernces (Should not be required +// counter.setBPartner(counterBP);// was set on copyFrom + // References (Should not be required) counter.setSalesRep_ID(getSalesRep_ID()); counter.saveEx(get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index aea06a3374..2d89d4454f 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -127,9 +127,14 @@ public class MOrder extends X_C_Order implements DocAction to.setIsTransferred (false); to.setPosted (false); to.setProcessed (false); - if (counter) + if (counter) { to.setRef_Order_ID(from.getC_Order_ID()); - else + MOrg org = MOrg.get(from.getCtx(), from.getAD_Org_ID()); + int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(trxName); + if (counterC_BPartner_ID == 0) + return null; + to.setBPartner(MBPartner.get(from.getCtx(), counterC_BPartner_ID)); + } else to.setRef_Order_ID(0); // if (!to.save(trxName)) @@ -2338,9 +2343,9 @@ public class MOrder extends X_C_Order implements DocAction counter.setAD_Org_ID(counterAD_Org_ID); counter.setM_Warehouse_ID(counterOrgInfo.getM_Warehouse_ID()); // - counter.setBPartner(counterBP); +// counter.setBPartner(counterBP); // was set on copyFrom counter.setDatePromised(getDatePromised()); // default is date ordered - // Refernces (Should not be required + // References (Should not be required) counter.setSalesRep_ID(getSalesRep_ID()); counter.saveEx(get_TrxName()); From f269768f71b121071fac4bcc4c648a130ada20d4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 21:45:02 -0500 Subject: [PATCH 09/16] IDEMPIERE-1144 Generating shipments from existing orders fails if product has mandatory attribute set / thanks to Tony Snook (tspc) for the initial patch --- .../oracle/views/M_INOUT_CANDIDATE_V.sql | 2 +- .../postgresql/views/M_INOUT_CANDIDATE_V.sql | 2 +- .../oracle/201403122133_IDEMPIERE-1144.sql | 43 +++++++++++++++++++ .../201403122133_IDEMPIERE-1144.sql | 43 +++++++++++++++++++ .../org/compiere/process/InOutGenerate.java | 21 +++++---- .../src/org/compiere/apps/form/VInOutGen.java | 2 +- .../adempiere/webui/apps/form/WInOutGen.java | 2 +- 7 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 migration/i2.0/oracle/201403122133_IDEMPIERE-1144.sql create mode 100644 migration/i2.0/postgresql/201403122133_IDEMPIERE-1144.sql diff --git a/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql b/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql index 501c6d4a50..af82c4ed57 100644 --- a/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql +++ b/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql @@ -27,7 +27,7 @@ WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL -- Not confirmed shipment AND NOT EXISTS (SELECT * FROM M_InOutLine iol INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) - WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('IP','WC')) + WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC')) -- GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, o.DocumentNo, o.DateOrdered, o.C_DocType_ID, diff --git a/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql b/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql index 501c6d4a50..af82c4ed57 100644 --- a/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql +++ b/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql @@ -27,7 +27,7 @@ WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL -- Not confirmed shipment AND NOT EXISTS (SELECT * FROM M_InOutLine iol INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) - WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('IP','WC')) + WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC')) -- GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, o.DocumentNo, o.DateOrdered, o.C_DocType_ID, diff --git a/migration/i2.0/oracle/201403122133_IDEMPIERE-1144.sql b/migration/i2.0/oracle/201403122133_IDEMPIERE-1144.sql new file mode 100644 index 0000000000..00048d0100 --- /dev/null +++ b/migration/i2.0/oracle/201403122133_IDEMPIERE-1144.sql @@ -0,0 +1,43 @@ +-- IDEMPIERE-1144 Generating shipments from existing orders fails if product has mandatory attribute set + +CREATE OR REPLACE VIEW M_INOUT_CANDIDATE_V +(AD_CLIENT_ID, AD_ORG_ID, C_BPARTNER_ID, C_ORDER_ID, DOCUMENTNO, + DATEORDERED, C_DOCTYPE_ID, POREFERENCE, DESCRIPTION, SALESREP_ID, + M_WAREHOUSE_ID, TOTALLINES) +AS +SELECT + o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, + l.M_Warehouse_ID, + SUM((l.QtyOrdered-l.QtyDelivered)*l.PriceActual) AS TotalLines +FROM C_Order o + INNER JOIN C_OrderLine l ON (o.C_Order_ID=l.C_Order_ID) +WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL/RE + -- not Offers and open Walkin-Receipts + AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType + WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) + -- Delivery Rule - not manual + AND o.DeliveryRule<>'M' + AND (l.M_Product_ID IS NULL OR EXISTS + (SELECT * FROM M_Product p + WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N')) + -- we need to ship + AND l.QtyOrdered <> l.QtyDelivered + AND o.IsDropShip='N' + AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL) + -- Not confirmed shipment + AND NOT EXISTS (SELECT * FROM M_InOutLine iol + INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) + WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC')) + -- +GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, l.M_Warehouse_ID +; + + + +SELECT register_migration_script('201403122133_IDEMPIERE-1144.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201403122133_IDEMPIERE-1144.sql b/migration/i2.0/postgresql/201403122133_IDEMPIERE-1144.sql new file mode 100644 index 0000000000..00048d0100 --- /dev/null +++ b/migration/i2.0/postgresql/201403122133_IDEMPIERE-1144.sql @@ -0,0 +1,43 @@ +-- IDEMPIERE-1144 Generating shipments from existing orders fails if product has mandatory attribute set + +CREATE OR REPLACE VIEW M_INOUT_CANDIDATE_V +(AD_CLIENT_ID, AD_ORG_ID, C_BPARTNER_ID, C_ORDER_ID, DOCUMENTNO, + DATEORDERED, C_DOCTYPE_ID, POREFERENCE, DESCRIPTION, SALESREP_ID, + M_WAREHOUSE_ID, TOTALLINES) +AS +SELECT + o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, + l.M_Warehouse_ID, + SUM((l.QtyOrdered-l.QtyDelivered)*l.PriceActual) AS TotalLines +FROM C_Order o + INNER JOIN C_OrderLine l ON (o.C_Order_ID=l.C_Order_ID) +WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL/RE + -- not Offers and open Walkin-Receipts + AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType + WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) + -- Delivery Rule - not manual + AND o.DeliveryRule<>'M' + AND (l.M_Product_ID IS NULL OR EXISTS + (SELECT * FROM M_Product p + WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N')) + -- we need to ship + AND l.QtyOrdered <> l.QtyDelivered + AND o.IsDropShip='N' + AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL) + -- Not confirmed shipment + AND NOT EXISTS (SELECT * FROM M_InOutLine iol + INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) + WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC')) + -- +GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, l.M_Warehouse_ID +; + + + +SELECT register_migration_script('201403122133_IDEMPIERE-1144.sql') FROM dual +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index c3d70940e4..46e941005c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -57,7 +57,7 @@ public class InOutGenerate extends SvrProcess /** Include Orders w. unconfirmed Shipments */ private boolean p_IsUnconfirmedInOut = false; /** DocAction */ - private String p_docAction = DocAction.ACTION_Complete; + private String p_docAction = DocAction.ACTION_None; /** Consolidate */ private boolean p_ConsolidateDocument = true; /** Shipment Date */ @@ -123,9 +123,6 @@ public class InOutGenerate extends SvrProcess m_movementDate = new Timestamp(System.currentTimeMillis()); } else m_movementDate = p_DateShipped; - // DocAction check - if (!DocAction.ACTION_Complete.equals(p_docAction)) - p_docAction = DocAction.ACTION_Prepare; } } // prepare @@ -244,7 +241,7 @@ public class InOutGenerate extends SvrProcess if (!p_IsUnconfirmedInOut) where.append(" AND NOT EXISTS (SELECT * FROM M_InOutLine iol") .append(" INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) ") - .append("WHERE iol.C_OrderLine_ID=C_OrderLine.C_OrderLine_ID AND io.DocStatus IN ('IP','WC'))"); + .append("WHERE iol.C_OrderLine_ID=C_OrderLine.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC'))"); // Deadlock Prevention - Order by M_Product_ID MOrderLine[] lines = order.getLines (where.toString(), "C_BPartner_Location_ID, M_Product_ID"); for (int i = 0; i < lines.length; i++) @@ -269,7 +266,7 @@ public class InOutGenerate extends SvrProcess BigDecimal unconfirmedShippedQty = Env.ZERO; if (p_IsUnconfirmedInOut && product != null && toDeliver.signum() != 0) { - String where2 = "EXISTS (SELECT * FROM M_InOut io WHERE io.M_InOut_ID=M_InOutLine.M_InOut_ID AND io.DocStatus IN ('IP','WC'))"; + String where2 = "EXISTS (SELECT * FROM M_InOut io WHERE io.M_InOut_ID=M_InOutLine.M_InOut_ID AND io.DocStatus IN ('DR','IN','IP','WC'))"; MInOutLine[] iols = MInOutLine.getOfOrderLine(getCtx(), line.getC_OrderLine_ID(), where2, null); for (int j = 0; j < iols.length; j++) @@ -574,11 +571,13 @@ public class InOutGenerate extends SvrProcess { if (m_shipment != null) { - // Fails if there is a confirmation - if (!m_shipment.processIt(p_docAction)) { - log.warning("Failed: " + m_shipment); - throw new IllegalStateException("Shipment Process Failed: " + m_shipment + " - " + m_shipment.getProcessMsg()); - + if (!DocAction.ACTION_None.equals(p_docAction)) + { + // Fails if there is a confirmation + if (!m_shipment.processIt(p_docAction)) { + log.warning("Failed: " + m_shipment); + throw new IllegalStateException("Shipment Process Failed: " + m_shipment + " - " + m_shipment.getProcessMsg()); + } } m_shipment.saveEx(); String message = Msg.parseTranslation(getCtx(), "@ShipmentProcessed@ " + m_shipment.getDocumentNo()); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java index de00776f53..5fbf1bb72f 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VInOutGen.java @@ -143,7 +143,7 @@ public class VInOutGen extends InOutGen implements FormPanel, ActionListener, Ve // Document Action Prepared/ Completed MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 4324 /* M_InOut.DocStatus */, DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135 /* _Document Action */, - false, "AD_Ref_List.Value IN ('CO','PR')"); + false, "AD_Ref_List.Value IN ('CO','PR','--')"); docAction = new VLookup("DocAction", true, false, true,docActionL); docAction.addVetoableChangeListener(this); // C_Order.C_BPartner_ID diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java index fc1f1cec6d..74766f6b22 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java @@ -138,7 +138,7 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction")); MLookup docActionL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 4324 /* M_InOut.DocAction */, DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135 /* _Document Action */, - false, "AD_Ref_List.Value IN ('CO','PR')"); + false, "AD_Ref_List.Value IN ('CO','PR','--')"); docAction = new WTableDirEditor("DocAction", true, false, true,docActionL); docAction.setValue(DocAction.ACTION_Complete); // docAction.addValueChangeListener(this); // IDEMPIERE-768 From a03563cda53911e7318bdad5f9ddf77914c8c376 Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 6 Feb 2014 13:59:46 +0700 Subject: [PATCH 10/16] IDEMPIERE-1737:Double click into header or blank area (when non row is selected) of info window make NPE --- .../src/org/adempiere/webui/panel/InfoPanel.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index d567fc8972..fe3577bb26 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -1282,7 +1282,12 @@ public abstract class InfoPanel extends Window implements EventListener, } public void zoom() - { + { + Integer recordId = contentPanel.getSelectedRowKey(); + // prevent NPE when double click is raise but no recore is selected + if (recordId == null) + return; + if (listeners != null && listeners.size() > 0) { ValueChangeEvent event = new ValueChangeEvent(this,"zoom", @@ -1290,8 +1295,7 @@ public abstract class InfoPanel extends Window implements EventListener, fireValueChange(event); } else - { - Integer recordId = contentPanel.getSelectedRowKey(); + { int AD_Table_ID = MTable.getTable_ID(p_tableName); if (AD_Table_ID <= 0) { From 9c5505cc77165c1df5f7b1270e893bb4198a20cb Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 12 Mar 2014 21:59:37 -0500 Subject: [PATCH 11/16] IDEMPIERE-1361 Mismatch of layout in the window Tree Maintenance --- .../src/org/adempiere/webui/apps/form/WTreeMaintenance.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeMaintenance.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeMaintenance.java index d2320afacd..e94e5ad239 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeMaintenance.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeMaintenance.java @@ -162,6 +162,7 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController hbox.setStyle("padding: 3px;"); hbox.setAlign("center"); hbox.setHflex("1"); + hbox.setVflex("1"); northPanel.appendChild(hbox); hbox.appendChild (new Space()); From 33a82e8fafe770918a6532bd478b94cd9d53323c Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 12 Mar 2014 22:13:37 -0500 Subject: [PATCH 12/16] IDEMPIERE-1646 Make filter price list (SO/PO) in BP and BP group --- .../oracle/201403122207-IDEMPIERE-1646.sql | 30 +++++++++++++++++++ .../201403122207-IDEMPIERE-1646.sql | 27 +++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 migration/i2.0/oracle/201403122207-IDEMPIERE-1646.sql create mode 100644 migration/i2.0/postgresql/201403122207-IDEMPIERE-1646.sql diff --git a/migration/i2.0/oracle/201403122207-IDEMPIERE-1646.sql b/migration/i2.0/oracle/201403122207-IDEMPIERE-1646.sql new file mode 100644 index 0000000000..a093e1c67a --- /dev/null +++ b/migration/i2.0/oracle/201403122207-IDEMPIERE-1646.sql @@ -0,0 +1,30 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Dec 26, 2013 10:24:08 PM ICT +-- IDEMPIERE-1646 Make filter price list (SO/PO) in BP and BP group +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Description,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES ('M_PriceList.IsSOPriceList = ''Y'' AND (SELECT COUNT(*) FROM M_PriceList_Version WHERE M_PriceList.M_PriceList_ID=M_PriceList_Version.M_PriceList_ID AND M_PriceList_Version.IsActive=''Y'')>0',200057,'D','M_PriceList is SO','Limits the Sales & Purchase Order window to the correct price lsits','S','83715776-17dc-4e3c-87c2-3d638e43136a',100,100,TO_DATE('2013-12-26 22:24:08','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2013-12-26 22:24:08','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Dec 26, 2013 10:24:45 PM ICT +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Description,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES ('M_PriceList.IsSOPriceList = ''N'' AND (SELECT COUNT(*) FROM M_PriceList_Version WHERE M_PriceList.M_PriceList_ID=M_PriceList_Version.M_PriceList_ID AND M_PriceList_Version.IsActive=''Y'')>0',200058,'D','M_PriceList is PO','Limits the Sales & Purchase Order window to the correct price lsits','S','efc89c8e-b74b-4ded-85b1-d266fa967194',100,100,TO_DATE('2013-12-26 22:24:45','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2013-12-26 22:24:45','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Dec 26, 2013 10:25:20 PM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200057,Updated=TO_DATE('2013-12-26 22:25:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2930 +; + +-- Dec 26, 2013 10:26:04 PM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200058,Updated=TO_DATE('2013-12-26 22:26:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2931 +; + +-- Dec 27, 2013 10:32:02 AM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200058,Updated=TO_DATE('2013-12-27 10:32:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14637 +; + +-- Dec 27, 2013 10:32:10 AM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200057,Updated=TO_DATE('2013-12-27 10:32:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14636 +; + +SELECT register_migration_script('201403122207-IDEMPIERE-1646.sql') FROM dual +; diff --git a/migration/i2.0/postgresql/201403122207-IDEMPIERE-1646.sql b/migration/i2.0/postgresql/201403122207-IDEMPIERE-1646.sql new file mode 100644 index 0000000000..cc037c1f56 --- /dev/null +++ b/migration/i2.0/postgresql/201403122207-IDEMPIERE-1646.sql @@ -0,0 +1,27 @@ +-- Dec 26, 2013 10:24:08 PM ICT +-- IDEMPIERE-1646 Make filter price list (SO/PO) in BP and BP group +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Description,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES ('M_PriceList.IsSOPriceList = ''Y'' AND (SELECT COUNT(*) FROM M_PriceList_Version WHERE M_PriceList.M_PriceList_ID=M_PriceList_Version.M_PriceList_ID AND M_PriceList_Version.IsActive=''Y'')>0',200057,'D','M_PriceList is SO','Limits the Sales & Purchase Order window to the correct price lsits','S','83715776-17dc-4e3c-87c2-3d638e43136a',100,100,TO_TIMESTAMP('2013-12-26 22:24:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2013-12-26 22:24:08','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Dec 26, 2013 10:24:45 PM ICT +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Description,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES ('M_PriceList.IsSOPriceList = ''N'' AND (SELECT COUNT(*) FROM M_PriceList_Version WHERE M_PriceList.M_PriceList_ID=M_PriceList_Version.M_PriceList_ID AND M_PriceList_Version.IsActive=''Y'')>0',200058,'D','M_PriceList is PO','Limits the Sales & Purchase Order window to the correct price lsits','S','efc89c8e-b74b-4ded-85b1-d266fa967194',100,100,TO_TIMESTAMP('2013-12-26 22:24:45','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2013-12-26 22:24:45','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Dec 26, 2013 10:25:20 PM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200057,Updated=TO_TIMESTAMP('2013-12-26 22:25:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2930 +; + +-- Dec 26, 2013 10:26:04 PM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200058,Updated=TO_TIMESTAMP('2013-12-26 22:26:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2931 +; + +-- Dec 27, 2013 10:32:02 AM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200058,Updated=TO_TIMESTAMP('2013-12-27 10:32:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14637 +; + +-- Dec 27, 2013 10:32:10 AM ICT +UPDATE AD_Column SET AD_Val_Rule_ID=200057,Updated=TO_TIMESTAMP('2013-12-27 10:32:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14636 +; + +SELECT register_migration_script('201403122207-IDEMPIERE-1646.sql') FROM dual +; From 18e66c603582afcc28e8fa75ba0a8d8217b11999 Mon Sep 17 00:00:00 2001 From: hieplq Date: Mon, 10 Feb 2014 01:13:44 +0700 Subject: [PATCH 13/16] IDEMPIERE-1712:Field "Event Change Log" of "Change Audit" window is not read only. --- migration/i2.0/oracle/201402101604-IDEMPIERE-1712.sql | 10 ++++++++++ .../i2.0/postgresql/201402101604-IDEMPIERE-1712.sql | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 migration/i2.0/oracle/201402101604-IDEMPIERE-1712.sql create mode 100644 migration/i2.0/postgresql/201402101604-IDEMPIERE-1712.sql diff --git a/migration/i2.0/oracle/201402101604-IDEMPIERE-1712.sql b/migration/i2.0/oracle/201402101604-IDEMPIERE-1712.sql new file mode 100644 index 0000000000..6a33b6f4d9 --- /dev/null +++ b/migration/i2.0/oracle/201402101604-IDEMPIERE-1712.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Feb 10, 2014 1:01:33 AM ICT +-- IDEMPIERE-1712:Field "Event Change Log" of "Change Audit" window is not read only. +UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2014-02-10 01:01:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54397 +; + +SELECT register_migration_script('201402101604-IDEMPIERE-1712.sql') FROM dual +; diff --git a/migration/i2.0/postgresql/201402101604-IDEMPIERE-1712.sql b/migration/i2.0/postgresql/201402101604-IDEMPIERE-1712.sql new file mode 100644 index 0000000000..1a7634e43b --- /dev/null +++ b/migration/i2.0/postgresql/201402101604-IDEMPIERE-1712.sql @@ -0,0 +1,7 @@ +-- Feb 10, 2014 1:01:33 AM ICT +-- IDEMPIERE-1712:Field "Event Change Log" of "Change Audit" window is not read only. +UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2014-02-10 01:01:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54397 +; + +SELECT register_migration_script('201402101604-IDEMPIERE-1712.sql') FROM dual +; From 4740efdb9071d325dd0c1466ff35399df848d96d Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 6 Feb 2014 20:35:53 +0700 Subject: [PATCH 14/16] IDEMPIERE-1738: - at allocate, invoice_id don't set into env varial, because some callout is stop working --- .../src/org/compiere/model/CalloutPaymentAllocate.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java index 30d5ff6c21..f02ea7bdd1 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java @@ -109,7 +109,7 @@ public class CalloutPaymentAllocate extends CalloutEngine mTab.setValue("Amount", InvoiceOpen.subtract(DiscountAmt)); mTab.setValue("DiscountAmt", DiscountAmt); // reset as dependent fields get reset - Env.setContext(ctx, WindowNo, "C_Invoice_ID", C_Invoice_ID.toString()); + Env.setContext(ctx, WindowNo, mTab.getTabNo(), "C_Invoice_ID", C_Invoice_ID.toString()); mTab.setValue("C_Invoice_ID", C_Invoice_ID); } } @@ -146,8 +146,8 @@ public class CalloutPaymentAllocate extends CalloutEngine { if (isCalloutActive()) // assuming it is resetting value return ""; - // No Invoice - int C_Invoice_ID = Env.getContextAsInt(ctx, WindowNo, "C_Invoice_ID"); + // No Invoice + int C_Invoice_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_Invoice_ID"); if (C_Invoice_ID == 0) return ""; // Get Info from Tab @@ -173,8 +173,8 @@ public class CalloutPaymentAllocate extends CalloutEngine // PayAmt - calculate write off if (colName.equals("Amount")) { - WriteOffAmt = InvoiceAmt.subtract(Amount).subtract(DiscountAmt).subtract(OverUnderAmt); - mTab.setValue("WriteOffAmt", WriteOffAmt); + OverUnderAmt = InvoiceAmt.subtract(Amount).subtract(DiscountAmt).subtract(WriteOffAmt); + mTab.setValue("OverUnderAmt", OverUnderAmt); } else // calculate Amount { From fa857fd070a8b1394d6a7087464e1c604d9f4234 Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 7 Mar 2014 14:55:18 +0700 Subject: [PATCH 15/16] IDEMPIERE-1701:when make new detail make head change, can't make more detail (requirement requery) --- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 3a67f9b6d9..4066966421 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -1925,6 +1925,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { String statusLine = statusBar.getStatusLine(); adTabbox.getSelectedGridTab().dataRefreshAll(true, true); + adTabbox.getSelectedGridTab().refreshParentTabs(); statusBar.setStatusLine(statusLine); } if (dirtyTabpanel != null) { From fe51afaaa29b066086b512625bc7571b602050ad Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Mar 2014 22:53:05 -0500 Subject: [PATCH 16/16] IDEMPIERE-1701 Apply same patch from hiep for SaveCreate, Delete, DeleteSelection and Process --- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 4066966421..cb8e9d9f1a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -1656,6 +1656,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements IADTabpanel headerTab = adTabbox.getSelectedTabpanel(); IADTabpanel detailTab = adTabbox.getSelectedDetailADTabpanel(); adTabbox.getSelectedGridTab().dataRefreshAll(fireEvent, true); + adTabbox.getSelectedGridTab().refreshParentTabs(); headerTab.dynamicDisplay(0); if (detailTab != null) { @@ -2089,6 +2090,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if(result) { adTabbox.getSelectedGridTab().dataRefreshAll(true, true); + adTabbox.getSelectedGridTab().refreshParentTabs(); IADTabpanel dirtyTabpanel = (IADTabpanel) Executions.getCurrent().removeAttribute("adtabpane.saved"); if (dirtyTabpanel != null && dirtyTabpanel.getGridTab().isDetail()) { try { @@ -2131,6 +2133,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { //error will be catch in the dataStatusChanged event adTabbox.getSelectedGridTab().dataDelete(); + adTabbox.getSelectedGridTab().refreshParentTabs(); adTabbox.getSelectedTabpanel().dynamicDisplay(0); focusToActivePanel(); @@ -2170,6 +2173,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements count++; } } + adTabbox.getSelectedGridTab().refreshParentTabs(); adTabbox.getSelectedTabpanel().dynamicDisplay(0); statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "Deleted")+": "+count, false);