From 7dd1f5f7ed158239e6b49dfe0190afcc99790ca9 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Thu, 22 May 2025 14:04:28 +0300 Subject: [PATCH 1/4] ui bug extra text --- templates/crm/leads/lead_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/crm/leads/lead_list.html b/templates/crm/leads/lead_list.html index f06f8a20..ee9c200e 100644 --- a/templates/crm/leads/lead_list.html +++ b/templates/crm/leads/lead_list.html @@ -132,7 +132,7 @@ {{ _("Action") }} - image + {% for lead in leads %} @@ -81,9 +81,9 @@
{% if page_obj.object_list %}
- +
- +
{{ _("Lead Name")|capfirst }}
@@ -154,6 +154,7 @@
+
diff --git a/templates/customers/customer_list.html b/templates/customers/customer_list.html index 196d7aa8..15ecfad9 100644 --- a/templates/customers/customer_list.html +++ b/templates/customers/customer_list.html @@ -26,9 +26,9 @@ {% if page_obj.object_list %}
- +
- +
{{ _("Name")|capfirst }} diff --git a/templates/dealers/dealer_form.html b/templates/dealers/dealer_form.html index d439ed85..e282ef27 100644 --- a/templates/dealers/dealer_form.html +++ b/templates/dealers/dealer_form.html @@ -15,11 +15,11 @@ {% csrf_token %} {{ form|crispy }}
- - - {{ _("Cancel") }} + {% trans "Cancel" %} +
diff --git a/templates/groups/group_list.html b/templates/groups/group_list.html index f67b993f..3ab425bd 100644 --- a/templates/groups/group_list.html +++ b/templates/groups/group_list.html @@ -7,7 +7,7 @@ {% block content %}
-
+
@@ -16,11 +16,11 @@
-
+
- +
- + @@ -30,10 +30,10 @@ {% for group in groups %} - - - - + + +
{% trans 'name'|capfirst %} {% trans 'total Users'|capfirst %} {% trans 'total permission'|capfirst %}
{{ group.name }} {{ group.users.count }} {{ group.permissions.count }} + {{ group.name }} {{ group.users.count }} {{ group.permissions.count }} diff --git a/templates/inventory/car_inventory.html b/templates/inventory/car_inventory.html index f4b6d6f6..f9f451eb 100644 --- a/templates/inventory/car_inventory.html +++ b/templates/inventory/car_inventory.html @@ -46,9 +46,9 @@
- +
- + @@ -126,10 +126,15 @@
{% trans 'Stock'|upper %} {% trans "VIN" %} {% trans "Year"|upper %}
- - {% if is_paginated %} - {% include 'partials/pagination.html' %} - {% endif %} +
{{ page_obj.start_index }} {{ _("to") }} {{ page_obj.end_index }} {{ _("Items of")}} {{ page_obj.paginator.count }} +
+ + {% if is_paginated %} + {% include 'partials/pagination.html' %} + {% endif %} + +
+
{% endblock %} \ No newline at end of file diff --git a/templates/inventory/car_list_view.html b/templates/inventory/car_list_view.html index 2ea19b2d..364e4b6a 100644 --- a/templates/inventory/car_list_view.html +++ b/templates/inventory/car_list_view.html @@ -102,18 +102,18 @@ - - - - - - - - - - - - +
{{ _("VIN") }}{{ _("Make") }}{{ _("Model") }}{{ _("Year") }}{{ _("Trim") }}{{ _("Color") }}{{ _("Age") }}{{ _("Status") }}
+ + + + + + + + + + + @@ -175,7 +175,15 @@
{{ _("VIN") }}{{ _("Make") }}{{ _("Model") }}{{ _("Year") }}{{ _("Trim") }}{{ _("Color") }}{{ _("Age") }}{{ _("Status") }}
- {% include 'partials/pagination.html' %} +
{{ page_obj.start_index }} {{ _("to") }} {{ page_obj.end_index }} {{ _("Items of")}} {{ page_obj.paginator.count }} +
+ + {% if is_paginated %} + {% include 'partials/pagination.html' %} + {% endif %} + +
+
diff --git a/templates/organizations/organization_list.html b/templates/organizations/organization_list.html index 140693f9..63988909 100644 --- a/templates/organizations/organization_list.html +++ b/templates/organizations/organization_list.html @@ -39,9 +39,9 @@
- +
- + From e0b4cf36366f7c40202a8ac06aba7efadc4f9463 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Thu, 22 May 2025 18:07:11 +0300 Subject: [PATCH 4/4] fixing the dealer make ... --- inventory/views.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/inventory/views.py b/inventory/views.py index 5b20138c..0fbeeb78 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -4755,7 +4755,7 @@ def lead_create(request): instance.staff = form.cleaned_data.get("staff") if instance.lead_type == "customer": - customer = models.Customer.objects.filter(email=instance.email) + customer = models.Customer.objects.filter(email=instance.email).first() if not customer: customer = models.Customer( dealer=dealer, @@ -4773,7 +4773,7 @@ def lead_create(request): if instance.lead_type == "organization": organization = models.Organization.objects.filter( email=instance.email - ) + ).first() if not organization: organization = models.Organization( dealer=dealer, @@ -4794,6 +4794,7 @@ def lead_create(request): messages.error( request, f"Lead was not created ... : {str(form.errors)}" ) + print(form.errors) except Exception as e: messages.error(request, f"Lead was not created ... : {str(e)}") @@ -4805,7 +4806,15 @@ def lead_create(request): id_car_make=int(make) ) else: - if first_make := form.fields["id_car_make"].queryset.first(): + dealer_make_list = models.DealersMake.objects.filter(dealer=dealer).values_list("car_make",flat=True) + qs = form.fields["id_car_make"].queryset + + form.fields["id_car_make"].queryset = qs.filter(is_sa_import=True,pk__in=dealer_make_list) + form.fields["id_car_make"].choices = [ + (obj.id_car_make, obj.get_local_name()) for obj in qs + ] + print(qs) + if first_make := qs.first(): form.fields["id_car_model"].queryset = models.CarModel.objects.filter( id_car_make=first_make.id_car_make )
{{ _('Name')|capfirst }}
@@ -103,9 +103,6 @@
{{ org.name }} -
-

