From a279a68b90973fcea6d835c8facb7c57148eedce 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 eea887bde88..7b26cc6f3f8 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1501,6 +1501,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 d27afb58da4b437400a56d98bd299f76d45be0db 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 7b26cc6f3f8..72d5db8fe6d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1501,7 +1501,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