From bfe25277b65240db0e3d1bb80e4e6fbc950a4039 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 26 Jan 2024 15:24:29 +0100 Subject: [PATCH 1/2] fix: Don't call method if there are no pricing rules set --- erpnext/public/js/controllers/transaction.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 65de9b2d283..734029711de 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1534,6 +1534,9 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe remove_pricing_rule_for_item(item) { let me = this; + if (!item.pricing_rules.length) { + return + } return this.frm.call({ method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.remove_pricing_rule_for_item", args: { -- GitLab From 125b2d74a664b520a672e7a2c21e1a6775a41fb4 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 26 Jan 2024 15:26:30 +0100 Subject: [PATCH 2/2] fix: Check only for existence --- 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 734029711de..017004b2ab4 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1534,7 +1534,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe remove_pricing_rule_for_item(item) { let me = this; - if (!item.pricing_rules.length) { + if (!item.pricing_rules) { return } return this.frm.call({ -- GitLab