From 34b6f9389c006c9da24b1833148959216831aad7 Mon Sep 17 00:00:00 2001 From: Abdullah Abouzekry <1107178+abdouz@users.noreply.github.com> Date: Tue, 6 Apr 2021 06:44:51 +0200 Subject: [PATCH] fix: sales order not saving due type mismatch in promo scheme (#24748) (#25056) Co-authored-by: Ankush Menat --- erpnext/accounts/doctype/pricing_rule/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index fb2f9ff8991..c9a820e2e27 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -467,7 +467,7 @@ def apply_pricing_rule_on_transaction(doc): if not d.get(pr_field): continue - if d.validate_applied_rule and doc.get(field) < d.get(pr_field): + if d.validate_applied_rule and doc.get(field) is not None and doc.get(field) < d.get(pr_field): frappe.msgprint(_("User has not applied rule on the invoice {0}") .format(doc.name)) else: