[Fix] User able to change discount if pricing rule has discount value as zero (#15921)

This commit is contained in:
rohitwaghchaure 2018-11-08 13:05:08 +05:30 committed by Rushabh Mehta
parent 6ff2f395f5
commit a88eaa6e20

View File

@ -185,7 +185,8 @@ def get_pricing_rule_for_item(args):
"discount_percentage": 0.0
})
else:
item_details.discount_percentage = pricing_rule.discount_percentage or args.discount_percentage
item_details.discount_percentage = (pricing_rule.get('discount_percentage', 0)
if pricing_rule else args.discount_percentage)
elif args.get('pricing_rule'):
item_details = remove_pricing_rule_for_item(args.get("pricing_rule"), item_details)