mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
feat: validate before allowing repost
This commit is contained in:
@@ -77,6 +77,13 @@ class JournalEntry(AccountsController):
|
|||||||
if not self.title:
|
if not self.title:
|
||||||
self.title = self.get_title()
|
self.title = self.get_title()
|
||||||
|
|
||||||
|
def validate_for_repost(self):
|
||||||
|
self.validate_party()
|
||||||
|
self.validate_multi_currency()
|
||||||
|
if not frappe.flags.is_reverse_depr_entry:
|
||||||
|
self.validate_against_jv()
|
||||||
|
self.validate_stock_accounts()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.validate_cheque_info()
|
self.validate_cheque_info()
|
||||||
self.check_credit_limit()
|
self.check_credit_limit()
|
||||||
@@ -90,6 +97,7 @@ class JournalEntry(AccountsController):
|
|||||||
if hasattr(self, "repost_required"):
|
if hasattr(self, "repost_required"):
|
||||||
child_tables = {"accounts": ("account", "account_type", "bank_account")}
|
child_tables = {"accounts": ("account", "account_type", "bank_account")}
|
||||||
self.needs_repost = self.check_if_fields_updated([], child_tables)
|
self.needs_repost = self.check_if_fields_updated([], child_tables)
|
||||||
|
self.validate_for_repost()
|
||||||
self.db_set("repost_required", self.needs_repost)
|
self.db_set("repost_required", self.needs_repost)
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user