Merge pull request #2097 from nabinhait/hotfix
Escaped item group value in pricing rule condition
This commit is contained in:
commit
d67cbdf725
@ -169,8 +169,8 @@ def get_pricing_rules(args):
|
||||
|
||||
if parent_groups:
|
||||
if allow_blank: parent_groups.append('')
|
||||
condition = " ifnull("+field+", '') in ('" + "', '".join(parent_groups)+"')"
|
||||
|
||||
condition = " ifnull("+field+", '') in ('" + \
|
||||
"', '".join([d.replace("'", "\\'").replace('"', '\\"') for d in parent_groups])+"')"
|
||||
return condition
|
||||
|
||||
|
||||
@ -201,7 +201,7 @@ def get_pricing_rules(args):
|
||||
and ifnull({transaction_type}, 0) = 1 {conditions}
|
||||
order by priority desc, name desc""".format(
|
||||
item_group_condition=item_group_condition,
|
||||
transaction_type=args.transaction_type, conditions=conditions), args, as_dict=1)
|
||||
transaction_type=args.transaction_type, conditions=conditions), args, as_dict=1, debug=1)
|
||||
|
||||
def filter_pricing_rules(args, pricing_rules):
|
||||
# filter for qty
|
||||
|
Loading…
Reference in New Issue
Block a user