mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 03:01:22 +00:00
[hub] remove test code
This commit is contained in:
@@ -73,18 +73,14 @@ def publish_selected_items(items_to_publish):
|
||||
if not len(items_to_publish):
|
||||
return
|
||||
|
||||
# TODO: sync
|
||||
# for item_code in items_to_publish:
|
||||
# frappe.db.set_value('Item', item_code, 'publish_in_hub', 1)
|
||||
|
||||
# hub_settings = frappe.get_doc('Hub Settings')
|
||||
# remote_id = item_sync_preprocess()
|
||||
# hub_settings.sync(remote_id)
|
||||
|
||||
# return remote_id
|
||||
for item_code in items_to_publish:
|
||||
frappe.db.set_value('Item', item_code, 'publish_in_hub', 1)
|
||||
|
||||
hub_settings = frappe.get_doc('Hub Settings')
|
||||
hub_settings.sync('TEST')
|
||||
remote_id = item_sync_preprocess()
|
||||
hub_settings.sync(remote_id)
|
||||
|
||||
return remote_id
|
||||
|
||||
def item_sync_preprocess():
|
||||
# Call Hub to make a new activity
|
||||
|
||||
@@ -41,27 +41,8 @@ class HubSettings(Document):
|
||||
'trigger_name': 'items-sync'
|
||||
}).insert()
|
||||
|
||||
time.sleep(2)
|
||||
frappe.publish_realtime('items-sync', {"progress_percent": 20})
|
||||
print("=======================")
|
||||
|
||||
time.sleep(2)
|
||||
frappe.publish_realtime('items-sync', {"progress_percent": 40})
|
||||
print("=======================")
|
||||
|
||||
time.sleep(1)
|
||||
frappe.publish_realtime('items-sync', {"progress_percent": 80})
|
||||
print("=======================")
|
||||
|
||||
time.sleep(2)
|
||||
frappe.publish_realtime('items-sync', {"progress_percent": 100})
|
||||
print("=======================")
|
||||
|
||||
frappe.db.set_value('Hub Settings', 'Hub Settings', 'last_sync_datetime', frappe.utils.now())
|
||||
|
||||
# TODO: sync
|
||||
# self.sync_in_progress = 1
|
||||
# doc.run()
|
||||
self.sync_in_progress = 1
|
||||
doc.run()
|
||||
else:
|
||||
frappe.throw("No remote ID specified")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user