fix: GSTR-3B report UI issues#4575
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 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: 4/5Safe to merge for the UI fixes and the new PDF endpoint; the async report path still overwrites the previously-generated data in the database before the background job completes, so a failed job permanently loses the prior report. The validate() method unconditionally sets self.json_output to an empty string at the top, which is committed to the database before the background job runs when enqueue_report=1. If the job subsequently fails, the user's previous valid report is gone with no recovery path other than a successful re-run. This was flagged in earlier review rounds and remains unaddressed. The new print format's PDF orientation is controlled by a CSS property rather than by the wkhtmltopdf option, so the PDF silently renders in portrait. Everything else is well-implemented. gstr_3b_report.py (validate/on_update async data-loss path) and print_format/gstr_3b/gstr_3b.html (PDF orientation)
|
| Filename | Overview |
|---|---|
| india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py | Adds on_update enqueueing with enqueue_after_commit, duplicate-report guard, get_report helper with permission checking, and PDF download endpoint; validate() still unconditionally clears json_output before the background job runs, permanently erasing the previous report if the job fails |
| india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js | Moves realtime listener to setup, adds json_output guard in append_form (fixes previous SyntaxError crash), groups download buttons, sets custom primary action label that survives dirty state; realtime listener is not unregistered on teardown |
| india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json | Adds list-view columns and standard filters for company, year, company_gstin, month_or_quarter; changes json_output from hidden to read_only for version tracking; adds depends_on to generation_status field |
| india_compliance/gst_india/print_format/gstr_3b/gstr_3b.html | New print format template reusing the existing report HTML; orientation: Landscape is set as a CSS property which is not how PDF generators read orientation — wkhtmltopdf reads the orientation option, not CSS |
| india_compliance/gst_india/doctype/gstr_3b_report/test_gstr_3b_report.py | Adds seven new test cases covering duplicate-report prevention, single-enqueue deduplication, failure persistence and realtime notification, permission-based download rejection, empty-report rejection, and consistent file naming |
| india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.html | Scopes .disabled and .right CSS rules under .gstr3b-report to prevent global CSS leak that was greying out page titles; correct targeted fix |
| india_compliance/gst_india/print_format/gstr_3b/gstr_3b.json | New Print Format definition for GSTR-3B; uses wkhtmltopdf generator and references the new Jinja template; margins are all zero which suits a compact table layout |
| india_compliance/gst_india/utils/itc_claim.py | Changes filing-status confirmation from a modal msgprint to an alert toast and removes trailing period; purely a UX improvement |
| india_compliance/gst_india/print_format/gstr_3b/init.py | Empty init.py to make the print_format/gstr_3b directory a Python package; no logic |
Reviews (19): Last reviewed commit: "test: skip committing in test" | Re-trigger Greptile
📝 WalkthroughWalkthroughThe GSTR 3B report flow now prevents duplicate reports, deduplicates background generation, publishes completion status, and supports JSON, Excel, and PDF downloads. The form renders saved or in-progress reports and provides updated actions. A landscape print format was added, report styles were scoped, report fields were exposed in list and filter views, and generation status was made conditional. Tests cover lifecycle, download, authorization, and filename behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
|
View Form can be removed and added as Download PDF. |
|
Version log is not available for data. |
|
After enquue report is not getting automatically populated. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js (2)
31-34: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove the forced intro and dirty state.
Every refresh of an existing report re-adds “Please save the report again…” and sets
__unsaved = 1, so users are prompted to save again even after a successful save. This does not remove the duplicate-intro problem and makes the form appear perpetually unsaved. Gate any legacy migration message behind an explicit condition, or remove this block.
36-45: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse a report-specific JSON filename.
The endpoint invoked here still produces the hardcoded
GST3B.jsonfilename ingstr_3b_report.py. Updatemake_jsonto derive the filename from the document name, GSTIN, and reporting period as required by the PR.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c4d20a9f-fa76-49cb-97f3-d163407d207e
📒 Files selected for processing (2)
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.jsindia_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json
Not able to replicate |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
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.
|
@greptileai review |
|
@greptileai review |
…us before enqueueing
e268260 to
224589a
Compare
|
@greptile, we have already allowed a version change, so no issues |
|
That's a fair point. With version tracking enabled on One nuance worth being aware of: the |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3614db51-aff6-4abf-8935-645ae91aaa7f
📒 Files selected for processing (9)
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.htmlindia_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.jsindia_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.jsonindia_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.pyindia_compliance/gst_india/doctype/gstr_3b_report/test_gstr_3b_report.pyindia_compliance/gst_india/print_format/gstr_3b/__init__.pyindia_compliance/gst_india/print_format/gstr_3b/gstr_3b.htmlindia_compliance/gst_india/print_format/gstr_3b/gstr_3b.jsonindia_compliance/gst_india/utils/itc_claim.py
🚧 Files skipped from review as they are similar to previous changes (6)
- india_compliance/gst_india/print_format/gstr_3b/gstr_3b.json
- india_compliance/gst_india/utils/itc_claim.py
- india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.html
- india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js
- india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json
- india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py




Changes
Three fixes for the GSTR 3B Report form:
Duplicate intro message on first saveBefore - Form
After - Form
Before - Listview
After - Listview
no-docsNote
Backport to V-16