From dcae024fd2de546364951e3979c34cc1df10c752 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 23 Sep 2025 19:10:23 +0530 Subject: [PATCH 1/4] 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 7ab8533368f..c1f014fb971 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2200,10 +2200,19 @@ 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, } +======= + 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 bdc442e07a1..bf35785803a 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -635,8 +635,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 aa20e224fbd3668b5aa79de593edc07dd9b976dd Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 7 Oct 2025 11:00:02 +0530 Subject: [PATCH 2/4] chore: fix conflicts --- erpnext/stock/get_item_details.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index bf35785803a..cdbc719df97 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -635,15 +635,8 @@ 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) + disabled, tax_company = frappe.get_cached_value("Item Tax Template", tax.item_tax_template, ["disabled", "company"]) + 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 From 819667ab24c58acc5c728f526e4212e2dc16a414 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 7 Oct 2025 11:00:45 +0530 Subject: [PATCH 3/4] chore: fix conflicts --- erpnext/public/js/controllers/transaction.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index c1f014fb971..5fa63cb9c02 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2200,19 +2200,11 @@ 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, + '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; From 014f5bff5c5b8cae3e0719f5d87ebbe1bfd31b8d Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 7 Oct 2025 11:24:49 +0530 Subject: [PATCH 4/4] chore: fix linters issue --- erpnext/stock/get_item_details.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index cdbc719df97..bd263c6c6a1 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -635,7 +635,9 @@ def _get_item_tax_template(args, taxes, out=None, for_validate=False): taxes_with_no_validity = [] for tax in taxes: - disabled, tax_company = frappe.get_cached_value("Item Tax Template", tax.item_tax_template, ["disabled", "company"]) + disabled, tax_company = frappe.get_cached_value( + "Item Tax Template", tax.item_tax_template, ["disabled", "company"] + ) 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