Subversion Repositories SmartDukaan

Rev

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

Rev 5866 Rev 5885
Line 37... Line 37...
37
from shop2020.clients.CatalogClient import CatalogClient
37
from shop2020.clients.CatalogClient import CatalogClient
38
 
38
 
39
to_addresses = ["cnc.center@shop2020.in", "ashutosh.saxena@shop2020.in"]
39
to_addresses = ["cnc.center@shop2020.in", "ashutosh.saxena@shop2020.in"]
40
from_user = "cnc.center@shop2020.in"
40
from_user = "cnc.center@shop2020.in"
41
from_pwd = "5h0p2o2o"
41
from_pwd = "5h0p2o2o"
-
 
42
skippedItems = { 175 : [27, 2160, 2175, 2163, 2158, 7128, 26, 2154],
-
 
43
                 193 : [5839] }
42
 
44
 
43
def initialize(dbname='catalog', db_hostname="localhost"):
45
def initialize(dbname='catalog', db_hostname="localhost"):
44
    DataService.initialize(dbname, db_hostname)
46
    DataService.initialize(dbname, db_hostname)
45
    
47
    
46
def get_all_items_by_status(status, offset=0, limit=None):
48
def get_all_items_by_status(status, offset=0, limit=None):
Line 1907... Line 1909...
1907
 
1909
 
1908
def reset_availability(itemKey, vendorId, quantity, warehouseId):
1910
def reset_availability(itemKey, vendorId, quantity, warehouseId):
1909
    vendorItemMapping = VendorItemMapping.get_by(vendor_id = vendorId, item_key = itemKey)
1911
    vendorItemMapping = VendorItemMapping.get_by(vendor_id = vendorId, item_key = itemKey)
1910
    if vendorItemMapping:
1912
    if vendorItemMapping:
1911
        itemId = vendorItemMapping.item_id
1913
        itemId = vendorItemMapping.item_id
-
 
1914
 
-
 
1915
        if skippedItems.has_key(warehouseId) and itemId in skippedItems[warehouseId]:
-
 
1916
            quantity = 0
-
 
1917
 
1912
        currentInventorySnapshot = CurrentInventorySnapshot.get_by(item_id = itemId, warehouse_id = warehouseId)
1918
        currentInventorySnapshot = CurrentInventorySnapshot.get_by(item_id = itemId, warehouse_id = warehouseId)
1913
        if currentInventorySnapshot:
1919
        if currentInventorySnapshot:
1914
            currentInventorySnapshot.availability = quantity
1920
            currentInventorySnapshot.availability = quantity
1915
            __update_item_availability_cache(itemId) 
1921
            __update_item_availability_cache(itemId) 
1916
            check_risky_item(currentInventorySnapshot.item)
1922
            check_risky_item(currentInventorySnapshot.item)