Merge pull request #23054 from marination/general-ledger-filters
fix: General Ledger filter validation
This commit is contained in:
commit
6a51f3929b
@ -43,8 +43,11 @@ def execute(filters=None):
|
|||||||
|
|
||||||
|
|
||||||
def validate_filters(filters, account_details):
|
def validate_filters(filters, account_details):
|
||||||
if not filters.get('company'):
|
if not filters.get("company"):
|
||||||
frappe.throw(_('{0} is mandatory').format(_('Company')))
|
frappe.throw(_("{0} is mandatory").format(_("Company")))
|
||||||
|
|
||||||
|
if not filters.get("from_date") and not filters.get("to_date"):
|
||||||
|
frappe.throw(_("{0} and {1} are mandatory").format(frappe.bold(_("From Date")), frappe.bold(_("To Date"))))
|
||||||
|
|
||||||
if filters.get("account") and not account_details.get(filters.account):
|
if filters.get("account") and not account_details.get(filters.account):
|
||||||
frappe.throw(_("Account {0} does not exists").format(filters.account))
|
frappe.throw(_("Account {0} does not exists").format(filters.account))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user