From 20140425c820b0dd861116f87f456dced07f2c2d Mon Sep 17 00:00:00 2001 From: Abdullah Abouzekry <1107178+abdouz@users.noreply.github.com> Date: Tue, 13 Apr 2021 08:06:39 +0200 Subject: [PATCH] fix: sales order not saving due type mismatch in promo scheme (#24748) (#25222) --- 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 c676abd4c6..b91a7a5bd2 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -471,7 +471,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: