From 40611e4f69ddeffcfe005ab3348fa0acb98cfeb6 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 31 Oct 2017 13:00:09 +0530 Subject: [PATCH] [fix] hub get_item_details (#11383) --- erpnext/hub_node/__init__.py | 4 +++- erpnext/hub_node/page/hub/hub.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py index 686fe8d2029..8efbed8f7e6 100644 --- a/erpnext/hub_node/__init__.py +++ b/erpnext/hub_node/__init__.py @@ -34,7 +34,9 @@ def get_categories(): return response @frappe.whitelist() -def get_item_details(hub_sync_id): +def get_item_details(hub_sync_id=None): + if not hub_sync_id: + return connection = get_connection() return connection.get_doc('Hub Item', hub_sync_id) diff --git a/erpnext/hub_node/page/hub/hub.js b/erpnext/hub_node/page/hub/hub.js index 143f55444f7..297a4d12916 100644 --- a/erpnext/hub_node/page/hub/hub.js +++ b/erpnext/hub_node/page/hub/hub.js @@ -382,6 +382,7 @@ erpnext.hub.Hub = class Hub { }, method: "erpnext.hub_node.get_item_details", callback: (r) => { + if (!r || !r.message) return; let item = r.message; this.item_cache[item_code] = item; this.render_item_page(item);