Subversion Repositories SmartDukaan

Rev

Rev 5731 | Rev 5866 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5731 Rev 5768
Line 1910... Line 1910...
1910
    if vendorItemMapping:
1910
    if vendorItemMapping:
1911
        itemId = vendorItemMapping.item_id
1911
        itemId = vendorItemMapping.item_id
1912
        currentInventorySnapshot = CurrentInventorySnapshot.get_by(item_id = itemId, warehouse_id = warehouseId)
1912
        currentInventorySnapshot = CurrentInventorySnapshot.get_by(item_id = itemId, warehouse_id = warehouseId)
1913
        if currentInventorySnapshot:
1913
        if currentInventorySnapshot:
1914
            currentInventorySnapshot.availability = quantity
1914
            currentInventorySnapshot.availability = quantity
1915
            __update_item_availability_cache(itemId)
1915
            __update_item_availability_cache(itemId) 
1916
            check_risky_item(currentInventorySnapshot.item) 
1916
            check_risky_item(currentInventorySnapshot.item)
1917
        else:
1917
        else:
1918
            add_inventory(itemId, warehouseId, quantity)
1918
            add_inventory(itemId, warehouseId, quantity)
-
 
1919
 
1919
    else:
1920
    else:
1920
        raise InventoryServiceException(101, 'VendorMapping not found for: ' + itemKey)
1921
        raise InventoryServiceException(101, 'VendorMapping not found for: ' + itemKey)
1921
    session.commit()
1922
    session.commit()
1922
 
1923
 
1923
def reset_availability_for_warehouse(warehouseId):
1924
def reset_availability_for_warehouse(warehouseId):