Skip to content

Commit

Permalink
fix: validation for si
Browse files Browse the repository at this point in the history
(cherry picked from commit 61c6ebb)
  • Loading branch information
GursheenK authored and ruthra-kumar committed Oct 10, 2023
1 parent bec3e8e commit 3dc68e3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
get_loyalty_program_details_with_points,
validate_loyalty_points,
)
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
validate_docs_for_deferred_accounting,
)
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import (
get_party_tax_withholding_details,
)
Expand Down Expand Up @@ -173,6 +176,12 @@ def validate_accounts(self):
self.validate_account_for_change_amount()
self.validate_income_account()

def validate_for_repost(self):
self.validate_write_off_account()
self.validate_account_for_change_amount()
self.validate_income_account()
validate_docs_for_deferred_accounting([self.name], [])

def validate_fixed_asset(self):
for d in self.get("items"):
if d.is_fixed_asset and d.meta.get_field("asset") and d.asset:
Expand Down Expand Up @@ -539,7 +548,7 @@ def on_update_after_submit(self):
"taxes": ("account_head",),
}
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
self.validate_accounts()
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)

<<<<<<< HEAD
Expand Down

0 comments on commit 3dc68e3

Please sign in to comment.