Subversion Repositories SmartDukaan

Rev

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

Rev 6242 Rev 6467
Line 785... Line 785...
785
    for currentInventorySnapshot in CurrentInventorySnapshot.query.filter_by(warehouse_id=warehouseId).all():
785
    for currentInventorySnapshot in CurrentInventorySnapshot.query.filter_by(warehouse_id=warehouseId).all():
786
        currentInventorySnapshot.availability = 0
786
        currentInventorySnapshot.availability = 0
787
        clear_item_availability_cache(currentInventorySnapshot.item_id) 
787
        clear_item_availability_cache(currentInventorySnapshot.item_id) 
788
    session.commit()
788
    session.commit()
789
 
789
 
-
 
790
def get_our_warehouse_id_for_vendor(vendor_id):
-
 
791
    try:
-
 
792
        warehouse = Warehouse.query.filter_by(vendor_id = vendor_id, warehouseType = 'OURS', inventoryType = 'GOOD').first()
-
 
793
        return warehouse.id
-
 
794
    except Exception as e:
-
 
795
        print e;
-
 
796
        raise InventoryServiceException(101, 'No our warehouse found for vendorId: ' + vendor_id)
790
    
797
    
791
def __send_mail(subject, message):
798
def __send_mail(subject, message):
792
    try:
799
    try:
793
        thread = threading.Thread(target=partial(mail, mail_user, mail_password, to_addresses, subject, message))
800
        thread = threading.Thread(target=partial(mail, mail_user, mail_password, to_addresses, subject, message))
794
        thread.start()
801
        thread.start()