diff --git a/inventory/management/commands/seed.py b/inventory/management/commands/seed.py index 27bfe1fe..14f97f88 100644 --- a/inventory/management/commands/seed.py +++ b/inventory/management/commands/seed.py @@ -20,7 +20,7 @@ class Command(BaseCommand): count = opts['count'] client = Client() # lives inside management command - for n in range(1, 10): + for n in range(6, 9): self.stdout.write(f"🚗 Seeding dealer #{n}") self._create_dealer(client, n) # self._create_cars(client, n) diff --git a/inventory/signals.py b/inventory/signals.py index 9d8008cc..ca596175 100644 --- a/inventory/signals.py +++ b/inventory/signals.py @@ -500,7 +500,7 @@ def create_item_service(sender, instance, created, **kwargs): """ if created: entity = instance.dealer.entity - uom = entity.get_uom_all().get(unit_abbr=instance.uom) + uom = entity.get_uom_all().get(name=str(instance.uom).lower()) cogs = ( entity.get_all_accounts() .filter(role=roles.COGS, active=True, role_default=True) diff --git a/inventory/tasks.py b/inventory/tasks.py index fd09ef66..c285443e 100644 --- a/inventory/tasks.py +++ b/inventory/tasks.py @@ -1157,7 +1157,7 @@ def create_user_dealer(email, password, name, arabic_name, phone, crn, vrn, addr user = User.objects.create(username=email, email=email) user.set_password(password) user.save() - EmailAddress.objects.create(user=user, email=email, verified=True, primary=True) + # EmailAddress.objects.create(user=user, email=email, verified=True, primary=True) group = Group.objects.create(name=f"{user.pk}-Admin") user.groups.add(group) for perm in Permission.objects.filter( diff --git a/inventory/views.py b/inventory/views.py index 630a5594..502ccb9c 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -6125,7 +6125,7 @@ def lead_tracking(request, dealer_slug): qs = models.Lead.objects.filter(dealer=dealer, staff=staff) else: qs = models.Lead.objects.filter(dealer=dealer) - + leads=qs won = qs.filter(status="won") new = qs.filter(status="new") lose = qs.filter(status="lose") @@ -6138,6 +6138,7 @@ def lead_tracking(request, dealer_slug): "won": won, "lose": lose, "negotiation": negotiation, + "leads":leads } return render(request, "crm/leads/lead_tracking.html", context) diff --git a/static/images/default-user-image/customer-logo.png b/static/images/default-user-image/customer-logo.png new file mode 100644 index 00000000..177e8dff Binary files /dev/null and b/static/images/default-user-image/customer-logo.png differ diff --git a/static/images/default-user-image/dealer.png b/static/images/default-user-image/dealer.png new file mode 100644 index 00000000..7127aa86 Binary files /dev/null and b/static/images/default-user-image/dealer.png differ diff --git a/static/images/default-user-image/staff.png b/static/images/default-user-image/staff.png new file mode 100644 index 00000000..167ab34d Binary files /dev/null and b/static/images/default-user-image/staff.png differ diff --git a/static/images/default-user-image/vendor.png b/static/images/default-user-image/vendor.png new file mode 100644 index 00000000..9f98dc1c Binary files /dev/null and b/static/images/default-user-image/vendor.png differ diff --git a/templates/account/login.html b/templates/account/login.html index 03ea4fdc..0c82f862 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -6,9 +6,10 @@ {% trans "Sign In" %} {% endblock head_title %} {% block content %} -
-
-
-
+ {% include 'footer.html' %} -
+ {% endblock content %} {% block customJS %} diff --git a/templates/crm/leads/lead_tracking.html b/templates/crm/leads/lead_tracking.html index 54d62cf9..bc93cb84 100644 --- a/templates/crm/leads/lead_tracking.html +++ b/templates/crm/leads/lead_tracking.html @@ -65,6 +65,8 @@ {% endblock customCSS %} {% block content %} + +{% if leads %}
@@ -168,13 +170,14 @@ {% endfor %}
- {% if not new and not follow_up and not negotiation %} - {% url 'lead_create' request.dealer.slug as create_lead_url %} - {% include "empty-illustration-page.html" with value="lead" url=create_lead_url %} - {% endif %} +
+ {% else %} + {% url 'lead_create' request.dealer.slug as create_lead_url %} + {% include "empty-illustration-page.html" with value="lead" url=create_lead_url %} + {% endif %} {% endblock %} diff --git a/templates/customers/view_customer.html b/templates/customers/view_customer.html index ad1884a5..cbd38052 100644 --- a/templates/customers/view_customer.html +++ b/templates/customers/view_customer.html @@ -147,20 +147,20 @@ {% for lead in leads %} -
{{lead}} ({{ forloop.counter }}) - {{lead.opportunity}} ({{ forloop.counter }}) + {{lead}} ({{ forloop.counter }}) + {{lead.opportunity}} ({{ forloop.counter }}) {% for estimate in lead.customer.customer_model.estimatemodel_set.all %} -
{{estimate}}
+
{{estimate}}

