mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
fix: use transaction_date for Purchase Order in target variance helper
The shared get_data helper defaulted to posting_date for any doctype other than Sales Order. Purchase Order also uses transaction_date, so add it to the in-check to prevent the Unknown column SQL error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,9 @@ def get_data(filters, period_list, partner_doctype):
|
||||
if d.item_group:
|
||||
sales_user_wise_item_groups[d.parent].append(d.item_group)
|
||||
|
||||
date_field = "transaction_date" if filters.get("doctype") == "Sales Order" else "posting_date"
|
||||
date_field = (
|
||||
"transaction_date" if filters.get("doctype") in ("Sales Order", "Purchase Order") else "posting_date"
|
||||
)
|
||||
|
||||
actual_data = get_actual_data(filters, sales_users, date_field, sales_field)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user