Skip to content

fix: add company and is_group filter to "default_gst_expense_account" search query#3784

Merged
karm1000 merged 1 commit intoresilient-tech:developfrom
ljain112:fix-exp-acc-field
Nov 11, 2025
Merged

fix: add company and is_group filter to "default_gst_expense_account" search query#3784
karm1000 merged 1 commit intoresilient-tech:developfrom
ljain112:fix-exp-acc-field

Conversation

@ljain112
Copy link
Copy Markdown
Member

@ljain112 ljain112 commented Nov 11, 2025

image

Summary by CodeRabbit

  • New Features
    • Extended accounting setup to support default GST expense account configuration alongside existing expense account options.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 11, 2025

Walkthrough

A new custom query configuration for default_gst_expense_account was added to the company form's setup() function, extending the existing query setup alongside default_customs_expense_account and default_customs_payable_account.

Changes

Cohort / File(s) Summary
GST Expense Account Query Setup
india_compliance/gst_india/client_scripts/company.js
Added custom query configuration for default_gst_expense_account with an empty filter object in the form's setup function

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

  • Verify the empty filter object is intentional and consistent with the design pattern
  • Confirm the new configuration doesn't conflict with existing query setups

Poem

🐰 A rabbit hops through GST compliance code,
Adding queries down the pathway road,
Default expenses now find their place,
Configuration blooms with gentle grace! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add company and is_group filter to default_gst_expense_account search query' accurately describes the main change in the pull request - adding filters to the default_gst_expense_account query configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f2d9f7 and e1f1c4f.

📒 Files selected for processing (1)
  • india_compliance/gst_india/client_scripts/company.js (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: ljain112
Repo: resilient-tech/india-compliance PR: 3693
File: india_compliance/gst_india/doctype/gst_invoice_management_system/gst_invoice_management_system.js:32-33
Timestamp: 2025-09-29T05:06:10.320Z
Learning: GST-related tool doctypes (like GST Invoice Management System, Purchase Reconciliation Tool, GSTR-1) use unconditional assignment of session default company in their setup() method: `frm.doc.company = frappe.defaults.get_user_default("Company");`. This is appropriate for these utility tools as they are meant to always start with the user's default company on each load, unlike regular documents that preserve saved company values.
📚 Learning: 2025-09-29T05:06:10.320Z
Learnt from: ljain112
Repo: resilient-tech/india-compliance PR: 3693
File: india_compliance/gst_india/doctype/gst_invoice_management_system/gst_invoice_management_system.js:32-33
Timestamp: 2025-09-29T05:06:10.320Z
Learning: GST-related tool doctypes (like GST Invoice Management System, Purchase Reconciliation Tool, GSTR-1) use unconditional assignment of session default company in their setup() method: `frm.doc.company = frappe.defaults.get_user_default("Company");`. This is appropriate for these utility tools as they are meant to always start with the user's default company on each load, unlike regular documents that preserve saved company values.

Applied to files:

  • india_compliance/gst_india/client_scripts/company.js
📚 Learning: 2025-09-24T06:52:03.847Z
Learnt from: ljain112
Repo: resilient-tech/india-compliance PR: 3691
File: india_compliance/gst_india/report/gst_balance/gst_balance.js:46-67
Timestamp: 2025-09-24T06:52:03.847Z
Learning: In India Compliance GST reports, the get_accounting_dimensions() function does not include project and cost_center by default, so these filters need to be explicitly added when required in report configurations.

Applied to files:

  • india_compliance/gst_india/client_scripts/company.js
📚 Learning: 2025-04-25T11:12:59.799Z
Learnt from: Ninad1306
Repo: resilient-tech/india-compliance PR: 3344
File: india_compliance/gst_india/report/gst_account_wise_summary/gst_account_wise_summary.py:18-20
Timestamp: 2025-04-25T11:12:59.799Z
Learning: In India Compliance GST reports, date_range is defined as a mandatory filter in the report configuration, making additional defensive coding for its presence unnecessary as the Frappe framework enforces required filters before calling the execute function.

Applied to files:

  • india_compliance/gst_india/client_scripts/company.js
📚 Learning: 2025-05-26T03:16:30.230Z
Learnt from: vorasmit
Repo: resilient-tech/india-compliance PR: 3344
File: india_compliance/gst_india/report/gst_account_wise_summary/gst_account_wise_summary.py:0-0
Timestamp: 2025-05-26T03:16:30.230Z
Learning: In GST account-wise summary reports, the filtering logic `doc.company_gstin != IfNull(doc[counterparty_gstin_field], "")` is intentionally designed to exclude internal transfers (where company GSTIN equals party GSTIN) while including transactions with unregistered parties (empty GSTIN). Internal transfers are excluded as they are only for internal reporting purposes like stock transfers between branches.

Applied to files:

  • india_compliance/gst_india/client_scripts/company.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

Comment thread india_compliance/gst_india/client_scripts/company.js
@karm1000 karm1000 enabled auto-merge November 11, 2025 13:20
@karm1000 karm1000 disabled auto-merge November 11, 2025 13:21
@karm1000 karm1000 merged commit a29b900 into resilient-tech:develop Nov 11, 2025
11 checks passed
ljain112 added a commit that referenced this pull request Nov 13, 2025
…tfix/pr-3784

fix: add company and is_group filter to "default_gst_expense_account" search query (backport #3784)
ljain112 added a commit that referenced this pull request Nov 13, 2025
…tfix/pr-3784

fix: add company and is_group filter to "default_gst_expense_account" search query (backport #3784)
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.

2 participants