diff --git a/inventory/forms.py b/inventory/forms.py
index d5a34498..52c69ed6 100644
--- a/inventory/forms.py
+++ b/inventory/forms.py
@@ -2268,7 +2268,7 @@ class CarDealershipRegistrationForm(forms.ModelForm):
class CarDetailsEstimateCreate(forms.Form):
customer = forms.ModelChoiceField(
- queryset=Customer.objects.all(),
+ queryset=Customer.objects.filter(active=True),
required=True,
label="Customer",
widget=forms.Select(attrs={"class": "form-control"}),
diff --git a/inventory/views.py b/inventory/views.py
index 2a3326c4..1f3b1de4 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -5005,7 +5005,7 @@ def create_estimate(request, dealer_slug, slug=None):
customer = opportunity.customer
print(customer)
form.fields["customer"].queryset = models.Customer.objects.filter(
- pk=customer.pk
+ pk=customer.pk
)
form.initial["customer"] = customer
diff --git a/templates/inventory/car_detail.html b/templates/inventory/car_detail.html
index e6c88c50..a0c300fd 100644
--- a/templates/inventory/car_detail.html
+++ b/templates/inventory/car_detail.html
@@ -75,7 +75,7 @@
{% endif %}
- {% if car.ready %}
+ {% if car.ready and car.status != 'sold' %}
{% endblock %}
+
+
diff --git a/templates/sales/estimates/sale_order_form.html b/templates/sales/estimates/sale_order_form.html
index 80d7cefe..0d834097 100644
--- a/templates/sales/estimates/sale_order_form.html
+++ b/templates/sales/estimates/sale_order_form.html
@@ -28,7 +28,7 @@
{% trans 'Save' %}
-
{% trans "Cancel" %}
@@ -40,3 +40,4 @@
{% endblock content %}
+