estimateforcarform queryset update
This commit is contained in:
parent
0ba25f2e91
commit
0ee526e806
@ -2268,7 +2268,7 @@ class CarDealershipRegistrationForm(forms.ModelForm):
|
|||||||
|
|
||||||
class CarDetailsEstimateCreate(forms.Form):
|
class CarDetailsEstimateCreate(forms.Form):
|
||||||
customer = forms.ModelChoiceField(
|
customer = forms.ModelChoiceField(
|
||||||
queryset=Customer.objects.all(),
|
queryset=Customer.objects.filter(active=True),
|
||||||
required=True,
|
required=True,
|
||||||
label="Customer",
|
label="Customer",
|
||||||
widget=forms.Select(attrs={"class": "form-control"}),
|
widget=forms.Select(attrs={"class": "form-control"}),
|
||||||
|
|||||||
@ -5005,7 +5005,7 @@ def create_estimate(request, dealer_slug, slug=None):
|
|||||||
customer = opportunity.customer
|
customer = opportunity.customer
|
||||||
print(customer)
|
print(customer)
|
||||||
form.fields["customer"].queryset = models.Customer.objects.filter(
|
form.fields["customer"].queryset = models.Customer.objects.filter(
|
||||||
pk=customer.pk
|
pk=customer.pk
|
||||||
)
|
)
|
||||||
form.initial["customer"] = customer
|
form.initial["customer"] = customer
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- Main row -->
|
<!-- Main row -->
|
||||||
{% if car.ready %}
|
{% if car.ready and car.status != 'sold' %}
|
||||||
<div class="d-flex align-items-center gap-2 mb-2">
|
<div class="d-flex align-items-center gap-2 mb-2">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-sm btn-phoenix-success"
|
class="btn btn-sm btn-phoenix-success"
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
const modalBody = document.getElementById('POModalBody')
|
const modalBody = document.getElementById('POModalBody')
|
||||||
modalBody.innerHTML = `
|
modalBody.innerHTML = `
|
||||||
<div class="d-flex justify-content-center gap-3 py-3">
|
<div class="d-flex justify-content-center gap-3 py-3">
|
||||||
<a hx-boost="true" class="btn btn-phoenix-primary px-4" href="${actionUrl}">
|
<a hx-boost="true" class="btn btn-phoenix-danger px-4" href="${actionUrl}">
|
||||||
<i class="fas fa-check-circle me-2"></i>${buttonText}
|
<i class="fas fa-check-circle me-2"></i>${buttonText}
|
||||||
</a>
|
</a>
|
||||||
<button class="btn btn-phoenix-secondary" data-bs-dismiss="modal">
|
<button class="btn btn-phoenix-secondary" data-bs-dismiss="modal">
|
||||||
|
|||||||
@ -1,17 +1,19 @@
|
|||||||
<!-- templates/purchase_orders/po_confirm_delete.html -->
|
<!-- templates/purchase_orders/po_confirm_delete.html -->
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{%load i18n %}
|
||||||
{% block title %}{% trans "Confirm Delete"%} - {{ block.super }}{% endblock %}
|
{% block title %}{% trans "Confirm Delete"%} - {{ block.super }}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container mt-4">
|
<div class="container mt-4">
|
||||||
<h2>{% trans "Confirm Deletion" %}</h2>
|
<h2>{% trans "Confirm Deletion" %}</h2>
|
||||||
<p>
|
<p>
|
||||||
{% trans "Are you sure you want to delete the Purchase Order" %} <strong>"{{ po.po_number }}"</strong>?
|
{% trans "Are you sure you want to delete the Purchase Order" %} <strong>"{{ object.po_number }}"</strong>?
|
||||||
</p>
|
</p>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<button type="submit" class="btn btn-phoenix-danger">{% trans "Yes, Delete" %}</button>
|
<button type="submit" class="btn btn-phoenix-danger">{% trans "Yes, Delete" %}</button>
|
||||||
<a href="{% url 'purchase_order_detail' po.id %}"
|
<a href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug object.pk %}"
|
||||||
class="btn btn-phoenix-secondary">{% trans "Cancel" %}</a>
|
class="btn btn-phoenix-secondary">{% trans "Cancel" %}</a>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@ -18,8 +18,8 @@
|
|||||||
Purchase Order {{ po_model.po_number }}?{% endblocktrans %}
|
Purchase Order {{ po_model.po_number }}?{% endblocktrans %}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="card-text text-muted mb-4">
|
<p class="card-text text-muted mb-4">
|
||||||
{% trans "All transactions associated with this Purchase Order will be deleted.
|
{% trans "All transactions associated with this Purchase Order will be deleted.If you want to void the PO instead," %}
|
||||||
If you want to void the PO instead," %} <a href="{% url 'purchase_order_detail' dealer_slug=request.dealer.slug pk=po_model.uuid %}"
|
<a href="{% url 'purchase_order_detail' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug pk=po_model.uuid %}"
|
||||||
class="text-decoration-none">{% trans "click here" %}</a>
|
class="text-decoration-none">{% trans "click here" %}</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="d-flex justify-content-center gap-3 mt-4">
|
<div class="d-flex justify-content-center gap-3 mt-4">
|
||||||
@ -33,3 +33,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
<i class="fa-solid fa-floppy-disk me-1"></i>
|
<i class="fa-solid fa-floppy-disk me-1"></i>
|
||||||
{% trans 'Save' %}
|
{% trans 'Save' %}
|
||||||
</button>
|
</button>
|
||||||
<a href="{% url 'home' request.dealer.slug %}"
|
<a href="{% url 'estimate_detail' request.dealer.slug estimate.pk %}"
|
||||||
class="btn btn-phoenix-secondary btn-lg">
|
class="btn btn-phoenix-secondary btn-lg">
|
||||||
<i class="fa-solid fa-ban me-1"></i>
|
<i class="fa-solid fa-ban me-1"></i>
|
||||||
{% trans "Cancel" %}
|
{% trans "Cancel" %}
|
||||||
@ -40,3 +40,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user