From 5da27bb26657a1012822579373beaea4065b82c4 Mon Sep 17 00:00:00 2001 From: imperosol Date: Wed, 18 Dec 2024 12:16:24 +0100 Subject: [PATCH] rename `producttype` to `product_type` --- core/templates/core/user_tools.jinja | 2 +- counter/models.py | 2 +- counter/schemas.py | 2 +- ...cttype_list.jinja => product_type_list.jinja} | 16 ++++++++++------ counter/urls.py | 12 ++++++------ counter/views/admin.py | 3 ++- counter/views/mixins.py | 2 +- locale/fr/LC_MESSAGES/django.po | 14 +++++++------- 8 files changed, 29 insertions(+), 24 deletions(-) rename counter/templates/counter/{producttype_list.jinja => product_type_list.jinja} (77%) diff --git a/core/templates/core/user_tools.jinja b/core/templates/core/user_tools.jinja index e00b24da..d9a6c0c7 100644 --- a/core/templates/core/user_tools.jinja +++ b/core/templates/core/user_tools.jinja @@ -52,7 +52,7 @@ %}
  • {% trans %}General counters management{% endtrans %}
  • {% trans %}Products management{% endtrans %}
  • -
  • {% trans %}Product types management{% endtrans %}
  • +
  • {% trans %}Product types management{% endtrans %}
  • {% trans %}Cash register summaries{% endtrans %}
  • {% trans %}Invoices call{% endtrans %}
  • {% trans %}Etickets{% endtrans %}
  • diff --git a/counter/models.py b/counter/models.py index b55207fb..48bb841f 100644 --- a/counter/models.py +++ b/counter/models.py @@ -315,7 +315,7 @@ class ProductType(OrderedModel): return self.name def get_absolute_url(self): - return reverse("counter:producttype_list") + return reverse("counter:product_type_list") def is_owned_by(self, user): """Method to see if that object can be edited by the given user.""" diff --git a/counter/schemas.py b/counter/schemas.py index 1b770a3d..adc8094b 100644 --- a/counter/schemas.py +++ b/counter/schemas.py @@ -38,7 +38,7 @@ class ProductTypeSchema(ModelSchema): @staticmethod def resolve_url(obj: ProductType) -> str: - return reverse("counter:producttype_edit", kwargs={"type_id": obj.id}) + return reverse("counter:product_type_edit", kwargs={"type_id": obj.id}) class SimpleProductTypeSchema(ModelSchema): diff --git a/counter/templates/counter/producttype_list.jinja b/counter/templates/counter/product_type_list.jinja similarity index 77% rename from counter/templates/counter/producttype_list.jinja rename to counter/templates/counter/product_type_list.jinja index 042925df..68548829 100644 --- a/counter/templates/counter/producttype_list.jinja +++ b/counter/templates/counter/product_type_list.jinja @@ -14,12 +14,12 @@ {% block content %}

    - + {% trans %}New product type{% endtrans %}

    - {% if producttype_list %} + {% if product_types %}