Skip to content

Commit

Permalink
fix: misleading "success" message for DN when SO doesn't exist
Browse files Browse the repository at this point in the history
Prevent the creation of Delivery Note if Sales Order is missing in ERPN.
Currently the Delivery Note gets created (when order is marked as fulfilled in Shopify) even if the Sales Order against which the DN is to be created is missing in ERPNext.
  • Loading branch information
shashankshirke committed Oct 10, 2022
1 parent 7e7a0f7 commit 7ea6d15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ecommerce_integrations/shopify/fulfillment.py
Expand Up @@ -23,7 +23,9 @@ def prepare_delivery_note(payload, request_id=None):
sales_order = get_sales_order(cstr(order["id"]))
if sales_order:
create_delivery_note(order, setting, sales_order)
create_shopify_log(status="Success")
create_shopify_log(status="Success")
else:
create_shopify_log(status="Invalid", message="Sales Order not found for syncing delivery note.")
except Exception as e:
create_shopify_log(status="Error", exception=e, rollback=True)

Expand Down

0 comments on commit 7ea6d15

Please sign in to comment.