def get_context(self, context): address = frappe.db.get_value("Address", {"sales_partner": self.name, "is_primary_address": 1}, "*", as_dict=True) if address: city_state = ", ".join(filter(None, [address.city, address.state])) address_rows = [address.address_line1, address.address_line2, city_state, address.pincode, address.country] context.update({ "email": address.email_id, "partner_address": filter_strip_join(address_rows, "\n<br>"), "phone": filter_strip_join(cstr(address.phone).split(","), "\n<br>") }) return context
def get_context(self, context): address = frappe.db.get_value("Address", {"sales_partner": self.name, "is_primary_address": 1}, "*", as_dict=True) if address: city_state = ", ".join(filter(None, [address.city, address.state])) address_rows = [address.address_line1, address.address_line2, city_state, address.pincode, address.country] context.update({ "email": address.email_id, "partner_address": filter_strip_join(address_rows, "\n<br>"), "phone": filter_strip_join(cstr(address.phone).split(","), "\n<br>") }) return context