fix: update tds section to show section also#4285
fix: update tds section to show section also#4285ljain112 wants to merge 8 commits intoresilient-tech:developfrom
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Confidence Score: 5/5Safe to merge — all three previously flagged issues are resolved and no new defects were found. The missing No files require special attention.
|
| Filename | Overview |
|---|---|
| india_compliance/hooks.py | Adds validate hook for Tax Withholding Category (addressing a previously flagged gap) and registers the new client script for the TDS section autocomplete. |
| india_compliance/income_tax_india/overrides/tax_withholding_category.py | Adds validate to reject invalid tds_section values and search_tds_sections (whitelisted) with the correct 6-arg + **kwargs signature to drive the autocomplete dropdown. |
| india_compliance/income_tax_india/overrides/test_tax_withholding_category.py | Adds tests for empty, valid, and invalid tds_section values and for the case-insensitive description search; search_tds_sections is called with all six required positional args. |
| india_compliance/income_tax_india/data/tds_details.json | All tds_section values use the correct {section} - {code} format (e.g. 392(7) - 1004) matching what get_tds_section_value produces and what validate accepts. |
| india_compliance/patches/v16/update_tds_section_display_name.py | Migrates existing records whose tds_section is stored as a bare numeric code (e.g. 1004) to the full display format (e.g. 392(7) - 1004); correctly skips entries with an empty section string. |
| india_compliance/income_tax_india/client_scripts/tax_withholding_category.js | New client script that wires tds_section to the search_tds_sections server function via set_query, enabling the searchable autocomplete dropdown. |
Reviews (4): Last reviewed commit: "fix: add validate hook for tax withholdi..." | Re-trigger Greptile
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaced simple TDS section codes with a NEW_TDS_SECTION mapping and updated get_tds_section_value to format section display. Added a client script for the Tax Withholding Category form that queries a new server-side search_tds_sections function. Updated tds_details.json entries to use formatted section references. Moved on_change logic, added a patch script to update existing records, and extended tests to cover TDS section search. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (1)
india_compliance/income_tax_india/constants/__init__.py (1)
397-399:⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy liftVerify the canonical
tds_sectionformat —get_tds_section_valueandtds_details.jsondisagree.
get_tds_section_value(code)returns"<section> - <code>"(e.g.,"392(7) - 1004"), and this is the format the validator (get_valid_tds_section_values), the v16 display-name patch, and the autocomplete (search_tds_sections) all rely on.However,
india_compliance/income_tax_india/data/tds_details.jsonstores values like"1004-392(7)"(<code>-<section>, no spaces, reverse order). These two formats are not interchangeable, so fixture-loaded categories will fail the newvalidate().Pick one canonical format and align both producers (this helper + the JSON fixture, plus the v14/v16 patches) to it. See the comment on
tds_details.jsonfor full impact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7f765c98-aa9f-406c-9907-ce5dd7d6f395
📒 Files selected for processing (10)
india_compliance/hooks.pyindia_compliance/income_tax_india/client_scripts/tax_withholding_category.jsindia_compliance/income_tax_india/constants/__init__.pyindia_compliance/income_tax_india/constants/custom_fields.pyindia_compliance/income_tax_india/data/tds_details.jsonindia_compliance/income_tax_india/overrides/tax_withholding_category.pyindia_compliance/income_tax_india/overrides/test_tax_withholding_category.pyindia_compliance/patches.txtindia_compliance/patches/v14/migrate_and_update_tds_section_as_per_income_tax_act_2025.pyindia_compliance/patches/v16/update_tds_section_display_name.py
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
india_compliance/income_tax_india/overrides/test_tax_withholding_category.py (1)
259-285: 💤 Low value
do_not_saveflag appears unused after the validate-hook removal.Based on the commit history ("fix: add validate hook" → "fix: remove validation for section_code"), this flag was added to support an unsaved-doc test for a validate hook that was subsequently removed. No test in this file currently passes
do_not_save=True. Consider removing it to keep the helper lean, or keep it if the flag is needed by backport-branch tests.🧹 Proposed cleanup
-def create_tax_withholding_category(category_name, account_name, **kwargs): +def create_tax_withholding_category(category_name, account_name, **kwargs): fiscal_year = get_fiscal_year(today(), company=COMPANY, as_dict=True) - do_not_save = kwargs.pop("do_not_save", False) tax_withholding_rate = kwargs.pop("tax_withholding_rate", 10) ... - if not do_not_save: - doc.save() + doc.save() return doc
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 79a0a6f1-1f19-42d7-9848-22540a5afb93
📒 Files selected for processing (6)
india_compliance/income_tax_india/constants/__init__.pyindia_compliance/income_tax_india/data/tds_details.jsonindia_compliance/income_tax_india/overrides/tax_withholding_category.pyindia_compliance/income_tax_india/overrides/test_tax_withholding_category.pyindia_compliance/patches/v14/migrate_and_update_tds_section_as_per_income_tax_act_2025.pyindia_compliance/patches/v16/update_tds_section_display_name.py
For better clarity update TDS sections with the section code.
