In v5 error in pricing rule


i wonder why i got this error recently, and i dont know how to fix this

Traceback (innermost last):
File “/home/myme/frappe-bench/apps/frappe/frappe/”, line 51, in application
response = frappe.handler.handle()
File “/home/myme/frappe-bench/apps/frappe/frappe/”, line 62, in handle
File “/home/myme/frappe-bench/apps/frappe/frappe/”, line 85, in execute_cmd
ret =, **frappe.form_dict)
File “/home/myme/frappe-bench/apps/frappe/frappe/”, line 708, in call
return fn(*args, **newargs)
File “/home/myme/frappe-bench/apps/erpnext/erpnext/stock/”, line 61, in get_item_details
File “/home/myme/frappe-bench/apps/erpnext/erpnext/accounts/doctype/pricing_rule/”, line 145, in get_pricing_rule_for_item
pricing_rules = get_pricing_rules(args)
File “/home/myme/frappe-bench/apps/erpnext/erpnext/accounts/doctype/pricing_rule/”, line 204, in get_pricing_rules
transaction_type=args.transaction_type, conditions=conditions), args, as_dict=1)
File “/home/myme/frappe-bench/apps/frappe/frappe/”, line 129, in sql
self._cursor.execute(query, values)
File “/home/myme/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 185, in execute
for key, item in args.iteritems())
TypeError: not enough arguments for format string

its happens when m about to add an item to an order


found the error, its because there is % sign in customer group , please add validation for this

@bobzz_zone - GitHub Issue

@neilLasrado can you add?