{{ org.name }} -
diff --git a/templates/users/user_list.html b/templates/users/user_list.html index efa2c984..f673699f 100644 --- a/templates/users/user_list.html +++ b/templates/users/user_list.html @@ -7,13 +7,13 @@ {% block content %}
-
+
-
+
- +
- + @@ -39,7 +39,7 @@ {% for user in users %} -
{% trans 'name'|capfirst %} {% trans 'email'|capfirst %} {% trans 'phone number'|capfirst %}
+
{{ user.arabic_name }}
From cc72f2d9b5553f3cfb3a5a34008840349efb3215 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Thu, 22 May 2025 16:53:52 +0300 Subject: [PATCH 3/4] user profile ui changes --- templates/account/user_settings.html | 2 +- templates/groups/group_form.html | 8 ++++---- templates/plans/billing_info_create_or_update.html | 4 ++-- templates/sales/sales_list.html | 8 ++++++++ templates/users/user_form.html | 6 +++--- templates/users/user_list.html | 4 +--- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/templates/account/user_settings.html b/templates/account/user_settings.html index 7b72fdfe..eec9dfc4 100644 --- a/templates/account/user_settings.html +++ b/templates/account/user_settings.html @@ -42,7 +42,7 @@
- +
diff --git a/templates/groups/group_form.html b/templates/groups/group_form.html index 0193f321..2f6639c8 100644 --- a/templates/groups/group_form.html +++ b/templates/groups/group_form.html @@ -6,7 +6,7 @@ {% block content %} -
+
@@ -32,9 +32,9 @@
{{ error }}
{% endfor %} diff --git a/templates/plans/billing_info_create_or_update.html b/templates/plans/billing_info_create_or_update.html index 2e7e673d..5dc24465 100644 --- a/templates/plans/billing_info_create_or_update.html +++ b/templates/plans/billing_info_create_or_update.html @@ -11,9 +11,9 @@ {% csrf_token %} {{ form|crispy }} {% if object %} - {{ _("Delete") }} + {{ _("Delete") }} {% endif %} - diff --git a/templates/sales/sales_list.html b/templates/sales/sales_list.html index ffc70a8c..960735ab 100644 --- a/templates/sales/sales_list.html +++ b/templates/sales/sales_list.html @@ -214,7 +214,15 @@
+
{{ page_obj.start_index }} {{ _("to") }} {{ page_obj.end_index }} {{ _("Items of")}} {{ page_obj.paginator.count }} +
+ {% if is_paginated %} + {% include 'partials/pagination.html' %} + {% endif %} + +
+
diff --git a/templates/users/user_form.html b/templates/users/user_form.html index b01d5e8e..84880a6f 100644 --- a/templates/users/user_form.html +++ b/templates/users/user_form.html @@ -38,9 +38,9 @@
{{ error }}
{% endfor %} diff --git a/templates/users/user_list.html b/templates/users/user_list.html index f673699f..06360a55 100644 --- a/templates/users/user_list.html +++ b/templates/users/user_list.html @@ -42,9 +42,7 @@
{{ user.arabic_name }} -
-

{{ user.name }}

-
+
{{ user.email }}