Merge pull request #37436 from ruthra-kumar/validate_for_repost_only_for_critical_fields

refactor: for non-repost fields, don't validate
This commit is contained in:
ruthra kumar 2023-10-11 20:03:16 +05:30 committed by GitHub
commit 510f12a1e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -539,8 +539,9 @@ class PurchaseInvoice(BuyingController):
]
child_tables = {"items": ("expense_account",), "taxes": ("account_head",)}
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
def make_gl_entries(self, gl_entries=None, from_repost=False):
if not gl_entries:

View File

@ -536,8 +536,9 @@ class SalesInvoice(SellingController):
"taxes": ("account_head",),
}
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
def set_paid_amount(self):
paid_amount = 0.0