From 7509433b2b617f514bae1d13fdfb8ebfa60d7198 Mon Sep 17 00:00:00 2001 From: Okeyo Gichana Mayaka Date: Wed, 12 Jun 2024 09:08:45 +0300 Subject: [PATCH] refactor: minor refactor --- kenya_compliance/kenya_compliance/apis/apis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kenya_compliance/kenya_compliance/apis/apis.py b/kenya_compliance/kenya_compliance/apis/apis.py index a17c0d3..a53af5c 100644 --- a/kenya_compliance/kenya_compliance/apis/apis.py +++ b/kenya_compliance/kenya_compliance/apis/apis.py @@ -73,11 +73,11 @@ def bulk_pos_sales_invoices(docs_list: str) -> None: @frappe.whitelist() def bulk_register_item(docs_list: str) -> None: data = json.loads(docs_list) - all_items = frappe.db.get_all("Item", ["*"]) + all_items = frappe.db.get_all("Item", {"custom_item_registered": 0}, ["*"]) for record in data: for item in all_items: - if record == item.item_code and item.custom_item_registered == 0: + if record == item.item_code: request_data = { "name": item.name, "company_name": frappe.defaults.get_user_default("Company"),