def get_item_list(): try: return get_shopify_items() except (requests.exceptions.HTTPError, ShopifyError) as e: frappe.throw( _("Something went wrong: {0}").format(frappe.get_traceback()), ShopifyError)
def execute(): if not is_shopify_enabled(): return sync_fixtures('erpnext_shopify') for index, shopify_item in enumerate(get_shopify_items(ignore_filter_conditions=True)): name = frappe.db.get_value("Item", {"shopify_product_id": shopify_item.get("id")}, "name") supplier = get_supplier(shopify_item) if name and supplier: frappe.db.set_value("Item", name, "default_supplier", supplier, update_modified=False) if (index+1) % 100 == 0: frappe.db.commit()
def get_item_list(): try: return get_shopify_items() except (requests.exceptions.HTTPError, ShopifyError) as e: frappe.throw(_("Something went wrong: {0}").format(frappe.get_traceback()), ShopifyError)