[hub] sync multiple image urls
- using a simple multiselect currently
diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py
index 86ad031..0c9af1a 100644
--- a/erpnext/hub_node/api.py
+++ b/erpnext/hub_node/api.py
@@ -2,6 +2,7 @@
import frappe, requests, json
from frappe.utils import now
from frappe.frappeclient import FrappeClient
+from frappe.desk.form.load import get_attachments
@frappe.whitelist()
def call_hub_method(method, params=None):
@@ -31,11 +32,13 @@
valid_items = filter(lambda x: x.image and x.description, items)
- def attach_source_type(item):
+ def prepare_item(item):
item.source_type = "local"
+ item.attachments = get_attachments('Item', item.item_code)
return item
- valid_items = map(lambda x: attach_source_type(x), valid_items)
+ valid_items = map(lambda x: prepare_item(x), valid_items)
+
return valid_items
@frappe.whitelist()
@@ -52,7 +55,7 @@
'doctype': 'Hub Tracked Item',
'item_code': item_code,
'hub_category': item.get('hub_category'),
- # 'images': item.get('images')
+ 'image_list': item.get('image_list')
}).insert()
try: