mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
refactor: remove attribute check on 'repost_required'
This commit is contained in:
@@ -195,13 +195,9 @@ class JournalEntry(AccountsController):
|
|||||||
self.update_booked_depreciation()
|
self.update_booked_depreciation()
|
||||||
|
|
||||||
def on_update_after_submit(self):
|
def on_update_after_submit(self):
|
||||||
if hasattr(self, "repost_required"):
|
self.needs_repost = self.check_if_fields_updated(fields_to_check=[], child_tables={"accounts": []})
|
||||||
self.needs_repost = self.check_if_fields_updated(
|
|
||||||
fields_to_check=[], child_tables={"accounts": []}
|
|
||||||
)
|
|
||||||
if self.needs_repost:
|
if self.needs_repost:
|
||||||
self.validate_for_repost()
|
self.validate_for_repost()
|
||||||
self.db_set("repost_required", self.needs_repost)
|
|
||||||
self.repost_accounting_entries()
|
self.repost_accounting_entries()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
|
|||||||
@@ -796,7 +796,6 @@ class PurchaseInvoice(BuyingController):
|
|||||||
self.process_common_party_accounting()
|
self.process_common_party_accounting()
|
||||||
|
|
||||||
def on_update_after_submit(self):
|
def on_update_after_submit(self):
|
||||||
if hasattr(self, "repost_required"):
|
|
||||||
fields_to_check = [
|
fields_to_check = [
|
||||||
"cash_bank_account",
|
"cash_bank_account",
|
||||||
"write_off_account",
|
"write_off_account",
|
||||||
@@ -807,7 +806,6 @@ class PurchaseInvoice(BuyingController):
|
|||||||
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:
|
if self.needs_repost:
|
||||||
self.validate_for_repost()
|
self.validate_for_repost()
|
||||||
self.db_set("repost_required", self.needs_repost)
|
|
||||||
self.repost_accounting_entries()
|
self.repost_accounting_entries()
|
||||||
|
|
||||||
def make_gl_entries(self, gl_entries=None, from_repost=False):
|
def make_gl_entries(self, gl_entries=None, from_repost=False):
|
||||||
|
|||||||
@@ -568,7 +568,6 @@ class SalesInvoice(SellingController):
|
|||||||
self.repost_future_sle_and_gle()
|
self.repost_future_sle_and_gle()
|
||||||
|
|
||||||
self.db_set("status", "Cancelled")
|
self.db_set("status", "Cancelled")
|
||||||
self.db_set("repost_required", 0)
|
|
||||||
|
|
||||||
if self.coupon_code:
|
if self.coupon_code:
|
||||||
update_coupon_code_count(self.coupon_code, "cancelled")
|
update_coupon_code_count(self.coupon_code, "cancelled")
|
||||||
@@ -721,7 +720,6 @@ class SalesInvoice(SellingController):
|
|||||||
data.sales_invoice = sales_invoice
|
data.sales_invoice = sales_invoice
|
||||||
|
|
||||||
def on_update_after_submit(self):
|
def on_update_after_submit(self):
|
||||||
if hasattr(self, "repost_required"):
|
|
||||||
fields_to_check = [
|
fields_to_check = [
|
||||||
"additional_discount_account",
|
"additional_discount_account",
|
||||||
"cash_bank_account",
|
"cash_bank_account",
|
||||||
@@ -738,7 +736,6 @@ class SalesInvoice(SellingController):
|
|||||||
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:
|
if self.needs_repost:
|
||||||
self.validate_for_repost()
|
self.validate_for_repost()
|
||||||
self.db_set("repost_required", self.needs_repost)
|
|
||||||
self.repost_accounting_entries()
|
self.repost_accounting_entries()
|
||||||
|
|
||||||
def set_paid_amount(self):
|
def set_paid_amount(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user