Skip to content

Commit

Permalink
feat: add hook to allow other apps to process an SS order (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alchez authored Aug 16, 2021
1 parent 63d2b7c commit ada650a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion shipstation_integration/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ def list_orders(
order: "ShipStationOrder"
for order in orders:
if validate_order(sss_doc, order, store):
create_erpnext_order(order, store)
should_create_order = True

process_order_hook = frappe.get_hooks("process_shipstation_order")
if process_order_hook:
should_create_order = frappe.get_attr(process_order_hook[0])(order, store)

if should_create_order:
create_erpnext_order(order, store)


def validate_order(settings: "ShipstationSettings", order: "ShipStationOrder", store: "ShipstationStore"):
Expand Down

0 comments on commit ada650a

Please sign in to comment.