Skip to content

Conversation

@ljain112
Copy link
Collaborator

Issue: User can use a disabled Item Tax Template in a transaction.

Frappe Support Issue: https://support.frappe.io/app/hd-ticket/49204

@github-actions github-actions bot added needs-tests This PR needs automated unit-tests. stock labels Sep 23, 2025
@ljain112 ljain112 marked this pull request as draft September 23, 2025 13:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

📝 Walkthrough

Walkthrough

  • In erpnext/public/js/controllers/transaction.js, the item tax template query in set_query_for_item_tax_template now includes a disabled: 0 filter in addition to existing criteria (valid_from, item_group, base_net_rate).
  • In erpnext/stock/get_item_details.py, _get_item_tax_template now reads both disabled and company from Item Tax Template and proceeds only if the template is not disabled and matches the current company. No public API signatures changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title Check ✅ Passed The title "fix: do not fetch disabled item tax template" accurately and concisely summarizes the primary change in the diff, which is to exclude disabled Item Tax Templates from selection (both client-side query and server-side filtering), so it clearly reflects the main fix.
Description Check ✅ Passed The PR description states the underlying issue (disabled Item Tax Templates being usable in transactions) and links the support ticket, which is directly related to the code changes that prevent disabled templates from being selected; it is brief but on-topic for this lenient check.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ljain112 ljain112 marked this pull request as ready for review September 24, 2025 06:27
@rohitwaghchaure rohitwaghchaure merged commit 6836b88 into frappe:develop Oct 7, 2025
19 checks passed
rohitwaghchaure added a commit that referenced this pull request Oct 7, 2025
…-49702

fix: do not fetch disabled item tax template (backport #49702)
rohitwaghchaure added a commit that referenced this pull request Oct 7, 2025
…-49702

fix: do not fetch disabled item tax template (backport #49702)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport version-14-hotfix backport to version 14 backport version-15-hotfix needs-tests This PR needs automated unit-tests. stock

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants