Author: diveshdutta
Date: Mon Sep  5 17:41:08 2016
New Revision: 1759336

URL: http://svn.apache.org/viewvc?rev=1759336&view=rev
Log:
[OFBIZ-7533] Now user will be able to set new lotId to existing inventory item. 
Thanks Swapnil Shah for reporting the issue and Ankush Upadhyay for providing 
the patch.

Modified:
    
ofbiz/trunk/applications/product/minilang/product/inventory/InventoryServices.xml

Modified: 
ofbiz/trunk/applications/product/minilang/product/inventory/InventoryServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/inventory/InventoryServices.xml?rev=1759336&r1=1759335&r2=1759336&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/minilang/product/inventory/InventoryServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/minilang/product/inventory/InventoryServices.xml
 Mon Sep  5 17:41:08 2016
@@ -302,6 +302,17 @@ under the License.
             </if-compare>
         </if-not-empty>
         <set field="oldUnitCost" from-field="lookedUpValue.unitCost"/>
+        <if-not-empty field="parameters.lotId">
+               <!-- Check if the lot already exists -->
+            <entity-and list="lotList" entity-name="Lot">
+                  <field-map field-name="lotId" from-field="parameters.lotId" 
/>
+            </entity-and>
+            <if-empty field="lotList">
+                <make-value value-field="lot" entity-name="Lot"/>
+                <set field="lot.lotId" from-field="parameters.lotId"/>
+                <create-value value-field="lot"/>
+            </if-empty>
+        </if-not-empty>
         <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
         <store-value value-field="lookedUpValue"/>
         <!-- if the unit cost is changed create an InventoryItemDetail to keep 
track of unit cost history -->


Reply via email to