Skip to content

Commit

Permalink
fix: Unnecessary validation for non deferred sales invoices (frappe#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 authored Oct 24, 2024
1 parent 076486e commit af47205
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,11 @@ def validate(self):

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"
Expand Down

0 comments on commit af47205

Please sign in to comment.