From 365f99fd10a9156a6034c0b5bab3ec48f601d0ab Mon Sep 17 00:00:00 2001 From: Domenico DiNicola Date: Mon, 26 Aug 2024 01:09:28 +0200 Subject: [PATCH] tweak fc admin --- backend/hct_mis_api/apps/erp_datahub/admin.py | 11 +++-------- backend/hct_mis_api/apps/mis_datahub/admin.py | 1 + 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/backend/hct_mis_api/apps/erp_datahub/admin.py b/backend/hct_mis_api/apps/erp_datahub/admin.py index 6bb0eaa3bad..67e08213a79 100644 --- a/backend/hct_mis_api/apps/erp_datahub/admin.py +++ b/backend/hct_mis_api/apps/erp_datahub/admin.py @@ -30,11 +30,7 @@ from uuid import UUID from django.db.models.query import QuerySet - from django.http import ( - HttpRequest, - HttpResponsePermanentRedirect, - HttpResponseRedirect, - ) + from django.http import HttpRequest, HttpResponsePermanentRedirect, HttpResponseRedirect class NumberValidator(RegexValidator): @@ -125,6 +121,7 @@ class FundsCommitmentAdmin(HOPEModelAdminBase): ) date_hierarchy = "create_date" form = FundsCommitmentAddForm + search_fields = ("rec_serial_number", "vendor_id", "wbs_element", "funds_commitment_number") @atomic(using="cash_assist_datahub_erp") @atomic(using="default") @@ -162,9 +159,7 @@ def assign_business_office( @button() def execute_exchange_rate_sync(self, request: "HttpRequest") -> None: if request.method == "POST": - from hct_mis_api.apps.erp_datahub.tasks.pull_from_erp_datahub import ( - PullFromErpDatahubTask, - ) + from hct_mis_api.apps.erp_datahub.tasks.pull_from_erp_datahub import PullFromErpDatahubTask task = PullFromErpDatahubTask() task.execute() diff --git a/backend/hct_mis_api/apps/mis_datahub/admin.py b/backend/hct_mis_api/apps/mis_datahub/admin.py index 481766153ca..cabbf6d0996 100644 --- a/backend/hct_mis_api/apps/mis_datahub/admin.py +++ b/backend/hct_mis_api/apps/mis_datahub/admin.py @@ -129,6 +129,7 @@ def household(self, button: button) -> Optional[str]: @admin.register(FundsCommitment) class FundsCommitmentAdmin(HUBAdminMixin): filters = (BusinessAreaFilter,) + search_fields = ("rec_serial_number", "vendor_id", "wbs_element", "funds_commitment_number") @admin.register(DownPayment)