diff --git a/frappedesk/extends/client.py b/frappedesk/extends/client.py index 358e130f0..fd5e2ad00 100644 --- a/frappedesk/extends/client.py +++ b/frappedesk/extends/client.py @@ -1,10 +1,11 @@ # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt -from __future__ import unicode_literals import frappe from frappe.model.base_document import get_controller +from .qb import get_query + @frappe.whitelist() def get_list( @@ -20,7 +21,7 @@ def get_list( ): check_permissions(doctype, parent) - query = frappe.qb.get_query( + query = get_query( table=doctype, fields=fields, filters=filters, diff --git a/frappedesk/extends/qb.py b/frappedesk/extends/qb.py new file mode 100644 index 000000000..05c716c6e --- /dev/null +++ b/frappedesk/extends/qb.py @@ -0,0 +1,10 @@ +import frappe + +VERSION = frappe.__version__ + + +def get_query(*args, **kwargs): + if not VERSION.startswith("15"): + return frappe.qb.engine.get_query(*args, **kwargs) + + return frappe.qb.get_query(*args, **kwargs)