From b1db148dc8b2de96360d3f24526844952aa0d439 Mon Sep 17 00:00:00 2001 From: Marica Date: Tue, 28 Jan 2020 16:13:18 +0530 Subject: [PATCH] fix: More informational error message in Address. (#9352) * fix: More informational error message in Address. * fix: Changed message, added title. * fix: Changes compatible with translations. * fix: Translation fixes. * style: Fix formatting Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- frappe/contacts/doctype/address/address.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/contacts/doctype/address/address.py b/frappe/contacts/doctype/address/address.py index 75fd0ad8c6..f36122cd35 100644 --- a/frappe/contacts/doctype/address/address.py +++ b/frappe/contacts/doctype/address/address.py @@ -58,7 +58,8 @@ class Address(Document): def validate_reference(self): if self.is_your_company_address: if not [row for row in self.links if row.link_doctype == "Company"]: - frappe.throw(_("Company is mandatory, as it is your company address")) + frappe.throw(_("Address needs to be linked to a Company.Please add a row for {0} in the Links table below.") \ + .format(frappe.bold(_("Company"))), title =_("Address not Linked")) def get_display(self): return get_address_display(self.as_dict()) @@ -256,4 +257,4 @@ def address_query(doctype, txt, searchfield, start, page_len, filters): def get_condensed_address(doc): fields = ["address_title", "address_line1", "address_line2", "city", "county", "state", "country"] - return ", ".join([doc.get(d) for d in fields if doc.get(d)]) \ No newline at end of file + return ", ".join([doc.get(d) for d in fields if doc.get(d)])