From 09aed5f42f6df71b42b445a9c719076e463373ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 4 Sep 2013 14:45:52 -0500 Subject: [PATCH 1/4] IDEMPIERE-1329 Images are being saved with EntityType=D --- .../oracle/201309041432_IDEMPIERE-1329.sql | 15 +++++++++++++++ .../postgresql/201309041432_IDEMPIERE-1329.sql | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migration/i1.0c-release/oracle/201309041432_IDEMPIERE-1329.sql create mode 100644 migration/i1.0c-release/postgresql/201309041432_IDEMPIERE-1329.sql diff --git a/migration/i1.0c-release/oracle/201309041432_IDEMPIERE-1329.sql b/migration/i1.0c-release/oracle/201309041432_IDEMPIERE-1329.sql new file mode 100644 index 0000000000..c33884d2ba --- /dev/null +++ b/migration/i1.0c-release/oracle/201309041432_IDEMPIERE-1329.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Sep 4, 2013 2:23:31 PM COT +-- IDEMPIERE-1329 Images are being saved with EntityType=D +ALTER TABLE AD_Image MODIFY EntityType VARCHAR2(40) DEFAULT 'U' +; + +-- Sep 4, 2013 2:23:32 PM COT +UPDATE AD_Image SET EntityType='U' WHERE EntityType IS NULL OR (EntityType='D' AND AD_Image_ID>=1000000) +; + +SELECT register_migration_script('201309041432_IDEMPIERE-1329.sql') FROM dual +; + diff --git a/migration/i1.0c-release/postgresql/201309041432_IDEMPIERE-1329.sql b/migration/i1.0c-release/postgresql/201309041432_IDEMPIERE-1329.sql new file mode 100644 index 0000000000..d2a366ad7d --- /dev/null +++ b/migration/i1.0c-release/postgresql/201309041432_IDEMPIERE-1329.sql @@ -0,0 +1,12 @@ +-- Sep 4, 2013 2:23:31 PM COT +-- IDEMPIERE-1329 Images are being saved with EntityType=D +INSERT INTO t_alter_column values('ad_image','EntityType','VARCHAR(40)',null,'U') +; + +-- Sep 4, 2013 2:23:32 PM COT +UPDATE AD_Image SET EntityType='U' WHERE EntityType IS NULL OR (EntityType='D' AND AD_Image_ID>=1000000) +; + +SELECT register_migration_script('201309041432_IDEMPIERE-1329.sql') FROM dual +; + From 418a9474864c9cbccbe763cc66726d2e1fb81d6c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 4 Sep 2013 18:43:36 -0500 Subject: [PATCH 2/4] IDEMPIERE-1321 Attachment panel title is hardcoded (Based on Nicolas Micoud patch) --- .../WEB-INF/src/org/adempiere/webui/panel/WAttachment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java index 1581a1311d..6f41ab7d51 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java @@ -219,7 +219,7 @@ public class WAttachment extends Window implements EventListener this.setMaximizable(true); this.setWidth("700px"); this.setHeight("85%"); - this.setTitle("Attachment"); + this.setTitle(Msg.getMsg(Env.getCtx(), "Attachment")); this.setClosable(true); this.setSizable(true); this.setBorder("normal"); From f632c150f9e3c975fb97203c30703dfc9f18c3e1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 4 Sep 2013 19:18:13 -0500 Subject: [PATCH 3/4] IDEMPIERE-1320 problem reported with calculator and arithmetic separator , --- org.adempiere.ui.zk/js/calc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/js/calc.js b/org.adempiere.ui.zk/js/calc.js index 2e28aee360..ee35c0b3ed 100644 --- a/org.adempiere.ui.zk/js/calc.js +++ b/org.adempiere.ui.zk/js/calc.js @@ -96,7 +96,7 @@ function Calc() var value = calcText.value; if (separator != '.') { - var re = new RegExp("[" + separator + "]"); + var re = new RegExp("[" + separator + "]", "g"); value = value.replace(re,'.'); } var result = "" + eval(value); From be08ddbc05d093bc6e218922d17960ef842aa616 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 4 Sep 2013 19:34:46 -0500 Subject: [PATCH 4/4] IDEMPIERE-1314 getDocumentInfo methods should return translated String (Based on patch from Nicolas Micoud) --- .../src/org/compiere/model/MDocType.java | 12 +++++++++++- .../src/org/compiere/model/MInOut.java | 2 +- .../src/org/compiere/model/MInventory.java | 2 +- .../src/org/compiere/model/MInvoice.java | 2 +- .../src/org/compiere/model/MJournal.java | 2 +- .../src/org/compiere/model/MJournalBatch.java | 2 +- .../src/org/compiere/model/MMovement.java | 2 +- .../src/org/compiere/model/MOrder.java | 2 +- .../src/org/compiere/model/MPayment.java | 2 +- org.adempiere.base/src/org/compiere/model/MRMA.java | 2 +- .../src/org/compiere/process/DocActionTemplate.java | 2 +- .../src/org/eevolution/model/MDDOrder.java | 2 +- 12 files changed, 22 insertions(+), 12 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MDocType.java b/org.adempiere.base/src/org/compiere/model/MDocType.java index c48daad779..95eae88f4d 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocType.java +++ b/org.adempiere.base/src/org/compiere/model/MDocType.java @@ -41,7 +41,7 @@ public class MDocType extends X_C_DocType /** * */ - private static final long serialVersionUID = 2641885482012907072L; + private static final long serialVersionUID = -6556521509479670059L; /** * Return the first Doc Type for this BaseType @@ -357,4 +357,14 @@ public class MDocType extends X_C_DocType return relatedDocTypeId; } + + /** + * Get translated doctype name + * @return Name if available translated + */ + public String getNameTrl() + { + return get_Translation (COLUMNNAME_Name, Env.getAD_Language(getCtx())); + } // getNameTrl + } // MDocType diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index c68d731039..6414e9215b 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -591,7 +591,7 @@ public class MInOut extends X_M_InOut implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(" ").append(getDocumentNo()); + StringBuilder msgreturn = new StringBuilder().append(dt.getNameTrl()).append(" ").append(getDocumentNo()); return msgreturn.toString(); } // getDocumentInfo diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java index e3c8ad4fd4..275fae9c4d 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventory.java +++ b/org.adempiere.base/src/org/compiere/model/MInventory.java @@ -204,7 +204,7 @@ public class MInventory extends X_M_Inventory implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(" ").append(getDocumentNo()); + StringBuilder msgreturn = new StringBuilder().append(dt.getNameTrl()).append(" ").append(getDocumentNo()); return msgreturn.toString(); } // getDocumentInfo diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index be7f08cd7a..b410b221ac 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1043,7 +1043,7 @@ public class MInvoice extends X_C_Invoice implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(" ").append(getDocumentNo()); + StringBuilder msgreturn = new StringBuilder().append(dt.getNameTrl()).append(" ").append(getDocumentNo()); return msgreturn.toString(); } // getDocumentInfo diff --git a/org.adempiere.base/src/org/compiere/model/MJournal.java b/org.adempiere.base/src/org/compiere/model/MJournal.java index 147dcb63fc..5c06479477 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournal.java +++ b/org.adempiere.base/src/org/compiere/model/MJournal.java @@ -887,7 +887,7 @@ public class MJournal extends X_GL_Journal implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(" ").append(getDocumentNo()); + StringBuilder msgreturn = new StringBuilder().append(dt.getNameTrl()).append(" ").append(getDocumentNo()); return msgreturn.toString(); } // getDocumentInfo diff --git a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java index 6d2e657b9b..336cbc25f8 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java @@ -808,7 +808,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(" ").append(getDocumentNo()); + StringBuilder msgreturn = new StringBuilder().append(dt.getNameTrl()).append(" ").append(getDocumentNo()); return msgreturn.toString(); } // getDocumentInfo diff --git a/org.adempiere.base/src/org/compiere/model/MMovement.java b/org.adempiere.base/src/org/compiere/model/MMovement.java index eabeaaf9ee..2d2af163f8 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovement.java +++ b/org.adempiere.base/src/org/compiere/model/MMovement.java @@ -153,7 +153,7 @@ public class MMovement extends X_M_Movement implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + return dt.getNameTrl() + " " + getDocumentNo(); } // getDocumentInfo /** diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index aa6eee8924..3a3294c962 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -589,7 +589,7 @@ public class MOrder extends X_C_Order implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID() > 0 ? getC_DocType_ID() : getC_DocTypeTarget_ID()); - return dt.getName() + " " + getDocumentNo(); + return dt.getNameTrl() + " " + getDocumentNo(); } // getDocumentInfo /** diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 9ddd4f33ba..e2debae17a 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -2750,7 +2750,7 @@ public final class MPayment extends X_C_Payment public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + return dt.getNameTrl() + " " + getDocumentNo(); } // getDocumentInfo /** diff --git a/org.adempiere.base/src/org/compiere/model/MRMA.java b/org.adempiere.base/src/org/compiere/model/MRMA.java index 3cd3cb2e70..5064a69307 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMA.java +++ b/org.adempiere.base/src/org/compiere/model/MRMA.java @@ -203,7 +203,7 @@ public class MRMA extends X_M_RMA implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + return dt.getNameTrl() + " " + getDocumentNo(); } // getDocumentInfo /** diff --git a/org.adempiere.base/src/org/compiere/process/DocActionTemplate.java b/org.adempiere.base/src/org/compiere/process/DocActionTemplate.java index ce10dccbfa..df0c3d5a39 100644 --- a/org.adempiere.base/src/org/compiere/process/DocActionTemplate.java +++ b/org.adempiere.base/src/org/compiere/process/DocActionTemplate.java @@ -70,7 +70,7 @@ public class DocActionTemplate extends PO implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), 0); - return dt.getName() + " " + getDocumentNo(); + return dt.getNameTrl() + " " + getDocumentNo(); } // getDocumentInfo /** diff --git a/org.adempiere.base/src/org/eevolution/model/MDDOrder.java b/org.adempiere.base/src/org/eevolution/model/MDDOrder.java index b97fdcc78b..94b955d2e9 100644 --- a/org.adempiere.base/src/org/eevolution/model/MDDOrder.java +++ b/org.adempiere.base/src/org/eevolution/model/MDDOrder.java @@ -387,7 +387,7 @@ public class MDDOrder extends X_DD_Order implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + return dt.getNameTrl() + " " + getDocumentNo(); } // getDocumentInfo /**