mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
Reindent stock app
This commit is contained in:
parent
20deda8a8e
commit
df20bf6dde
@ -3,18 +3,18 @@ from django.conf.urls import include, url
|
||||
from stock.views import *
|
||||
|
||||
urlpatterns = [
|
||||
#Stock urls
|
||||
#Stock urls
|
||||
url(r'^new/counter/(?P<counter_id>[0-9]+)$', StockCreateView.as_view(), name='new'),
|
||||
url(r'^edit/(?P<stock_id>[0-9]+)$', StockEditView.as_view(), name='edit'),
|
||||
url(r'^list$', StockListView.as_view(), name='list'),
|
||||
|
||||
# StockItem urls
|
||||
# StockItem urls
|
||||
url(r'^(?P<stock_id>[0-9]+)$', StockItemList.as_view(), name='items_list'),
|
||||
url(r'^(?P<stock_id>[0-9]+)/stockItem/newItem$', StockItemCreateView.as_view(), name='new_item'),
|
||||
url(r'^stockItem/(?P<item_id>[0-9]+)/edit$', StockItemEditView.as_view(), name='edit_item'),
|
||||
url(r'^(?P<stock_id>[0-9]+)/stockItem/takeItems$', StockTakeItemsBaseFormView.as_view(), name='take_items'),
|
||||
|
||||
# ShoppingList urls
|
||||
# ShoppingList urls
|
||||
url(r'^(?P<stock_id>[0-9]+)/shoppingList/list$', StockShoppingListView.as_view(), name='shoppinglist_list'),
|
||||
url(r'^(?P<stock_id>[0-9]+)/shoppingList/create$', StockItemQuantityBaseFormView.as_view(), name='shoppinglist_create'),
|
||||
url(r'^(?P<stock_id>[0-9]+)/shoppingList/(?P<shoppinglist_id>[0-9]+)/items$', StockShoppingListItemListView.as_view(),
|
||||
@ -27,4 +27,4 @@ urlpatterns = [
|
||||
name='shoppinglist_set_todo'),
|
||||
url(r'^(?P<stock_id>[0-9]+)/shoppingList/(?P<shoppinglist_id>[0-9]+)/updateStock$', StockUpdateAfterShopppingBaseFormView.as_view(),
|
||||
name='update_after_shopping'),
|
||||
]
|
||||
]
|
||||
|
@ -373,7 +373,7 @@ class StockTakeItemsBaseFormView(CounterTabsMixin, CanEditMixin, DetailView, Bas
|
||||
for i in self.stock.items.filter(type=t).order_by('name').all():
|
||||
field_name = "item-%s" % (str(i.id))
|
||||
fields[field_name] = forms.IntegerField(required=False, label=str(i), initial=0, min_value=0, max_value=i.effective_quantity,
|
||||
help_text=_("("+ str(i.effective_quantity) + " left)"))
|
||||
help_text=_("(%(effective_quantity)s left" % {"effective_quantity": str(i.effective_quantity)}))
|
||||
kwargs[field_name] = i.effective_quantity
|
||||
kwargs['stock_id'] = self.stock.id
|
||||
kwargs['counter_id'] = self.stock.counter.id
|
||||
|
Loading…
Reference in New Issue
Block a user