Fixes issue 22927: Wrong costing calculation
authorJavier Etxarri <javier.echarri@openbravo.com>
Thu, 31 Jan 2013 12:59:43 +0100
changeset 19531 4d7f1c1ef0c6
parent 19530 a7dea24ffd6d
child 19532 fb881e8712be
Fixes issue 22927: Wrong costing calculation
of Production Products with Standard Costing Algorithm
src/org/openbravo/costing/CostingServer.java
--- a/src/org/openbravo/costing/CostingServer.java	Thu Jan 31 10:22:23 2013 +0100
+++ b/src/org/openbravo/costing/CostingServer.java	Thu Jan 31 12:59:43 2013 +0100
@@ -108,7 +108,8 @@
         .getCostingAlgorithm();
     // FIXME: remove when manufacturing costs are fully migrated
     // In case the product is Manufacturing type it is forced to use Average Algorithm
-    if (transaction.getProduct().isProduction()) {
+    if (transaction.getProduct().isProduction()
+        && costAlgorithm.getJavaClassName() != "org.openbravo.costing.StandardAlgorithm") {
       OBQuery<org.openbravo.model.materialmgmt.cost.CostingAlgorithm> caQry = OBDal.getInstance()
           .createQuery(
               org.openbravo.model.materialmgmt.cost.CostingAlgorithm.class,