fix(accounts_controller): make return message translatable

(cherry picked from commit 0209f0fe29)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
This commit is contained in:
barredterra
2026-01-19 17:55:50 +01:00
committed by ruthra kumar
parent e60064f6f1
commit 8f6095d05f

View File

@@ -184,9 +184,8 @@ class AccountsController(TransactionBase):
msg = "" msg = ""
if self.get("update_outstanding_for_self"): if self.get("update_outstanding_for_self"):
msg = ( msg = _(
"We can see {0} is made against {1}. If you want {1}'s outstanding to be updated, " "We can see {0} is made against {1}. If you want {1}'s outstanding to be updated, uncheck the '{2}' checkbox."
"uncheck '{2}' checkbox. <br><br>Or"
).format( ).format(
frappe.bold(document_type), frappe.bold(document_type),
get_link_to_form(self.doctype, self.get("return_against")), get_link_to_form(self.doctype, self.get("return_against")),
@@ -197,8 +196,8 @@ class AccountsController(TransactionBase):
abs(flt(self.rounded_total) or flt(self.grand_total)) > flt(against_voucher_outstanding) abs(flt(self.rounded_total) or flt(self.grand_total)) > flt(against_voucher_outstanding)
): ):
self.update_outstanding_for_self = 1 self.update_outstanding_for_self = 1
msg = ( msg = _(
"The outstanding amount {} in {} is lesser than {}. Updating the outstanding to this invoice. <br><br>And" "The outstanding amount {0} in {1} is lesser than {2}. Updating the outstanding to this invoice."
).format( ).format(
against_voucher_outstanding, against_voucher_outstanding,
get_link_to_form(self.doctype, self.get("return_against")), get_link_to_form(self.doctype, self.get("return_against")),
@@ -206,11 +205,11 @@ class AccountsController(TransactionBase):
) )
if msg: if msg:
msg += " you can use {} tool to reconcile against {} later.".format( msg += "<br><br>" + _("You can use {0} to reconcile against {1} later.").format(
get_link_to_form("Payment Reconciliation", "Payment Reconciliation"), get_link_to_form("Payment Reconciliation", "Payment Reconciliation"),
get_link_to_form(self.doctype, self.get("return_against")), get_link_to_form(self.doctype, self.get("return_against")),
) )
frappe.msgprint(_(msg)) frappe.msgprint(msg)
def validate(self): def validate(self):
if not self.get("is_return") and not self.get("is_debit_note"): if not self.get("is_return") and not self.get("is_debit_note"):