From e9a099716948edc7c5ace5571c53424e05f5a942 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Mon, 13 Feb 2017 15:58:49 +0530 Subject: [PATCH] [Fix] Primary Contact on top of list --- frappe/geo/address_and_contact.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/geo/address_and_contact.py b/frappe/geo/address_and_contact.py index a1d802b4a4..c76008781e 100644 --- a/frappe/geo/address_and_contact.py +++ b/frappe/geo/address_and_contact.py @@ -21,7 +21,7 @@ def load_address_and_contact(doc, key): address_list = sorted(address_list, lambda a, b: (int(a.is_primary_address - b.is_primary_address)) or - (1 if a.modified - b.modified else 0)) + (1 if a.modified - b.modified else 0), reverse=True) doc.set_onload('addr_list', address_list) @@ -36,7 +36,7 @@ def load_address_and_contact(doc, key): contact_list = sorted(contact_list, lambda a, b: (int(a.is_primary_contact - b.is_primary_contact)) or - (1 if a.modified - b.modified else 0)) + (1 if a.modified - b.modified else 0), reverse=True) doc.set_onload('contact_list', contact_list)