From 17068dc83481a535add7c64b041ac10284b81786 Mon Sep 17 00:00:00 2001 From: Nilesh Pant <58652823+NileshPant1999@users.noreply.github.com> Date: Tue, 17 Sep 2024 00:45:35 +0530 Subject: [PATCH] search for only active contacts in xero (#393) --- apps/xero/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/xero/models.py b/apps/xero/models.py index 09bae97a..6b316c01 100644 --- a/apps/xero/models.py +++ b/apps/xero/models.py @@ -361,7 +361,8 @@ def create_bank_transaction( value__iexact=merchant, attribute_type="CONTACT", workspace_id=expense_group.workspace_id, - ).first() + active=True + ).order_by("-updated_at").first() if not contact_id: contact_id = (