Merge pull request #43125 from frappe/mergify/bp/version-15-hotfix/pr-43064

fix: validate the item code when updating the other item's price rule (backport #43064)
This commit is contained in:
ruthra kumar
2024-09-09 14:16:49 +05:30
committed by GitHub

View File

@@ -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;