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
…3816)

fix: Unnecessary validation for non deferred sales invoices (frappe#43816)

(cherry picked from commit af47205)

Co-authored-by: Deepesh Garg <[email protected]>
(cherry picked from commit bf4fb53)
  • Loading branch information
mergify[bot] committed Oct 24, 2024
1 parent 188645b commit a79bc4d
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 a79bc4d

Please sign in to comment.