From 33191708056c2748a8b65d2bf2e819cccc1cb745 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 28 Feb 2014 13:01:33 +0530 Subject: [PATCH] pricing rule: condition for tree-type docs --- erpnext/stock/get_item_details.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index b4a90c08c4..4c3725ade9 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -281,16 +281,16 @@ def get_pricing_rules(args_dict): conditions = "" - for field in ["customer", "territory", "supplier", "supplier_type", - "campaign", "sales_partner"]: + for field in ["customer", "supplier", "supplier_type", "campaign", "sales_partner"]: if args_dict.get(field): conditions += " and ifnull("+field+", '') in (%("+field+")s, '')" else: conditions += " and ifnull("+field+", '') = ''" - customer_group_condition = _get_tree_conditions("Customer Group") - if customer_group_condition: - conditions += " and " + customer_group_condition + for doctype in ["Customer Group", "Territory"]: + group_condition = _get_tree_conditions(doctype) + if group_condition: + conditions += " and " + group_condition conditions += " and ifnull(for_price_list, '') in (%(price_list)s, '')"