details: https://code.openbravo.com/erp/devel/pi/rev/ed42f9732da4 changeset: 29716:ed42f9732da4 user: Sanjota <sanjota.nelagi <at> promantia.com> date: Thu Jun 30 12:35:54 2016 +0200 summary: Fixes issue 33375: Error! tag shown instead of Organization
Error! tag shown instead of Organization in Initial Organization Setup success message. details: https://code.openbravo.com/erp/devel/pi/rev/b7e087925687 changeset: 29717:b7e087925687 user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Thu Jun 30 13:17:45 2016 +0200 summary: Related to issue 33375: Code review improvements diffstat: src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java | 4 ++-- src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diffs (47 lines): diff -r edafa9b0e0b0 -r b7e087925687 src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java --- a/src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java Thu Jun 30 12:42:50 2016 +0200 +++ b/src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java Thu Jun 30 13:17:45 2016 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2010-2014 Openbravo SLU + * All portions are Copyright (C) 2010-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -152,7 +152,7 @@ if (!obResult.getType().equals(OKTYPE)) return obResult; obResult.setType(ERRORTYPE); - logEvent(InitialSetupUtility.getTranslatedColumnName(language, "AD_Org_ID") + "=" + logEvent(InitialSetupUtility.getTranslatedElement(language, "AD_Org_ID", "Organization") + "=" + org.getName()); String strOrgId = org.getId(); diff -r edafa9b0e0b0 -r b7e087925687 src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java --- a/src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java Thu Jun 30 12:42:50 2016 +0200 +++ b/src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java Thu Jun 30 13:17:45 2016 +0200 @@ -2104,6 +2104,10 @@ } public static String getTranslatedColumnName(Language language, String columnName) { + return getTranslatedElement(language, columnName, null); + } + + public static String getTranslatedElement(Language language, String columnName, String elementName) { OBContext.setAdminMode(); try { OBCriteria<org.openbravo.model.ad.ui.Element> obcElement = OBDal.getInstance() @@ -2112,6 +2116,11 @@ obcElement.setFilterOnReadableOrganization(false); obcElement.add(Restrictions.eq(org.openbravo.model.ad.ui.Element.PROPERTY_DBCOLUMNNAME, columnName)); + if (StringUtils.isNotEmpty(elementName)) { + obcElement.add(Restrictions + .eq(org.openbravo.model.ad.ui.Element.PROPERTY_NAME, elementName)); + } + obcElement.setMaxResults(1); org.openbravo.model.ad.ui.Element element = (org.openbravo.model.ad.ui.Element) obcElement .uniqueResult(); ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits