Merge pull request #17090 from rohitwaghchaure/pos_qty_decrement_not_working

fix: POS qty decrement freezing the screen
diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py
index 936f97c..d3db130 100644
--- a/erpnext/accounts/doctype/pricing_rule/utils.py
+++ b/erpnext/accounts/doctype/pricing_rule/utils.py
@@ -497,8 +497,8 @@
 						frappe.msgprint(_("Row {0}: user has not applied rule <b>{1}</b> on the item <b>{2}</b>")
 							.format(item.idx, pr_doc.title, item.item_code))
 
-	if rule_applied and doc.pricing_rules:
-		for d in doc.pricing_rules:
+	if rule_applied and doc.get("pricing_rules"):
+		for d in doc.get("pricing_rules"):
 			key = (d.child_docname, d.pricing_rule)
 			if key in rule_applied:
 				d.rule_applied = 1