From 35c606707ec115b76f4ecfe602aff65dfd33164a Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 20 Apr 2022 16:43:19 +0530 Subject: [PATCH] fix(bulk_insert): Cast values as list before subscripting --- frappe/database/database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index 411888df34..d4677a1295 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -1236,8 +1236,9 @@ class Database(object): :param fields: list of fields :params values: list of list of values """ - + values = list(values) table = frappe.qb.DocType(doctype) + for start_index in range(0, len(values), chunk_size): query = frappe.qb.into(table) if ignore_duplicates: