Lead create Bugs #152
@ -2003,7 +2003,7 @@ class Lead(models.Model):
|
||||
.first()
|
||||
)
|
||||
def get_absolute_url(self):
|
||||
return reverse("lead_detail", args=[self.slug])
|
||||
return reverse("lead_detail", args=[self.dealer.slug,self.slug])
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
|
||||
@ -6031,7 +6031,7 @@ def lead_create(request, dealer_slug):
|
||||
f"lead created successfully for dealer {dealer_slug} by user:{user_username}"
|
||||
)
|
||||
messages.success(request, _("Lead created successfully"))
|
||||
return redirect("lead_list", dealer_slug=dealer.slug)
|
||||
return redirect("lead_detail",dealer_slug=dealer_slug,slug=instance.slug)
|
||||
else:
|
||||
logger.error(
|
||||
f"error creating leading for dealer {dealer_slug} by user:{user_username}"
|
||||
|
||||
@ -268,7 +268,7 @@
|
||||
<th>{% trans "Marked Price"|capfirst %}</th>
|
||||
<td>{{ car.finances.marked_price|floatformat:2 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{% comment %} <tr>
|
||||
<th>{% trans "Selling Price"|capfirst %}</th>
|
||||
<td>{{ car.finances.selling_price|floatformat:2 }}</td>
|
||||
</tr>
|
||||
@ -295,7 +295,7 @@
|
||||
<tr>
|
||||
<th>{% trans "Total"|capfirst %}</th>
|
||||
<td>{{ car.finances.total_vat|floatformat:2 }}</td>
|
||||
</tr>
|
||||
</tr> {% endcomment %}
|
||||
{% if perms.inventory.change_carfinance %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
@ -161,41 +161,39 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<!-- Custom select UI -->
|
||||
<div class="select-trigger">
|
||||
<div class="selected-value">
|
||||
<span>Select a car</span>
|
||||
<!-- Custom select UI -->
|
||||
<div class="select-trigger">
|
||||
<div class="selected-value">
|
||||
<span>Select a car</span>
|
||||
</div>
|
||||
<i class="fas fa-chevron-down dropdown-icon"></i>
|
||||
</div>
|
||||
|
||||
<div class="options-container">
|
||||
{% for item in items %}
|
||||
<div class="option" data-value="{{ item.hash }}" data-image="{{item.logo}}">
|
||||
<img src="{{item.logo}}" alt="{{item.model}}">
|
||||
<span>{{item.make}} {{item.model}} {{item.serie}} {{item.trim}} {{item.color_name}}</span>
|
||||
<div class="color-box" style="background-color: rgb({{ item.exterior_color }});"></div>
|
||||
<div class="color-box" style="background-color: rgb({{ item.interior_color }});"></div>
|
||||
<span style="color:gray;">({{item.hash_count}} in stock)</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
|
||||
<button class="btn btn-lg btn-phoenix-primary md-me-2" type="submit"><i class="fa-solid fa-floppy-disk me-1"></i>{{ _("Save") }}</button>
|
||||
<a href="{% url 'estimate_list' request.dealer.slug%}" class="btn btn-lg btn-phoenix-secondary"><i class="fa-solid fa-ban me-1"></i>{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fas fa-chevron-down dropdown-icon"></i>
|
||||
</div>
|
||||
|
||||
<div class="options-container">
|
||||
{% for item in items %}
|
||||
<div class="option" data-value="{{ item.hash }}" data-image="{{item.logo}}">
|
||||
<img src="{{item.logo}}" alt="{{item.model}}">
|
||||
<span>{{item.make}} {{item.model}} {{item.serie}} {{item.trim}} {{item.color_name}}</span>
|
||||
<div class="color-box" style="background-color: rgb({{ item.exterior_color }});"></div>
|
||||
<div class="color-box" style="background-color: rgb({{ item.interior_color }});"></div>
|
||||
<span style="color:gray;">({{item.hash_count}} in stock)</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
|
||||
<button class="btn btn-lg btn-phoenix-primary md-me-2" type="submit"><i class="fa-solid fa-floppy-disk me-1"></i>{{ _("Save") }}</button>
|
||||
<a href="{% url 'estimate_list' request.dealer.slug%}" class="btn btn-lg btn-phoenix-secondary"><i class="fa-solid fa-ban me-1"></i>{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block customJS %}
|
||||
<script>
|
||||
@ -430,5 +428,4 @@ function handleFormResponse(data) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user