details: https://code.openbravo.com/erp/devel/pi/rev/edbcd9f7b55c changeset: 35538:edbcd9f7b55c user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Fri Mar 15 11:53:09 2019 +0100 summary: fixed bug 40385: reset available updates when activating a community instance
as in this process maturity status for updates in increased to confirmed stable if there were updates for lower status they might now be invalid. diffstat: src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java | 15 +++++++++++- 1 files changed, 13 insertions(+), 2 deletions(-) diffs (41 lines): diff -r 04228a5d2a51 -r edbcd9f7b55c src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java --- a/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java Fri Mar 15 08:32:02 2019 +0100 +++ b/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java Fri Mar 15 11:53:09 2019 +0100 @@ -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) 2009-2018 Openbravo SLU + * All portions are Copyright (C) 2009-2019 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -36,6 +36,7 @@ import org.openbravo.dal.service.OBDal; import org.openbravo.erpCommon.ad_forms.MaturityLevel; import org.openbravo.erpCommon.ad_process.HeartbeatProcess; +import org.openbravo.erpCommon.obps.ActivationKey.LicenseClass; import org.openbravo.erpCommon.utility.HttpsUtils; import org.openbravo.erpCommon.utility.OBError; import org.openbravo.erpCommon.utility.SystemInfo; @@ -124,9 +125,19 @@ // community to a professional license // See issue https://issues.openbravo.com/view.php?id=21251 String newLicenseClass = ActivationKey.getInstance().getLicenseClass().getCode(); - if ("C".equals(previousLicenseClass) && "STD".equals(newLicenseClass)) { + if (LicenseClass.COMMUNITY.getCode().equals(previousLicenseClass) + && LicenseClass.STD.getCode().equals(newLicenseClass)) { sysInfo.setMaturitySearch(Integer.toString(MaturityLevel.CS_MATURITY)); sysInfo.setMaturityUpdate(Integer.toString(MaturityLevel.CS_MATURITY)); + + int modUpdatesReset = OBDal.getInstance() + .getSession() + .createQuery("update ADModule set availableUpdate = null, upgradeAvailable = null " + + "where availableUpdate is not null or upgradeAvailable is not null") + .executeUpdate(); + log.info( + "Module maturity for updats and search set to Confirmed Stable. Reset {} module available updates.", + modUpdatesReset); } updateShowProductionFields("Y"); _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits