Subversion Repositories SmartDukaan

Rev

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

Rev 1155 Rev 1294
Line 414... Line 414...
414
        print "Unexpected error:", sys.exc_info()[0]
414
        print "Unexpected error:", sys.exc_info()[0]
415
        return False
415
        return False
416
    
416
    
417
def mark_item_as_content_complete(entity_id):
417
def mark_item_as_content_complete(entity_id):
418
    content_complete_status = status.CONTENT_COMPLETE
418
    content_complete_status = status.CONTENT_COMPLETE
419
    items = Item.query.filter_by(catalog_item_id=entity_id).all()
419
    items = Item.query.filter_by(catalog_item_id=entity_id, status=status.IN_PROCESS).all()
420
    current_timestamp = datetime.datetime.now()
420
    current_timestamp = datetime.datetime.now()
421
    for item in items:
421
    for item in items:
422
        item_change_log = ItemChangeLog()
422
        item_change_log = ItemChangeLog()
423
        item_change_log.old_status = item.status
423
        item_change_log.old_status = item.status
424
        item_change_log.new_status = content_complete_status
424
        item_change_log.new_status = content_complete_status
Line 427... Line 427...
427
        
427
        
428
        item.status = content_complete_status
428
        item.status = content_complete_status
429
        item.updatedOn = current_timestamp
429
        item.updatedOn = current_timestamp
430
    session.commit()
430
    session.commit()
431
    return True
431
    return True
432
    
432
 
433
def get_item_availability_for_location(warehouse_loc, item_id):
433
def get_item_availability_for_location(warehouse_loc, item_id):
434
    if warehouse_loc is None:
434
    if warehouse_loc is None:
435
        raise InventoryServiceException(101, "Bad Warehouse Location")
435
        raise InventoryServiceException(101, "Bad Warehouse Location")
436
    if not item_id:
436
    if not item_id:
437
        raise InventoryServiceException(101, "Bas Item id")
437
        raise InventoryServiceException(101, "Bas Item id")