From 99382a29b4009a16906a8e5eec8c3c2f52a3cf51 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 26 May 2021 20:05:01 +0530 Subject: [PATCH] fix: sales order status not updated on cancel --- ecommerce_integrations/shopify/order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ecommerce_integrations/shopify/order.py b/ecommerce_integrations/shopify/order.py index cac22372..aa90aa83 100644 --- a/ecommerce_integrations/shopify/order.py +++ b/ecommerce_integrations/shopify/order.py @@ -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)