refactor: for non-repost fields, don't validate

This commit is contained in:
ruthra kumar 2023-10-10 17:12:47 +05:30
parent cea0d65fbd
commit c1782c5015
2 changed files with 6 additions and 4 deletions

View File

@ -539,6 +539,7 @@ class PurchaseInvoice(BuyingController):
] ]
child_tables = {"items": ("expense_account",), "taxes": ("account_head",)} child_tables = {"items": ("expense_account",), "taxes": ("account_head",)}
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables) self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
if self.needs_repost:
self.validate_for_repost() self.validate_for_repost()
self.db_set("repost_required", self.needs_repost) self.db_set("repost_required", self.needs_repost)

View File

@ -536,6 +536,7 @@ class SalesInvoice(SellingController):
"taxes": ("account_head",), "taxes": ("account_head",),
} }
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables) self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
if self.needs_repost:
self.validate_for_repost() self.validate_for_repost()
self.db_set("repost_required", self.needs_repost) self.db_set("repost_required", self.needs_repost)