fix(accounts): refresh invoice status after returns

This commit is contained in:
pandiyan
2026-10-26 21:27:33 +05:30
parent 72ef822ba3
commit 06adc585e4
2 changed files with 12 additions and 0 deletions
@@ -884,6 +884,9 @@ class PurchaseInvoice(BuyingController):
self.process_common_party_accounting()
if self.is_return and self.return_against:
frappe.get_doc(self.doctype, self.return_against).set_status(update=True)
def on_update_after_submit(self):
fields_to_check = [
"cash_bank_account",
@@ -1842,6 +1845,9 @@ class PurchaseInvoice(BuyingController):
)
self.update_advance_tax_references(cancel=1)
if self.is_return and self.return_against:
frappe.get_doc(self.doctype, self.return_against).set_status(update=True)
def update_project(self):
update_purchase_cost({d.project for d in self.items if d.project})
@@ -537,6 +537,9 @@ class SalesInvoice(SellingController):
self.process_common_party_accounting()
if self.is_return and self.return_against:
frappe.get_doc(self.doctype, self.return_against).set_status(update=True)
def validate_pos_return(self):
if self.is_consolidated:
# pos return is already validated in pos invoice
@@ -640,6 +643,9 @@ class SalesInvoice(SellingController):
self.delete_auto_created_batches()
if self.is_return and self.return_against:
frappe.get_doc(self.doctype, self.return_against).set_status(update=True)
def update_status_updater_args(self):
if cint(self.update_stock):
self.status_updater.append(