mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 03:15:07 +00:00
Co-authored-by: diptanilsaha <diptanil@frappe.io> fix(trends): added validation for `period_based_on` filter (#53690)
This commit is contained in:
@@ -55,6 +55,14 @@ def validate_filters(filters):
|
|||||||
if filters.get("based_on") == filters.get("group_by"):
|
if filters.get("based_on") == filters.get("group_by"):
|
||||||
frappe.throw(_("'Based On' and 'Group By' can not be same"))
|
frappe.throw(_("'Based On' and 'Group By' can not be same"))
|
||||||
|
|
||||||
|
if filters.get("period_based_on") and filters.period_based_on not in ["bill_date", "posting_date"]:
|
||||||
|
frappe.throw(
|
||||||
|
msg=_("{0} can be either {1} or {2}.").format(
|
||||||
|
frappe.bold("Period based On"), frappe.bold("Posting Date"), frappe.bold("Billing Date")
|
||||||
|
),
|
||||||
|
title=_("Invalid Filter"),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_data(filters, conditions):
|
def get_data(filters, conditions):
|
||||||
data = []
|
data = []
|
||||||
|
|||||||
Reference in New Issue
Block a user