[hub] Publishing Dialog, Sync category

- Hub Category selection
- Recycled
This commit is contained in:
Prateeksha Singh
2018-08-19 19:39:00 +05:30
parent c1fe1c45c7
commit 0a60d1cd96
4 changed files with 198 additions and 39 deletions

View File

@@ -42,11 +42,19 @@ def get_valid_items(search_value=''):
def publish_selected_items(items_to_publish):
items_to_publish = json.loads(items_to_publish)
if not len(items_to_publish):
return
frappe.throw('No items to publish')
for item_code in items_to_publish:
for item in items_to_publish:
item_code = item.get('item_code')
frappe.db.set_value('Item', item_code, 'publish_in_hub', 1)
frappe.get_doc({
'doctype': 'Hub Tracked Item',
'item_code': item_code,
'hub_category': item.get('hub_category'),
# 'images': item.get('images')
}).insert()
try:
hub_settings = frappe.get_doc('Hub Settings')
item_sync_preprocess()