fix: Qb query, use isin instead of in and access fields without dot notation due to reserved pypika keywords

This commit is contained in:
marination 2022-02-03 14:03:17 +05:30
parent f47db26fa6
commit f97642e975

View File

@ -28,10 +28,10 @@ def execute():
query = (
frappe.qb.from_(singles)
.select(
singles.field, singles.value
singles["field"], singles.value
).where(
(singles.doctype == doctype)
& (singles.field in fields)
& (singles["field"].isin(fields))
)
)
data = query.run(as_dict=True)