diff --git a/assets/templates/partials/purchasedetails_form.html b/assets/templates/partials/purchasedetails_form.html index 97acb3d5..d5979439 100644 --- a/assets/templates/partials/purchasedetails_form.html +++ b/assets/templates/partials/purchasedetails_form.html @@ -8,7 +8,7 @@ {% if create or edit or duplicate %}
- {% render_field form.purchased_from|add_class:"form-control" %} + {% include 'partials/supplier_picker.html' %}
diff --git a/assets/templates/partials/supplier_picker.html b/assets/templates/partials/supplier_picker.html new file mode 100644 index 00000000..e0989db6 --- /dev/null +++ b/assets/templates/partials/supplier_picker.html @@ -0,0 +1,63 @@ + + +{% load static %} +{% block css %} + + +{% endblock %} + +{% block preload_js %} + + +{% endblock %} + +{% block js %} + +{% endblock js %} diff --git a/assets/views.py b/assets/views.py index e8e8353c..ae62e94f 100644 --- a/assets/views.py +++ b/assets/views.py @@ -172,7 +172,7 @@ class SupplierSearch(SupplierList): result = [] for supplier in context["object_list"]: - result.append({"name": supplier.name}) + result.append({"id": supplier.pk, "name": supplier.name}) return JsonResponse(result, safe=False)