From 4e45663297d01d2621e2ed2cdd6aa9702481cc67 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 29 Jan 2019 14:02:08 +0530 Subject: [PATCH] fix(stock): get item price based on party --- erpnext/stock/get_item_details.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index e1607a927fe..ec1031c70f2 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -440,13 +440,12 @@ def get_item_price(args, item_code, ignore_party=False): and ifnull(uom, '') in ('', %(uom)s)""" if not ignore_party: - conditions += " and (customer is null or customer = '') and (supplier is null or supplier = '')" if args.get("customer"): conditions += " and customer=%(customer)s" - - if args.get("supplier"): + elif args.get("supplier"): conditions += " and supplier=%(supplier)s" - + else: + conditions += " and (customer is null or customer = '') and (supplier is null or supplier = '')" if args.get('min_qty'): conditions += " and ifnull(min_qty, 0) <= %(min_qty)s"