From ce111807933609304980ceadcb5f9c7cbdf9fe40 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sat, 17 Feb 2024 07:19:32 +0530 Subject: [PATCH] refactor: use popup to inform on additional reconciliation step (cherry picked from commit 0d260faa0070f767220ba724dd42b0f2d2cc922d) --- erpnext/controllers/accounts_controller.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 0f087d4854..28cca976f8 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -216,6 +216,18 @@ class AccountsController(TransactionBase): ) ) + if self.get("is_return") and self.get("return_against"): + document_type = "Credit Note" if self.doctype == "Sales Invoice" else "Debit Note" + frappe.msgprint( + _( + "{0} will be treated as a standalone {0}. Post creation use {1} tool to reconcile against {2}." + ).format( + document_type, + get_link_to_form("Payment Reconciliation", "Payment Reconciliation"), + get_link_to_form(self.doctype, self.get("return_against")), + ) + ) + pos_check_field = "is_pos" if self.doctype == "Sales Invoice" else "is_paid" if cint(self.allocate_advances_automatically) and not cint(self.get(pos_check_field)): self.set_advances()