details: /erp/devel/pi/rev/325becdccad4
changeset: 13097:325becdccad4
user: Asier Lostalé <asier.lostale <at> openbravo.com>
date: Tue Jul 05 09:18:16 2011 +0200
summary: fixed bug 17879: Error while activating the instance
Removed preference defined in core for hidding/showing production fields.
This preference is now set as part of instance configuration.
diffstat:
src-db/database/sourcedata/AD_PREFERENCE.xml | 11 -----------
src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java | 12 ++++++++++--
2 files changed, 10 insertions(+), 13 deletions(-)
diffs (55 lines):
diff -r 42397bb1ab82 -r 325becdccad4
src-db/database/sourcedata/AD_PREFERENCE.xml
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml Mon Jul 04 15:01:49
2011 +0200
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml Tue Jul 05 09:18:16
2011 +0200
@@ -1727,15 +1727,4 @@
<!--9B4A5EB69793A841E040A8C0E1077381-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--9B4A5EB69793A841E040A8C0E1077381--></AD_PREFERENCE>
-<!--FF80818130E5777B0130E57AFC890006--><AD_PREFERENCE>
-<!--FF80818130E5777B0130E57AFC890006-->
<AD_PREFERENCE_ID><![CDATA[FF80818130E5777B0130E57AFC890006]]></AD_PREFERENCE_ID>
-<!--FF80818130E5777B0130E57AFC890006-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--FF80818130E5777B0130E57AFC890006--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--FF80818130E5777B0130E57AFC890006--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF80818130E5777B0130E57AFC890006--> <VALUE><![CDATA[N]]></VALUE>
-<!--FF80818130E5777B0130E57AFC890006-->
<PROPERTY><![CDATA[showMRPandProductionFields]]></PROPERTY>
-<!--FF80818130E5777B0130E57AFC890006-->
<ISPROPERTYLIST><![CDATA[Y]]></ISPROPERTYLIST>
-<!--FF80818130E5777B0130E57AFC890006-->
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--FF80818130E5777B0130E57AFC890006--></AD_PREFERENCE>
-
</data>
diff -r 42397bb1ab82 -r 325becdccad4
src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java
--- a/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java Mon Jul
04 15:01:49 2011 +0200
+++ b/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java Tue Jul
05 09:18:16 2011 +0200
@@ -24,11 +24,13 @@
import org.apache.log4j.Logger;
import org.hibernate.Query;
+import org.openbravo.base.provider.OBProvider;
import org.openbravo.dal.core.OBContext;
import org.openbravo.dal.service.OBDal;
import org.openbravo.erpCommon.ad_forms.MaturityLevel;
import org.openbravo.erpCommon.utility.HttpsUtils;
import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.model.ad.domain.Preference;
import org.openbravo.model.ad.module.Module;
import org.openbravo.model.ad.system.System;
import org.openbravo.model.ad.system.SystemInformation;
@@ -100,10 +102,16 @@
}
public static void updateShowProductionFields(String value) {
- String hql = "update ADPreference set searchKey = :value where property =
'showMRPandProductionFields'";
+ String hql = "update ADPreference set searchKey = :value where property =
'showMRPandProductionFields' and module.id is null";
Query q = OBDal.getInstance().getSession().createQuery(hql);
q.setParameter("value", value);
- q.executeUpdate();
+ int numRows = q.executeUpdate();
+ if ("Y".equals(value) && numRows == 0) {
+ Preference pref = OBProvider.getInstance().get(Preference.class);
+ pref.setProperty("showMRPandProductionFields");
+ pref.setSearchKey(value);
+ OBDal.getInstance().save(pref);
+ }
}
/**
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits