| Line 82... |
Line 82... |
| 82 |
if item.risky and availability <= 0 and item.status == status.ACTIVE:
|
82 |
if item.risky and availability <= 0 and item.status == status.ACTIVE:
|
| 83 |
add_status_change_log(item, status.PAUSED_BY_RISK)
|
83 |
add_status_change_log(item, status.PAUSED_BY_RISK)
|
| 84 |
item.status = status.PAUSED_BY_RISK
|
84 |
item.status = status.PAUSED_BY_RISK
|
| 85 |
item.status_description = "This item is currently out of stock"
|
85 |
item.status_description = "This item is currently out of stock"
|
| 86 |
session.commit()
|
86 |
session.commit()
|
| - |
|
87 |
__send_mail_for_oos_item(item)
|
| 87 |
#This will clear cache from tomcat
|
88 |
#This will clear cache from tomcat
|
| 88 |
__clear_homepage_cache()
|
89 |
__clear_homepage_cache()
|
| 89 |
t_item_shipping_info.isActive = (item.status == status.ACTIVE)
|
90 |
t_item_shipping_info.isActive = (item.status == status.ACTIVE)
|
| 90 |
t_item_shipping_info.quantity = availability
|
91 |
t_item_shipping_info.quantity = availability
|
| 91 |
except InventoryServiceException:
|
92 |
except InventoryServiceException:
|
| Line 529... |
Line 530... |
| 529 |
return
|
530 |
return
|
| 530 |
availability = __get_item_availability(item, None)
|
531 |
availability = __get_item_availability(item, None)
|
| 531 |
if availability <= 0:
|
532 |
if availability <= 0:
|
| 532 |
if item.status == status.ACTIVE:
|
533 |
if item.status == status.ACTIVE:
|
| 533 |
change_item_status(item.id, status.PAUSED_BY_RISK)
|
534 |
change_item_status(item.id, status.PAUSED_BY_RISK)
|
| 534 |
try:
|
- |
|
| 535 |
mail("cnc.center@shop2020.in", "5h0p2o2o", ["chaitnaya.vats@shop2020.in", "abhishek.mathur@shop2020.in"], "Item is out of stock. ID: " + str(item.id) + " " + item.brand + " " + item.model_name + " " + item.model_number, " ", [])
|
- |
|
| 536 |
except:
|
- |
|
| 537 |
print "Unable to send the report"
|
535 |
__send_mail_for_oos_item(item)
|
| 538 |
else:
|
536 |
else:
|
| 539 |
if item.status == status.PAUSED_BY_RISK:
|
537 |
if item.status == status.PAUSED_BY_RISK:
|
| 540 |
change_item_status(item.id, status.ACTIVE)
|
538 |
change_item_status(item.id, status.ACTIVE)
|
| 541 |
session.commit()
|
539 |
session.commit()
|
| 542 |
|
540 |
|
| Line 1560... |
Line 1558... |
| 1560 |
authorize_log = AuthorizationLog()
|
1558 |
authorize_log = AuthorizationLog()
|
| 1561 |
authorize_log.item_id = itemId
|
1559 |
authorize_log.item_id = itemId
|
| 1562 |
authorize_log.username = username
|
1560 |
authorize_log.username = username
|
| 1563 |
authorize_log.reason = reason
|
1561 |
authorize_log.reason = reason
|
| 1564 |
session.commit()
|
1562 |
session.commit()
|
| 1565 |
return True
|
- |
|
| 1566 |
|
1563 |
return True
|
| - |
|
1564 |
|
| - |
|
1565 |
def __send_mail_for_oos_item(item):
|
| - |
|
1566 |
try:
|
| - |
|
1567 |
helper_client = HelperClient().get_client()
|
| - |
|
1568 |
helper_client.saveUserEmailForSending("chaitnaya.vats@shop2020.in", "cnc.center@shop2020.in", "Item is out of stock. ID: " + str(item.id) + " " + str(item.brand) + " " + str(item.model_name) + " " + str(item.model_number), "", str(item.id), "OOSNotification")
|
| - |
|
1569 |
helper_client.saveUserEmailForSending("abhishek.mathur@shop2020.in", "cnc.center@shop2020.in", "Item is out of stock. ID: " + str(item.id) + " " + str(item.brand) + " " + str(item.model_name) + " " + str(item.model_number), "", str(item.id), "OOSNotification")
|
| - |
|
1570 |
except Exception as e:
|
| - |
|
1571 |
print e
|
| - |
|
1572 |
|