fix: validation for si

(cherry picked from commit 61c6ebbb95)
This commit is contained in:
Gursheen Anand
2023-09-23 20:30:50 +05:30
committed by ruthra kumar
parent bec3e8ed96
commit 3dc68e3b00

View File

@@ -15,6 +15,9 @@ from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
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,
)
@@ -173,6 +176,12 @@ class SalesInvoice(SellingController):
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:
@@ -539,7 +548,7 @@ class SalesInvoice(SellingController):
"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