Enabled feature in Price List
diff --git a/selling/utils/__init__.py b/selling/utils/__init__.py
index f495f58..b71c9d4 100644
--- a/selling/utils/__init__.py
+++ b/selling/utils/__init__.py
@@ -150,8 +150,10 @@
return out
def _get_price_list_rate(args, item_bean, meta):
- ref_rate = webnotes.conn.sql("""select ref_rate from `tabItem Price`
- where price_list=%s and item_code=%s and selling=1""",
+ ref_rate = webnotes.conn.sql("""select ip.ref_rate from
+ `tabItem Price` ip, `tabPrice List` pl
+ where ip.price_list=pl.name and ip.price_list=%s and
+ ip.item_code=%s and ip.selling=1 and pl.enabled=1""",
(args.selling_price_list, args.item_code), as_dict=1)
if not ref_rate:
diff --git a/selling/utils/product.py b/selling/utils/product.py
index 32ff85a..22bb880 100644
--- a/selling/utils/product.py
+++ b/selling/utils/product.py
@@ -27,8 +27,9 @@
else:
in_stock = -1
- price = price_list and webnotes.conn.sql("""select ref_rate, currency from
- `tabItem Price` where item_code=%s and price_list=%s""",
+ price = price_list and webnotes.conn.sql("""select ip.ref_rate, ip.currency from
+ `tabItem Price` ip, `tabPrice List` pl where ip.price_list=pl.name and
+ ip.item_code=%s and ip.price_list=%s and pl.enabled=1""",
(item_code, price_list), as_dict=1) or []
price = price and price[0] or None