Related to issue 22960: prevent API change, restore getDepreciatedFlag method
authorMikel Irurita <mikel.irurita@openbravo.com>
Sun, 03 Feb 2013 20:41:23 +0100
changeset 19549 1f5944baa2ee
parent 19548 4fe8031ec240
child 19550 aef37974346f
Related to issue 22960: prevent API change, restore getDepreciatedFlag method
src/org/openbravo/erpCommon/ad_callouts/SL_Depreciate.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Depreciate.java	Sun Feb 03 19:24:14 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Depreciate.java	Sun Feb 03 20:41:23 2013 +0100
@@ -49,4 +49,14 @@
     }
   }
 
+  protected Boolean getDepreciatedFlag(final String assetCategoryID) {
+    OBContext.setAdminMode();
+    try {
+      final AssetGroup assetCategory = OBDal.getInstance().get(AssetGroup.class, assetCategoryID);
+      return (assetCategory == null ? Boolean.FALSE : assetCategory.isDepreciate());
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
 }