Merge pull request #17822 from rohitwaghchaure/pricing_rule_applying_on_the_non_conditional_item

fix: pricing rule is applying on the incorrect item
This commit is contained in:
rohitwaghchaure 2019-05-31 12:17:18 +05:30 committed by GitHub
commit 09d8bb8aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -480,10 +480,10 @@ def apply_pricing_rule(doc, pr_doc, item_row, value, do_not_validate=False):
rule_applied = {}
for item in doc.get("items"):
if item.get(apply_on) in items:
if not item.pricing_rules:
item.pricing_rules = item_row.pricing_rules
if item.get(apply_on) in items:
for field in ['discount_percentage', 'discount_amount', 'rate']:
if not pr_doc.get(field): continue