-
Notifications
You must be signed in to change notification settings - Fork 9.9k
fix: use posting_date instead of bill_date from purchase invoice #50772
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
Conversation
📝 WalkthroughWalkthroughA modification to the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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: 0
🧹 Nitpick comments (1)
erpnext/assets/doctype/asset/asset.py (1)
1213-1222: Aligningpurchase_datewithposting_datelooks correct; consider adding a regression testUsing
purchase_doc.get("posting_date")forpurchase_datematches the requirement to stop using supplier bill date and ties the asset’s purchase date to the actual posting date of the source document. This is consistent with other accounting flows that treat posting date as canonical. Based on learnings, this should also remain non‑null for Purchase Invoices/Receipts.To guard against regressions (e.g. when
bill_date != posting_dateon a Purchase Invoice), consider adding a small test that:
- Creates a Purchase Invoice/Receipt with differing
bill_dateandposting_date- Calls
get_values_from_purchase_doc- Asserts that
purchase_dateequals the document’sposting_date.
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
erpnext/assets/doctype/asset/asset.py(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ljain112
Repo: frappe/erpnext PR: 48864
File: erpnext/controllers/accounts_controller.py:2586-2596
Timestamp: 2025-08-20T11:58:32.385Z
Learning: In erpnext/controllers/accounts_controller.py, the posting_date parameter passed to get_due_date() and get_discount_date() is mandatory and calculated from bill_date/posting_date/transaction_date, so it should not be None.
⏰ 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). (6)
- GitHub Check: Python Unit Tests (3)
- GitHub Check: Python Unit Tests (4)
- GitHub Check: Python Unit Tests (1)
- GitHub Check: Python Unit Tests (2)
- GitHub Check: Patch Test
- GitHub Check: Summary
fix: use posting_date instead of bill_date from purchase invoice
Issue: During asset creation if the purchase Invoice is linked, system sets
Supplier Invoice Dateas thePurchase Dateinstead ofPosting Date.Ref: 54340
Backport Needed: Version-15