From d2394e47e6baed4f878103477862d1bcc27b816a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 24 May 2021 12:58:39 +0300 Subject: UI fixes --- servo/models/account.py | 2 +- servo/templates/products/list_rows.html | 6 +++--- servo/views/order.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'servo') diff --git a/servo/models/account.py b/servo/models/account.py index 864535c..2641e81 100644 --- a/servo/models/account.py +++ b/servo/models/account.py @@ -263,7 +263,7 @@ class User(AbstractUser): return reverse('admin-edit_user', args=[self.pk]) def __str__(self): - return self.get_name() or self.username + return self.get_name() class Meta: app_label = "servo" diff --git a/servo/templates/products/list_rows.html b/servo/templates/products/list_rows.html index c8cf5bb..ebaa733 100755 --- a/servo/templates/products/list_rows.html +++ b/servo/templates/products/list_rows.html @@ -8,12 +8,12 @@ {{ p.code }}
{{ p.title }}
{{ p.eee_code|default:""|addspace }} - {{ p.price_sales_stock|currency }} - {{ p.price_sales_exchange|currency }} + {{ p.price_sales_stock|currency }} + {{ p.price_sales_exchange|currency }} {% if p.is_service %} ∞ {% else %} - {{ p|amount_in_location:request.user }} + {{ p|amount_in_location:request.user }} {% endif %}
diff --git a/servo/views/order.py b/servo/views/order.py index 18c2e3a..0e27e62 100644 --- a/servo/views/order.py +++ b/servo/views/order.py @@ -61,6 +61,7 @@ def prepare_list_view(request, args): orders = orders.filter(state__in=args.getlist("state")) start_date = args.get("start_date") + if start_date: end_date = args.get('end_date') or timezone.now() orders = orders.filter(created_at__range=[start_date, end_date]) -- cgit v1.2.3