mirror of
https://framagit.org/la-chariotte/la-chariotte.git
synced 2025-05-01 11:22:24 +02:00
change grouped_order_orga to grouped_order_overview
This commit is contained in:
parent
f8d95004c1
commit
3afaafbcdb
7 changed files with 17 additions and 177 deletions
|
@ -4,8 +4,12 @@ from django.utils import timezone
|
|||
|
||||
|
||||
class GroupedOrder(models.Model):
|
||||
name = models.CharField(max_length=100, null=True) # optionnal
|
||||
orga = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
name = models.CharField(
|
||||
max_length=100, null=True, verbose_name="Titre de la commande"
|
||||
) # optionnal
|
||||
orga = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, verbose_name="Organisateur·ice"
|
||||
)
|
||||
delivery_date = models.DateField("Date de livraison")
|
||||
deadline = models.DateTimeField("Date limite de commande")
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
|
||||
{% if not user.is_authenticated %}
|
||||
<p>Vous êtes l'organisateur·ice de cette commande groupée ?
|
||||
<a href="{% url 'order:grouped_order_orga' grouped_order.id %}">
|
||||
<a href="{% url 'order:grouped_order_overview' grouped_order.id %}">
|
||||
Connectez-vous pour accéder à la page de gestion</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if user == grouped_order.orga %}
|
||||
<a href="{% url 'order:grouped_order_orga' grouped_order.id %}">
|
||||
<a href="{% url 'order:grouped_order_overview' grouped_order.id %}">
|
||||
Page de gestion de la comande groupée</a>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ class TestGroupedOrderDetailView:
|
|||
)
|
||||
assert response.status_code == 302
|
||||
assert response.url == reverse(
|
||||
"order:grouped_order_orga",
|
||||
"order:grouped_order_overview",
|
||||
kwargs={
|
||||
"pk": grouped_order.pk,
|
||||
},
|
||||
|
@ -263,7 +263,7 @@ class TestGroupedOrderOrgaView:
|
|||
orga_user=other_user,
|
||||
)
|
||||
orga_view_url = reverse(
|
||||
"order:grouped_order_orga",
|
||||
"order:grouped_order_overview",
|
||||
kwargs={
|
||||
"pk": grouped_order.pk,
|
||||
},
|
||||
|
@ -274,7 +274,7 @@ class TestGroupedOrderOrgaView:
|
|||
assert response.url.startswith(reverse("login"))
|
||||
assert response.url.endswith(
|
||||
reverse(
|
||||
"order:grouped_order_orga",
|
||||
"order:grouped_order_overview",
|
||||
kwargs={
|
||||
"pk": grouped_order.pk,
|
||||
},
|
||||
|
@ -293,7 +293,7 @@ class TestGroupedOrderOrgaView:
|
|||
orga_user=other_user,
|
||||
)
|
||||
orga_view_url = reverse(
|
||||
"order:grouped_order_orga",
|
||||
"order:grouped_order_overview",
|
||||
kwargs={
|
||||
"pk": grouped_order.pk,
|
||||
},
|
||||
|
|
|
@ -9,7 +9,9 @@ urlpatterns = [
|
|||
"<int:pk>/", views.GroupedOrderDetailView.as_view(), name="grouped_order_detail"
|
||||
),
|
||||
path(
|
||||
"<int:pk>/orga", views.GroupedOrderOrgaView.as_view(), name="grouped_order_orga"
|
||||
"<int:pk>/gerer",
|
||||
views.GroupedOrderOrgaView.as_view(),
|
||||
name="grouped_order_overview",
|
||||
),
|
||||
path("<int:grouped_order_id>/commander/", views.order, name="order"),
|
||||
]
|
||||
|
|
|
@ -62,7 +62,7 @@ class GroupedOrderOrgaView(UserPassesTestMixin, generic.DetailView):
|
|||
"""Overview of a grouped order, for the organizer"""
|
||||
|
||||
model = GroupedOrder
|
||||
template_name = "order/grouped_order_orga.html"
|
||||
template_name = "order/grouped_order_overview.html"
|
||||
context_object_name = "grouped_order"
|
||||
|
||||
def test_func(self):
|
||||
|
@ -95,7 +95,7 @@ def order(
|
|||
# with POST data. This prevents data from being posted twice if a
|
||||
# user hits the Back button.
|
||||
return HttpResponseRedirect(
|
||||
reverse("order:grouped_order_orga", args=(grouped_order.pk,))
|
||||
reverse("order:grouped_order_overview", args=(grouped_order.pk,))
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,166 +0,0 @@
|
|||
Exemple de MCD en markdown avec mermaid :
|
||||
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
CourseSubmission{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField title
|
||||
DateField date
|
||||
FSMField state
|
||||
}
|
||||
CourseSubmissionProduct{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
PositiveSmallIntegerField quantity
|
||||
}
|
||||
Pricing{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField name
|
||||
}
|
||||
Product{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField name
|
||||
CharField code
|
||||
BooleanField submission_enabled
|
||||
}
|
||||
ProductPrice{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
PositiveSmallIntegerField year
|
||||
CharField price_type
|
||||
DecimalField price_flat
|
||||
PositiveSmallIntegerField price_percent
|
||||
DecimalField price_percent_minimum
|
||||
CharField unit
|
||||
}
|
||||
ProductPriceRange{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
PositiveSmallIntegerField range_start
|
||||
PositiveSmallIntegerField range_end
|
||||
DecimalField unit_price
|
||||
DecimalField minimum
|
||||
}
|
||||
ProductPricePackLine_included_products{
|
||||
AutoField id
|
||||
}
|
||||
ProductPricePackLine{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField quantity_type
|
||||
PositiveSmallIntegerField quantity
|
||||
}
|
||||
Contract{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
DateField start
|
||||
DateField end
|
||||
FileField file
|
||||
}
|
||||
Transaction_products{
|
||||
AutoField id
|
||||
}
|
||||
Transaction{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
PositiveIntegerField debit
|
||||
PositiveIntegerField credit
|
||||
BooleanField unlimited_credit
|
||||
}
|
||||
Quote{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField external_ref
|
||||
FSMField state
|
||||
}
|
||||
QuoteLine{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
TextField label
|
||||
DecimalField unit_price
|
||||
DecimalField quantity
|
||||
}
|
||||
Invoice{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField external_ref
|
||||
FSMField state
|
||||
}
|
||||
InvoiceLine{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
TextField label
|
||||
DecimalField unit_price
|
||||
DecimalField quantity
|
||||
}
|
||||
User{
|
||||
CharField password
|
||||
DateTimeField last_login
|
||||
BooleanField is_superuser
|
||||
CharField username
|
||||
CharField first_name
|
||||
CharField last_name
|
||||
EmailField email
|
||||
BooleanField is_staff
|
||||
BooleanField is_active
|
||||
DateTimeField date_joined
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
ManyToManyField groups
|
||||
ManyToManyField user_permissions
|
||||
}
|
||||
Organization{
|
||||
UUIDField id
|
||||
DateTimeField created_on
|
||||
DateTimeField updated_on
|
||||
CharField code
|
||||
CharField representative
|
||||
FileField signature
|
||||
FileField logo
|
||||
}
|
||||
CourseSubmission||--|{User : user
|
||||
CourseSubmission||--|{Organization : organization
|
||||
CourseSubmissionProduct||--|{CourseSubmission : course_submission
|
||||
CourseSubmissionProduct||--|{Product : product
|
||||
ProductPrice||--|{Pricing : pricing
|
||||
ProductPrice||--|{Product : product
|
||||
ProductPriceRange||--|{ProductPrice : product_price
|
||||
ProductPricePackLine_included_products||--|{ProductPricePackLine : productpricepackline
|
||||
ProductPricePackLine_included_products||--|{Product : product
|
||||
ProductPricePackLine||--|{ProductPrice : product_price
|
||||
ProductPricePackLine}|--|{Product : included_products
|
||||
Contract||--|{Organization : organization
|
||||
Contract||--|{Pricing : pricing
|
||||
Transaction_products||--|{Transaction : transaction
|
||||
Transaction_products||--|{Product : product
|
||||
Transaction||--|{Invoice : invoice
|
||||
Transaction||--|{CourseSubmission : course_submission
|
||||
Transaction}|--|{Product : products
|
||||
Quote||--|{Organization : organization
|
||||
QuoteLine||--|{Quote : quote
|
||||
QuoteLine||--|{Product : product
|
||||
Invoice||--|{Organization : organization
|
||||
InvoiceLine||--|{Invoice : invoice
|
||||
InvoiceLine||--|{Product : product
|
||||
Organization||--|{User : representative_user
|
||||
Organization||--|{Organization : parent
|
||||
|
||||
```
|
Loading…
Reference in a new issue