Skip to content

fix: handle None case for item wise tax details in validation#4602

Open
ljain112 wants to merge 1 commit into
resilient-tech:developfrom
ljain112:minor-fix
Open

fix: handle None case for item wise tax details in validation#4602
ljain112 wants to merge 1 commit into
resilient-tech:developfrom
ljain112:minor-fix

Conversation

@ljain112

Copy link
Copy Markdown
Member

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

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.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge — single-line fix for a well-understood crash, consistent with the pattern already used in the same file.

The change is minimal and targeted: it fixes an iteration over None that occurs when _item_wise_tax_details is explicitly None on a Frappe document. Frappe's BaseDocument.get(key, []) silently ignores the [] because it is interpreted as the filters argument, not a default. The or [] idiom is already used at line 1166 of the same file for the same field, confirming this is the established project pattern.

No files require special attention.

Important Files Changed

Filename Overview
india_compliance/gst_india/overrides/transaction.py One-line fix replacing doc.get("key", []) with doc.get("key") or [] to correctly handle a None value returned when _item_wise_tax_details is set to None in the document's __dict__

Reviews (1): Last reviewed commit: "fix: handle None case for item wise tax ..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 144376ac-e9b3-44aa-b286-a1de1bf86983

📥 Commits

Reviewing files that changed from the base of the PR and between 0e37457 and 81ae18f.

📒 Files selected for processing (1)
  • india_compliance/gst_india/overrides/transaction.py

📝 Walkthrough

Walkthrough

Updated item-wise tax detail validation to use an empty list when _item_wise_tax_details is missing or falsey, preventing iteration over invalid falsey values.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the change to handle None item-wise tax details during validation.
Description check ✅ Passed The description is related to the change because it links the referenced issue for this validation fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@ljain112
ljain112 enabled auto-merge July 22, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant