From 3aba14f71adaae18f2c11fe4ef187ca6fa6e011a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:50:32 +0530 Subject: [PATCH] fix: cast POS query inputs to integers (backport #32975) (#32978) * fix: cast POS query inputs to integers (#32975) fix: cast POS query inputs to integers (cherry picked from commit c013db6ea18b7c8f88b645d3a71dd785018da8be) # Conflicts: # erpnext/selling/page/point_of_sale/point_of_sale.py * chore: conflicts Co-authored-by: Ankush Menat --- erpnext/selling/page/point_of_sale/point_of_sale.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py index 8bce1f60725..a4d20e2e7ae 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -5,6 +5,7 @@ import json import frappe +from frappe.utils import cint from frappe.utils.nestedset import get_root_of from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_stock_availability @@ -105,11 +106,11 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te ORDER BY item.name asc LIMIT - {start}, {page_length}""".format( - start=start, - page_length=page_length, - lft=lft, - rgt=rgt, + {page_length} offset {start}""".format( + start=cint(start), + page_length=cint(page_length), + lft=cint(lft), + rgt=cint(rgt), condition=condition, bin_join_selection=bin_join_selection, bin_join_condition=bin_join_condition,