From 65a1c7086bf2c704daf06226677bb2cdce7e45c0 Mon Sep 17 00:00:00 2001 From: l0gesh29 Date: Wed, 24 Dec 2025 22:09:03 +0530 Subject: [PATCH] fix: handle return cancellation (cherry picked from commit 50f73a5072b471e347decf2819879a5a957dbe0a) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index c7c029768e5..585a2bffece 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -571,7 +571,7 @@ class SalesInvoice(SellingController): self.check_if_consolidated_invoice() super().before_cancel() - self.update_time_sheet(None) + self.update_time_sheet(self.return_against if (self.is_return and self.return_against) else None) def on_cancel(self): check_if_return_invoice_linked_with_payment_entry(self)