[fix] redirect to payment url if paying via web portal (#10265)

* [fix] redirect to payment url if paying via web portal

* [fix] test case fix

* [fix] test case fixes
This commit is contained in:
Saurabh
2017-08-08 11:29:11 +05:30
committed by Nabin Hait
parent 255c5f4407
commit 3a4b6c2cba
4 changed files with 12 additions and 18 deletions

View File

@@ -46,6 +46,7 @@ def get_product_info(item_code):
}
def get_qty_in_stock(item_code, template_item_code):
in_stock, stock_qty = 0, ''
warehouse = frappe.db.get_value("Item", item_code, "website_warehouse")
if not warehouse and template_item_code and template_item_code != item_code:
warehouse = frappe.db.get_value("Item", template_item_code, "website_warehouse")
@@ -55,8 +56,6 @@ def get_qty_in_stock(item_code, template_item_code):
item_code=%s and warehouse=%s""", (item_code, warehouse))
if stock_qty:
in_stock = stock_qty[0][0] > 0 and 1 or 0
else:
in_stock = 0
return frappe._dict({"in_stock": in_stock, "stock_qty": stock_qty})