mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 09:54:47 +00:00
chore: Perform automatch on submit
- misc: Clearer naming
This commit is contained in:
@@ -17,13 +17,12 @@ class BankTransaction(StatusUpdater):
|
|||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit))
|
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit))
|
||||||
|
|
||||||
def on_update(self):
|
|
||||||
self.auto_set_party()
|
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.clear_linked_payment_entries()
|
self.clear_linked_payment_entries()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
|
|
||||||
|
self.auto_set_party()
|
||||||
|
|
||||||
_saving_flag = False
|
_saving_flag = False
|
||||||
|
|
||||||
# nosemgrep: frappe-semgrep-rules.rules.frappe-modifying-but-not-comitting
|
# nosemgrep: frappe-semgrep-rules.rules.frappe-modifying-but-not-comitting
|
||||||
@@ -35,7 +34,7 @@ class BankTransaction(StatusUpdater):
|
|||||||
self.update_allocations()
|
self.update_allocations()
|
||||||
self._saving_flag = False
|
self._saving_flag = False
|
||||||
|
|
||||||
self.set_in_bank_party_mapper()
|
self.update_automatch_bank_party_mapper()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.clear_linked_payment_entries(for_cancel=True)
|
self.clear_linked_payment_entries(for_cancel=True)
|
||||||
@@ -190,8 +189,8 @@ class BankTransaction(StatusUpdater):
|
|||||||
mapper_doc.insert()
|
mapper_doc.insert()
|
||||||
self.bank_party_mapper = mapper_doc.name # Link mapper to Bank Transaction
|
self.bank_party_mapper = mapper_doc.name # Link mapper to Bank Transaction
|
||||||
|
|
||||||
def set_in_bank_party_mapper(self):
|
def update_automatch_bank_party_mapper(self):
|
||||||
"""Set in Bank Party Mapper if Party Type & Party are manually changed after submit."""
|
"""Update Bank Party Mapper if Party Type & Party are manually changed after submit."""
|
||||||
doc_before_update = self.get_doc_before_save()
|
doc_before_update = self.get_doc_before_save()
|
||||||
party_type_changed = self.party_type and (doc_before_update.party_type != self.party_type)
|
party_type_changed = self.party_type and (doc_before_update.party_type != self.party_type)
|
||||||
party_changed = self.party and (doc_before_update.party != self.party)
|
party_changed = self.party and (doc_before_update.party != self.party)
|
||||||
|
|||||||
Reference in New Issue
Block a user