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 = (