-
Notifications
You must be signed in to change notification settings - Fork 10.4k
fix(sales invoice): toggle Get Items From button based on is_return and POS view #52594
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #52594 +/- ##
===========================================
- Coverage 79.40% 79.39% -0.02%
===========================================
Files 1168 1168
Lines 123222 123327 +105
===========================================
+ Hits 97850 97912 +62
- Misses 25372 25415 +43
🚀 New features to boost your workflow:
|
|
@CodeRabbit review this |
|
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThis pull request makes two focused changes. In JavaScript, it adds Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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
🤖 Fix all issues with AI agents
In `@erpnext/accounts/doctype/sales_invoice/sales_invoice.js`:
- Around line 257-272: The toggle_get_items() logic removes the "Delivery Note"
picker on reload when this.frm.doc.is_return is true; to fix, change the else
branch so that when this.frm.doc.is_return is truthy you still invoke
this.frm.cscript.delivery_note_btn() (while still removing Sales
Order/Quotation/Timesheet), otherwise remove all "Get Items From" buttons;
update toggle_get_items() to call delivery_note_btn() in the else-path for
return invoices so the DN picker is present on load.
🧹 Nitpick comments (2)
erpnext/controllers/queries.py (2)
13-13:Coalesceis imported but unused.The new query builder code in
get_delivery_notes_to_be_billeddoesn't useCoalesce. Remove it to keep imports clean.Proposed fix
-from frappe.query_builder.functions import Coalesce, Concat, Locate, Sum +from frappe.query_builder.functions import Concat, Locate, Sum
399-401: Minor:docstatusfilter is applied twice — once in the base query (line 385) and again via dynamic filters.Not a bug, but worth noting. The base query already filters
docstatus == 1, and the JS also passesdocstatus: 1in filters. Consider excluding already-handled keys from the dynamic loop to avoid redundancy, or leave as-is since it's harmless.
Issue: Return Delivery Notes are not listed on "Get Items From" (Delivery Note) when creating a Sales Invoice with is_return enabled
Ref: 59697
Steps to Reproduce
update stockunchecked.Is Returnchecked.Before:
Screen.Recording.2026-02-09.at.18.29.33.mov
After:
Screen.Recording.2026-02-09.at.18.33.32.mov
Backport Needed v15