Subversion Repositories SmartDukaan

Rev

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

Rev 5408 Rev 5421
Line 597... Line 597...
597
def check_risky_item(item):
597
def check_risky_item(item):
598
    if not item.risky:
598
    if not item.risky:
599
        return
599
        return
600
    warehouse_id = get_item_availability_for_location(item.id)[0]
600
    warehouse_id = get_item_availability_for_location(item.id)[0]
601
    currentInventorySnapshot = CurrentInventorySnapshot.query.filter_by(item_id = item.id, warehouse_id = warehouse_id).all()
601
    currentInventorySnapshot = CurrentInventorySnapshot.query.filter_by(item_id = item.id, warehouse_id = warehouse_id).all()
602
    if not currentInventorySnapshot or currentInventorySnapshot[0].availability <= currentInventorySnapshot[0].reserved:
602
    if not currentInventorySnapshot or currentInventorySnapshot[0].availibility <= currentInventorySnapshot[0].reserved:
603
        if item.status == status.ACTIVE:
603
        if item.status == status.ACTIVE:
604
            change_item_status(item.id, status.PAUSED_BY_RISK)
604
            change_item_status(item.id, status.PAUSED_BY_RISK)
605
            __send_mail_for_oos_item(item)
605
            __send_mail_for_oos_item(item)
606
    else:
606
    else:
607
        if item.status == status.PAUSED_BY_RISK:
607
        if item.status == status.PAUSED_BY_RISK: