Skip to content

Commit

Permalink
Merge pull request #1014 from ssiyad/fix/framework_version_qb
Browse files Browse the repository at this point in the history
fix(api): `get_query` for older versions
  • Loading branch information
ssiyad authored Feb 28, 2023
2 parents 20229be + 703500f commit c444123
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frappedesk/extends/client.py
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions frappedesk/extends/qb.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit c444123

Please sign in to comment.