Skip to content

Commit

Permalink
fix: sales order status not updated on cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed May 26, 2021
1 parent 98aa97f commit 99382a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ecommerce_integrations/shopify/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ def cancel_order(payload, request_id=None):
frappe.db.set_value("Delivery Note", dn.name, ORDER_STATUS_FIELD, order_status)

if not sales_invoice and not delivery_notes and sales_order.docstatus == 1:
setattr(sales_order, ORDER_STATUS_FIELD, order_status)
sales_order.cancel()
else:
frappe.db.set_value("Sales Order", sales_order.name, ORDER_STATUS_FIELD, order_status)

except Exception as e:
create_shopify_log(status="Error", exception=e)
Expand Down

0 comments on commit 99382a2

Please sign in to comment.