Skip to content

Commit

Permalink
Merge pull request frappe#43818 from frappe/mergify/bp/version-15/pr-…
Browse files Browse the repository at this point in the history
…43817

fix: Unnecessary validation for non-deferred sales invoices (frappe#43816)
  • Loading branch information
deepeshgarg007 authored Oct 24, 2024
2 parents 188645b + a79bc4d commit 3df68e4
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 @@ -297,8 +297,11 @@ def validate(self):
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"
Expand Down

0 comments on commit 3df68e4

Please sign in to comment.