Skip to content

Commit

Permalink
refactor: for non-repost fields, don't validate
Browse files Browse the repository at this point in the history
(cherry picked from commit c1782c5)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Oct 11, 2023
1 parent 26ad688 commit 8dd2694
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,9 @@ def on_update_after_submit(self):
]
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:
Expand Down
5 changes: 3 additions & 2 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,9 @@ def on_update_after_submit(self):
"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
Expand Down

0 comments on commit 8dd2694

Please sign in to comment.