From c42dcbe739f9866c5e9d65504fe5def0b3a9290e Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 23 Sep 2025 19:10:23 +0530 Subject: [PATCH 1/2] fix: do not fetch disabled item tax template (cherry picked from commit b10cf4a928447dc768a1d90fb27fbc86d536ed14) # Conflicts: # erpnext/public/js/controllers/transaction.js # erpnext/stock/get_item_details.py --- erpnext/public/js/controllers/transaction.js | 9 +++++++++ erpnext/stock/get_item_details.py | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 0af61025653..0cdbd36bbcf 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2575,11 +2575,20 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe return doc.company ? {filters: {company: doc.company}} : {}; } else { let filters = { +<<<<<<< HEAD 'item_code': item.item_code, 'valid_from': ["<=", doc.transaction_date || doc.bill_date || doc.posting_date], 'item_group': item.item_group, "base_net_rate": item.base_net_rate, } +======= + item_code: item.item_code, + valid_from: ["<=", doc.transaction_date || doc.bill_date || doc.posting_date], + item_group: item.item_group, + base_net_rate: item.base_net_rate, + disabled: 0, + }; +>>>>>>> b10cf4a928 (fix: do not fetch disabled item tax template) if (doc.tax_category) filters['tax_category'] = doc.tax_category; diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 38073cfebb2..9fb0bda1329 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -704,8 +704,15 @@ def _get_item_tax_template(args, taxes, out=None, for_validate=False): taxes_with_no_validity = [] for tax in taxes: +<<<<<<< HEAD tax_company = frappe.get_cached_value("Item Tax Template", tax.item_tax_template, "company") if tax_company == args["company"]: +======= + disabled, tax_company = frappe.get_cached_value( + "Item Tax Template", tax.item_tax_template, ["disabled", "company"] + ) + if not disabled and tax_company == ctx["company"]: +>>>>>>> b10cf4a928 (fix: do not fetch disabled item tax template) if tax.valid_from or tax.maximum_net_rate: # In purchase Invoice first preference will be given to supplier invoice date # if supplier date is not present then posting date From d47f3cc1014db0f395aab21c6632458e85cb27ff Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 7 Oct 2025 11:01:47 +0530 Subject: [PATCH 2/2] chore: resolve conflicts --- erpnext/public/js/controllers/transaction.js | 10 +--------- erpnext/stock/get_item_details.py | 7 +------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 0cdbd36bbcf..b1b11bb291c 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2575,20 +2575,12 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe return doc.company ? {filters: {company: doc.company}} : {}; } else { let filters = { -<<<<<<< HEAD 'item_code': item.item_code, 'valid_from': ["<=", doc.transaction_date || doc.bill_date || doc.posting_date], 'item_group': item.item_group, "base_net_rate": item.base_net_rate, + "disabled": 0, } -======= - item_code: item.item_code, - valid_from: ["<=", doc.transaction_date || doc.bill_date || doc.posting_date], - item_group: item.item_group, - base_net_rate: item.base_net_rate, - disabled: 0, - }; ->>>>>>> b10cf4a928 (fix: do not fetch disabled item tax template) if (doc.tax_category) filters['tax_category'] = doc.tax_category; diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 9fb0bda1329..8e71367c663 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -704,15 +704,10 @@ def _get_item_tax_template(args, taxes, out=None, for_validate=False): taxes_with_no_validity = [] for tax in taxes: -<<<<<<< HEAD - tax_company = frappe.get_cached_value("Item Tax Template", tax.item_tax_template, "company") - if tax_company == args["company"]: -======= disabled, tax_company = frappe.get_cached_value( "Item Tax Template", tax.item_tax_template, ["disabled", "company"] ) - if not disabled and tax_company == ctx["company"]: ->>>>>>> b10cf4a928 (fix: do not fetch disabled item tax template) + if not disabled and tax_company == args["company"]: if tax.valid_from or tax.maximum_net_rate: # In purchase Invoice first preference will be given to supplier invoice date # if supplier date is not present then posting date