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 ) 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/admin_management/management.html b/templates/admin_management/management.html index 3ce8a5b5..33943c2b 100644 --- a/templates/admin_management/management.html +++ b/templates/admin_management/management.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} -

Admin Management

+

Admin Management

diff --git a/templates/crm/leads/lead_list.html b/templates/crm/leads/lead_list.html index f06f8a20..4241ea59 100644 --- a/templates/crm/leads/lead_list.html +++ b/templates/crm/leads/lead_list.html @@ -53,8 +53,8 @@
@@ -81,9 +81,9 @@
{% if page_obj.object_list %}
- +
- + - image + {% for lead in leads %} +
{{ _("Lead Name")|capfirst }}
@@ -132,7 +132,7 @@ {{ _("Action") }}
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_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/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 @@
- +
- +
{{ _('Name')|capfirst }}
@@ -103,9 +103,6 @@
{{ org.name }} -
-

{{ org.name }} -
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 efa2c984..06360a55 100644 --- a/templates/users/user_list.html +++ b/templates/users/user_list.html @@ -7,13 +7,13 @@ {% block content %}
-
+
-
+
- +
- + @@ -39,12 +39,10 @@ {% for user in users %} -
{% trans 'name'|capfirst %} {% trans 'email'|capfirst %} {% trans 'phone number'|capfirst %}
+
{{ user.arabic_name }} -
-

{{ user.name }}

-
+
{{ user.email }}