svn commit: r1839653 - /ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1839653 - /ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml

Deepak Dixit-5
Author: deepak
Date: Thu Aug 30 09:27:04 2018
New Revision: 1839653

URL: http://svn.apache.org/viewvc?rev=1839653&view=rev
Log:
Improved: Removed extra unused code to set the fromDate to avoid duplicate PK in case of mysql. As mysql added support to store Fractional Seconds in Time Values, this has been fixed under OFBIZ-9337

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml?rev=1839653&r1=1839652&r2=1839653&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/minilang/product/cost/CostServices.xml Thu Aug 30 09:27:04 2018
@@ -559,16 +559,8 @@ under the License.
             <calculate field="productAverageCostMap.averageCost" type="BigDecimal" decimal-scale="${roundingDecimals}" rounding-mode="${roundingMode}">
                 <calcop operator="get" field="productAverageCostMap.averageCost"/>
             </calculate>
-            
-            <!-- ensure that the new ProductAverageCost record has a different PK than the previous one by setting the fromDate to now, plus an offset if needed -->
-            <now-timestamp field="nowTimestamp"/>
-            <set field="timeDiff" value="${groovy: return nowTimestamp.getTime() - productAverageCost.fromDate.getTime()}" type="Long"/>
-            <if-compare field="timeDiff" operator="less-equals" value="1000" type="Long">
-                <set-calendar field="productAverageCostMap.fromDate" from-field="nowTimestamp" seconds="+1"/>
-                <else>
-                    <set field="productAverageCostMap.fromDate" from-field="nowTimestamp"/>
-                </else>
-            </if-compare>
+
+            <now-timestamp field="productAverageCostMap.fromDate"/>
         </else>
         </if-empty>