From 8f4dc8048d86c2f103b3ded40074be80df0e5870 Mon Sep 17 00:00:00 2001 From: Bhavan23 Date: Sat, 31 Aug 2024 17:28:03 +0530 Subject: [PATCH] fix: validate the item code when updating the other item's price rule (cherry picked from commit 45de18069c5e69970115dbd04381c4cd296948d1) --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 91b938acb50..aa4a2ae85a0 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1777,7 +1777,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe if (data && data.apply_rule_on_other_items && JSON.parse(data.apply_rule_on_other_items)) { me.frm.doc.items.forEach(d => { - if (in_list(JSON.parse(data.apply_rule_on_other_items), d[data.apply_rule_on])) { + if (in_list(JSON.parse(data.apply_rule_on_other_items), d[data.apply_rule_on]) && d.item_code === data.item_code) { for(var k in data) { if (data.pricing_rule_for == "Discount Percentage" && data.apply_rule_on_other_items && k == "discount_amount") { continue;