Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7094

While creating inventory item of type "SERIALIZED_INV_ITEM" in "INV_ON_HOLD" status it gets created in "INV_AVAILABLE" status

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Release Branch 13.07, Release Branch 14.12, Release Branch 15.12, Trunk
    • 14.12.01, 15.12.01, 13.07.04
    • product
    • None

    Description

      Use Case: When we create a serialized inventory item and the serial number is not provided, it should be created in "INV_ON_HOLD" status to exclude this item from being count in ATP.

      As per the current implementation in service receiveInventoryProduct if status provided is "INV_ON_HOLD" for inventory item of type "SERIALIZED_INV_ITEM" it should not update to "INV_AVAILABLE" but it's not working expectedly. Here is the logic to check for the same:

                  <if>
                      <condition>
                          <and>
                              <if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="parameters.inventoryItemTypeId"/>
                              <if-empty field="parameters.returnId"/>
                          </and>
                      </condition>
                      <then>
                          <!-- Retrieve the new inventoryItem -->
                          <entity-one entity-name="InventoryItem" value-field="inventoryItem">
                              <field-map field-name="inventoryItemId" from-field="currentInventoryItemId"/>
                          </entity-one>
      
                          <!-- Don't reset the status if it's already set to INV_PROMISED or INV_ON_HOLD -->
                          <if>
                              <condition>
                                  <and>
                                      <if-compare value="INV_PROMISED" operator="not-equals" field="inventoryItem.statusId"/>
                                      <if-compare value="INV_ON_HOLD" operator="not-equals" field="inventoryItem.statusId"/>
                                  </and>
                              </condition>
                              <then>
                                  <clear-field field="serviceInMap"/>
                                  <set field="serviceInMap.inventoryItemId" from-field="currentInventoryItemId"/>
                                  <set field="serviceInMap.statusId" value="INV_AVAILABLE"/> <!-- XXX set to returned instead -->
                                  <call-service service-name="updateInventoryItem" in-map-name="serviceInMap"/>
                              </then>
                          </if>
                      </then>
                  </if>
      

      Attachments

        1. OFBIZ-7094.patch
          0.9 kB
          Aditi Patidar

        Activity

          People

            pandeypranay Pranay Pandey
            aditi17 Aditi Patidar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: