-
Notifications
You must be signed in to change notification settings - Fork 203
fix: set default company value on onload #3693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set default company value on onload #3693
Conversation
WalkthroughAssign user session default Company ( Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Form as Any GST Form (frm)
participant Defaults as frappe.defaults
rect rgba(230,245,255,0.6)
note over Form: Setup / onload (company default)
User->>Form: Open form
Form->>Defaults: get_user_default("Company")
Defaults-->>Form: default_company
Form->>Form: set frm.doc.company = default_company
Form->>Form: trigger "company"
Form-->>User: ready
end
sequenceDiagram
autonumber
actor User
participant Form as GSTR-1 (frm)
participant Loader as bundle loader
participant GSTR as GSTR1 instance
rect rgba(245,245,230,0.6)
note over Form: Previous flow (simplified)
User->>Form: Open GSTR-1
Form->>Loader: load bundle (returns Promise)
Loader-->>Form: .then(callback)
Form->>GSTR: instantiate GSTR1 inside callback
end
rect rgba(230,245,245,0.6)
note over Form: New flow (simplified)
User->>Form: Open GSTR-1
Form->>Loader: await load bundle
Loader-->>Form: bundle loaded
Form->>GSTR: instantiate GSTR1 (after await)
Form->>Defaults: get_user_default("Company")
Defaults-->>Form: default_company
Form->>Form: set frm.doc.company = default_company
Form->>Form: trigger "company"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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.
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
📒 Files selected for processing (1)
india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js (3)
india_compliance/gst_india/doctype/gstr_1/gstr_1.js (2)
frm(3125-3125)frm(3188-3189)india_compliance/public/js/utils.js (4)
frappe(90-93)frappe(99-104)frappe(119-122)frappe(143-146)india_compliance/gst_india/doctype/bill_of_entry/bill_of_entry.js (1)
frappe(75-78)
⏰ 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
india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js
Outdated
Show resolved
Hide resolved
8356aad to
a933e29
Compare
a933e29 to
38e83b6
Compare
india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
india_compliance/gst_india/doctype/gst_invoice_management_system/gst_invoice_management_system.js(1 hunks)india_compliance/gst_india/doctype/gstr_1/gstr_1.js(1 hunks)india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js
🧰 Additional context used
🧬 Code graph analysis (1)
india_compliance/gst_india/doctype/gstr_1/gstr_1.js (3)
india_compliance/public/js/utils.js (4)
frappe(90-93)frappe(99-104)frappe(119-122)frappe(143-146)india_compliance/public/js/components/set_gstin_options.js (1)
frappe(13-16)india_compliance/gst_india/doctype/gstr_1/gstr_1.py (1)
GSTR1(31-184)
⏰ 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
..._compliance/gst_india/doctype/gst_invoice_management_system/gst_invoice_management_system.js
Show resolved
Hide resolved
…tfix/pr-3693 fix: set default company value on onload (backport #3693)
Automatically set the session default company on setup.
closes: #3389
Summary by CodeRabbit
Bug Fixes
Changes