From 4af5c2fe03518c7a837d7d99a64a2c2d53603496 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 24 Oct 2024 12:58:47 +0530 Subject: [PATCH] fix: Unnecessary validation for non deferred sales invoices (#43816) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 8230f58d7d1..4a53e281c75 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -320,8 +320,11 @@ class SalesInvoice(SellingController): self.update_current_stock() self.validate_delivery_note() + is_deferred_invoice = any(d.get("enable_deferred_revenue") for d in self.get("items")) + # validate service stop date to lie in between start and end date - validate_service_stop_date(self) + if is_deferred_invoice: + validate_service_stop_date(self) if not self.is_opening: self.is_opening = "No" -- GitLab