{% endfor %} {% for estimate in lead.customer.customer_model.estimatemodel_set.all %} -
{{estimate.sale_orders.first}}
+
{{estimate.sale_orders.first}}

{% endfor %} @@ -169,11 +169,11 @@ {% if invoice.is_paid %} -
{{invoice}}
+
{{invoice}}
{%else%} -
{{invoice}}
+
{{invoice}}
{% endif %} @@ -182,7 +182,7 @@ {% for estimate in lead.customer.customer_model.invoicemodel_set.all %} -
{{estimate.itemtransactionmodel_set.first.item_model.name}}
+
{{estimate.itemtransactionmodel_set.first.item_model.name}}

{% endfor %} diff --git a/templates/empty-illustration-page.html b/templates/empty-illustration-page.html index e9bc7315..d185b106 100644 --- a/templates/empty-illustration-page.html +++ b/templates/empty-illustration-page.html @@ -42,16 +42,19 @@ No-empty-state-image -

{% trans "No" %} {{ value|capfirst }} {% trans "Yet" %}

+

+ {% blocktrans %}No {{ value}} Yet{% endblocktrans %} +

- {% trans "It looks like you haven't added any {{ value }} to your account. - Click the button below to get started and add your first {{ value }}!" %} + {% blocktrans %}It looks like you haven't added any {{ value }} to your account. + Click the button below to get started and add your first {{ value }}!{% endblocktrans %}

- {% trans "Create New " %}{{ value|capfirst }} + + {% blocktrans %}Create New {{value}}{% endblocktrans %} diff --git a/templates/inventory/inventory_stats.html b/templates/inventory/inventory_stats.html index aa9d07ab..892ce9ea 100644 --- a/templates/inventory/inventory_stats.html +++ b/templates/inventory/inventory_stats.html @@ -5,7 +5,7 @@ {% endblock %} {% block content %} -{% if inventory %} +{% if inventory.total_cars > 0 %}
diff --git a/templates/ledger/bills/bill_list.html b/templates/ledger/bills/bill_list.html index 7b8d8fb5..c3041657 100644 --- a/templates/ledger/bills/bill_list.html +++ b/templates/ledger/bills/bill_list.html @@ -90,7 +90,7 @@ {% else %} - {% url "bill-create" request.dealer.slug as create_bill_url %} + {% url "bill-create" request.dealer.slug request.entity.slug as create_bill_url %} {% include "empty-illustration-page.html" with value="bill" url=create_bill_url %} {% endif %} {% endblock %} diff --git a/templates/ledger/ledger/ledger_list.html b/templates/ledger/ledger/ledger_list.html index bfeb7123..ff655496 100644 --- a/templates/ledger/ledger/ledger_list.html +++ b/templates/ledger/ledger/ledger_list.html @@ -131,7 +131,7 @@
{% else %} - {% url 'ledger_create' request.dealer.slug as create_ledger_url %} + {% url 'ledger_create' request.dealer.slug request.entity.slug as create_ledger_url %} {% include "empty-illustration-page.html" with value="ledger" url=create_ledger_url %} {% endif %} {% endblock %} diff --git a/templates/sales/estimates/estimate_list.html b/templates/sales/estimates/estimate_list.html index 7e4d692b..adb0bd5e 100644 --- a/templates/sales/estimates/estimate_list.html +++ b/templates/sales/estimates/estimate_list.html @@ -79,7 +79,7 @@ {% else %} {% url "estimate_create" request.dealer.slug as create_estimate_url %} - {% include "empty-illustration-page.html" with value="customer" url=create_estimate_url %} + {% include "empty-illustration-page.html" with value="estimate" url=create_estimate_url %} {% endif %} {% endblock %} diff --git a/templates/users/user_list.html b/templates/users/user_list.html index 5ca9ca57..0da15b7d 100644 --- a/templates/users/user_list.html +++ b/templates/users/user_list.html @@ -91,8 +91,28 @@ {% else %} - {% url "user_create" request.dealer.slug as create_staff_url %} - {% include "empty-illustration-page.html" with value="staff" url=create_staff_url %} + + {% if request.user.userplan %} + {% url "user_create" request.dealer.slug as create_staff_url %} + {% include "empty-illustration-page.html" with value="staff" url=create_staff_url %} + + {% else %} + + {% endif %} {% endif %} + + + {% endblock %} diff --git a/templates/welcome_base.html b/templates/welcome_base.html index 2c3dc611..e5cd4464 100644 --- a/templates/welcome_base.html +++ b/templates/welcome_base.html @@ -2,11 +2,11 @@ {% get_current_language as LANGUAGE_CODE %} @@ -78,6 +78,9 @@ {% include 'welcome_header.html' %} {% block content %} {% endblock content %} + + + {% comment %}