Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ecommerce_integrations/shopify/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import frappe
from frappe import _
from frappe.utils import cint, cstr, flt, get_datetime, getdate, nowdate
from frappe.utils import cint, cstr, flt, get_datetime, get_link_to_form, getdate, nowdate
from shopify.collection import PaginatedIterator
from shopify.resources import Order

Expand Down Expand Up @@ -79,6 +79,12 @@ def create_sales_order(shopify_order, setting, company=None):
if customer_id := shopify_order.get("customer", {}).get("id"):
customer = frappe.db.get_value("Customer", {CUSTOMER_ID_FIELD: customer_id}, "name")

if not customer:
create_shopify_log(
status=_("Error"),
message=_("Please set defualt customer in {0}").format(get_link_to_form("Shopify Settings")),
)

so = frappe.db.get_value("Sales Order", {ORDER_ID_FIELD: shopify_order.get("id")}, "name")

if not so:
Expand Down