Subversion Repositories SmartDukaan

Rev

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

Rev 2341 Rev 2343
Line 528... Line 528...
528
    if warehouse_retid == -1:
528
    if warehouse_retid == -1:
529
        # This is the case when all warehouses have exhausted their
529
        # This is the case when all warehouses have exhausted their
530
        # inventory of this item or no warehouse is available in this
530
        # inventory of this item or no warehouse is available in this
531
        # location.
531
        # location.
532
        warehouse_retid = int(item.preferredWarehouse)
532
        warehouse_retid = int(item.preferredWarehouse)
533
        warehouse = Warehouse.get_by(warehouse_retid)
-
 
534
        try:
533
        try:
-
 
534
            warehouse = Warehouse.get_by(warehouse_retid)
535
            current_inventory_snapshot = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_retid, item_id = item_id).one()
535
            current_inventory_snapshot = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_retid, item_id = item_id).one()
536
            global_availability = current_inventory_snapshot.availibility - current_inventory_snapshot.reserved
536
            global_availability = current_inventory_snapshot.availibility - current_inventory_snapshot.reserved
537
        except:
537
        except:
538
            global_availability = 0
538
            global_availability = 0
539
 
539