2016-08-04 05:21:04 +02:00
|
|
|
from django.contrib.auth.decorators import permission_required
|
2019-04-12 17:06:53 +02:00
|
|
|
from django.urls import include, path, register_converter
|
2017-05-30 20:44:30 +02:00
|
|
|
|
2020-07-04 13:50:19 +02:00
|
|
|
from kfet import converters, views
|
2016-08-31 02:52:13 +02:00
|
|
|
from kfet.decorators import teamkfet_required
|
2016-08-02 10:40:46 +02:00
|
|
|
|
2019-04-12 17:06:53 +02:00
|
|
|
register_converter(converters.TrigrammeConverter, "trigramme")
|
|
|
|
|
2016-08-02 10:40:46 +02:00
|
|
|
urlpatterns = [
|
2019-04-12 17:06:53 +02:00
|
|
|
path("login/generic", views.login_generic, name="kfet.login.generic"),
|
|
|
|
path("history", views.history, name="kfet.history"),
|
2016-08-03 04:38:54 +02:00
|
|
|
# -----
|
2016-08-04 05:21:04 +02:00
|
|
|
# Account urls
|
2016-08-03 04:38:54 +02:00
|
|
|
# -----
|
2016-08-04 05:21:04 +02:00
|
|
|
# Account - General
|
2019-04-12 17:06:53 +02:00
|
|
|
path("accounts/", views.account, name="kfet.account"),
|
|
|
|
path(
|
|
|
|
"accounts/is_validandfree",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.account_is_validandfree_ajax,
|
|
|
|
name="kfet.account.is_validandfree.ajax",
|
|
|
|
),
|
2016-08-03 04:38:54 +02:00
|
|
|
# Account - Create
|
2019-04-12 17:06:53 +02:00
|
|
|
path("accounts/new", views.account_create, name="kfet.account.create"),
|
|
|
|
path(
|
|
|
|
"accounts/new/user/<username>",
|
2016-12-25 02:02:22 +01:00
|
|
|
views.account_create_ajax,
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.create.fromuser",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/new/clipper/<slug:login_clipper>/<fullname>",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.account_create_ajax,
|
|
|
|
name="kfet.account.create.fromclipper",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/new/empty",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.account_create_ajax,
|
|
|
|
name="kfet.account.create.empty",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"autocomplete/account_new",
|
2020-07-04 13:50:19 +02:00
|
|
|
views.AccountCreateAutocompleteView.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.create.autocomplete",
|
|
|
|
),
|
2017-01-19 04:06:09 +01:00
|
|
|
# Account - Search
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"autocomplete/account_search",
|
2020-07-04 13:50:19 +02:00
|
|
|
views.AccountSearchAutocompleteView.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.search.autocomplete",
|
|
|
|
),
|
2016-08-03 04:38:54 +02:00
|
|
|
# Account - Read
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>", views.account_read, name="kfet.account.read"
|
2018-10-06 12:35:49 +02:00
|
|
|
),
|
2016-08-03 04:38:54 +02:00
|
|
|
# Account - Update
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/edit",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.account_update,
|
|
|
|
name="kfet.account.update",
|
|
|
|
),
|
2019-05-24 14:30:00 +02:00
|
|
|
# Account - Delete
|
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/delete",
|
2019-05-24 18:35:04 +02:00
|
|
|
views.AccountDelete.as_view(),
|
2019-05-24 14:30:00 +02:00
|
|
|
name="kfet.account.delete",
|
|
|
|
),
|
2016-08-21 02:53:35 +02:00
|
|
|
# Account - Groups
|
2019-04-12 17:06:53 +02:00
|
|
|
path("accounts/groups", views.account_group, name="kfet.account.group"),
|
|
|
|
path(
|
|
|
|
"accounts/groups/new",
|
2018-10-06 12:35:49 +02:00
|
|
|
permission_required("kfet.manage_perms")(views.AccountGroupCreate.as_view()),
|
|
|
|
name="kfet.account.group.create",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/groups/<int:pk>/edit",
|
2018-10-06 12:35:49 +02:00
|
|
|
permission_required("kfet.manage_perms")(views.AccountGroupUpdate.as_view()),
|
|
|
|
name="kfet.account.group.update",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/negatives",
|
2018-10-06 12:35:49 +02:00
|
|
|
permission_required("kfet.view_negs")(views.AccountNegativeList.as_view()),
|
|
|
|
name="kfet.account.negative",
|
|
|
|
),
|
2016-12-20 22:46:38 +01:00
|
|
|
# Account - Statistics
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/stat/operations/list",
|
2017-04-05 15:34:28 +02:00
|
|
|
views.AccountStatOperationList.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.stat.operation.list",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/stat/operations",
|
2017-04-05 15:34:28 +02:00
|
|
|
views.AccountStatOperation.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.stat.operation",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/stat/balance/list",
|
2017-04-02 17:03:20 +02:00
|
|
|
views.AccountStatBalanceList.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.stat.balance.list",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/stat/balance",
|
2017-01-24 16:54:02 +01:00
|
|
|
views.AccountStatBalance.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.account.stat.balance",
|
|
|
|
),
|
2016-08-04 05:21:04 +02:00
|
|
|
# -----
|
|
|
|
# Checkout urls
|
|
|
|
# -----
|
|
|
|
# Checkout - General
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutList.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkout",
|
|
|
|
),
|
2016-08-04 05:21:04 +02:00
|
|
|
# Checkout - Create
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/new",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutCreate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkout.create",
|
|
|
|
),
|
2016-08-04 05:21:04 +02:00
|
|
|
# Checkout - Read
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/<int:pk>",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutRead.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkout.read",
|
|
|
|
),
|
2016-08-04 05:21:04 +02:00
|
|
|
# Checkout - Update
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/<int:pk>/edit",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutUpdate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkout.update",
|
|
|
|
),
|
2017-01-19 04:06:09 +01:00
|
|
|
# -----
|
|
|
|
# Checkout Statement urls
|
|
|
|
# -----
|
2016-08-11 15:14:23 +02:00
|
|
|
# Checkout Statement - General
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/statements/",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutStatementList.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkoutstatement",
|
|
|
|
),
|
2016-08-11 15:14:23 +02:00
|
|
|
# Checkout Statement - Create
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/<int:pk_checkout>/statements/add",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutStatementCreate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkoutstatement.create",
|
|
|
|
),
|
2016-08-23 00:15:17 +02:00
|
|
|
# Checkout Statement - Update
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"checkouts/<int:pk_checkout>/statements/<int:pk>/edit",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutStatementUpdate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.checkoutstatement.update",
|
|
|
|
),
|
2016-08-04 08:23:34 +02:00
|
|
|
# -----
|
|
|
|
# Article urls
|
|
|
|
# -----
|
2017-04-04 21:36:02 +02:00
|
|
|
# Category - General
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"categories/",
|
2017-04-04 21:36:02 +02:00
|
|
|
teamkfet_required(views.CategoryList.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.category",
|
|
|
|
),
|
2017-04-04 21:36:02 +02:00
|
|
|
# Category - Update
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"categories/<int:pk>/edit",
|
2017-04-04 21:36:02 +02:00
|
|
|
teamkfet_required(views.CategoryUpdate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.category.update",
|
|
|
|
),
|
2016-08-04 08:23:34 +02:00
|
|
|
# Article - General
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"articles/", teamkfet_required(views.ArticleList.as_view()), name="kfet.article"
|
2018-10-06 12:35:49 +02:00
|
|
|
),
|
2016-08-04 08:23:34 +02:00
|
|
|
# Article - Create
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"articles/new",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleCreate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.article.create",
|
|
|
|
),
|
2016-08-04 08:23:34 +02:00
|
|
|
# Article - Read
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"articles/<int:pk>",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleRead.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.article.read",
|
|
|
|
),
|
2016-08-04 08:23:34 +02:00
|
|
|
# Article - Update
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"articles/<int:pk>/edit",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleUpdate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.article.update",
|
|
|
|
),
|
2019-05-24 19:32:57 +02:00
|
|
|
# Article - Delete
|
|
|
|
path(
|
|
|
|
"articles/<int:pk>/delete",
|
|
|
|
views.ArticleDelete.as_view(),
|
|
|
|
name="kfet.article.delete",
|
|
|
|
),
|
2016-12-09 21:45:34 +01:00
|
|
|
# Article - Statistics
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"articles/<int:pk>/stat/sales/list",
|
2017-04-03 03:12:52 +02:00
|
|
|
views.ArticleStatSalesList.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.article.stat.sales.list",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"articles/<int:pk>/stat/sales",
|
2017-04-03 03:12:52 +02:00
|
|
|
views.ArticleStatSales.as_view(),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.article.stat.sales",
|
|
|
|
),
|
2016-08-06 22:19:52 +02:00
|
|
|
# -----
|
|
|
|
# K-Psul urls
|
|
|
|
# -----
|
2019-04-12 17:06:53 +02:00
|
|
|
path("k-psul/", views.kpsul, name="kfet.kpsul"),
|
|
|
|
path(
|
|
|
|
"k-psul/checkout_data",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.kpsul_checkout_data,
|
|
|
|
name="kfet.kpsul.checkout_data",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"k-psul/perform_operations",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.kpsul_perform_operations,
|
|
|
|
name="kfet.kpsul.perform_operations",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"k-psul/cancel_operations",
|
2019-12-23 14:16:23 +01:00
|
|
|
views.cancel_operations,
|
|
|
|
name="kfet.operations.cancel",
|
2018-10-06 12:35:49 +02:00
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"k-psul/articles_data",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.kpsul_articles_data,
|
|
|
|
name="kfet.kpsul.articles_data",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"k-psul/update_addcost",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.kpsul_update_addcost,
|
|
|
|
name="kfet.kpsul.update_addcost",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"k-psul/get_settings", views.kpsul_get_settings, name="kfet.kpsul.get_settings"
|
2018-10-06 12:35:49 +02:00
|
|
|
),
|
2016-08-24 02:05:05 +02:00
|
|
|
# -----
|
|
|
|
# JSON urls
|
|
|
|
# -----
|
2019-04-12 17:06:53 +02:00
|
|
|
path("history.json", views.history_json, name="kfet.history.json"),
|
2019-11-29 14:47:12 +01:00
|
|
|
path(
|
|
|
|
"accounts/<trigramme:trigramme>/.json",
|
|
|
|
views.account_read_json,
|
|
|
|
name="kfet.account.read.json",
|
|
|
|
),
|
2016-08-22 03:57:13 +02:00
|
|
|
# -----
|
|
|
|
# Settings urls
|
2016-08-24 02:05:05 +02:00
|
|
|
# -----
|
2019-04-12 17:06:53 +02:00
|
|
|
path("settings/", views.config_list, name="kfet.settings"),
|
|
|
|
path("settings/edit", views.config_update, name="kfet.settings.update"),
|
2016-08-26 15:30:40 +02:00
|
|
|
# -----
|
|
|
|
# Transfers urls
|
|
|
|
# -----
|
2019-12-26 18:58:55 +01:00
|
|
|
path("transfers/", views.TransferView.as_view(), name="kfet.transfers"),
|
2019-04-12 17:06:53 +02:00
|
|
|
path("transfers/new", views.transfers_create, name="kfet.transfers.create"),
|
|
|
|
path("transfers/perform", views.perform_transfers, name="kfet.transfers.perform"),
|
|
|
|
path("transfers/cancel", views.cancel_transfers, name="kfet.transfers.cancel"),
|
2016-08-27 14:12:01 +02:00
|
|
|
# -----
|
|
|
|
# Inventories urls
|
2016-08-27 22:55:31 +02:00
|
|
|
# -----
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"inventaires/",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.InventoryList.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.inventory",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path("inventaires/new", views.inventory_create, name="kfet.inventory.create"),
|
|
|
|
path(
|
|
|
|
"inventaires/<int:pk>",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.InventoryRead.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.inventory.read",
|
|
|
|
),
|
2020-09-11 15:22:02 +02:00
|
|
|
path(
|
|
|
|
"inventaires/<int:pk>/delete",
|
|
|
|
views.InventoryDelete.as_view(),
|
|
|
|
name="kfet.inventory.delete",
|
|
|
|
),
|
2016-08-27 22:55:31 +02:00
|
|
|
# -----
|
|
|
|
# Order urls
|
|
|
|
# -----
|
2019-04-12 17:06:53 +02:00
|
|
|
path("orders/", teamkfet_required(views.OrderList.as_view()), name="kfet.order"),
|
|
|
|
path(
|
|
|
|
"orders/<int:pk>",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.OrderRead.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.order.read",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"orders/suppliers/<int:pk>/edit",
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.SupplierUpdate.as_view()),
|
2018-10-06 12:35:49 +02:00
|
|
|
name="kfet.order.supplier.update",
|
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"orders/suppliers/<int:pk>/new-order", views.order_create, name="kfet.order.new"
|
2018-10-06 12:35:49 +02:00
|
|
|
),
|
2019-04-12 17:06:53 +02:00
|
|
|
path(
|
|
|
|
"orders/<int:pk>/to_inventory",
|
2018-10-06 12:35:49 +02:00
|
|
|
views.order_to_inventory,
|
|
|
|
name="kfet.order.to_inventory",
|
|
|
|
),
|
2016-08-02 10:40:46 +02:00
|
|
|
]
|
2017-06-21 07:08:28 +02:00
|
|
|
|
|
|
|
urlpatterns += [
|
|
|
|
# K-Fêt Open urls
|
2019-04-12 17:06:53 +02:00
|
|
|
path("open/", include("kfet.open.urls"))
|
2017-06-21 07:08:28 +02:00
|
|
|
]
|