mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
Fix counter view with no stock
This commit is contained in:
parent
58fdb36911
commit
c7f48bd5f7
@ -143,12 +143,14 @@ class CounterTabsMixin(TabedViewMixin):
|
||||
'slug': 'last_ops',
|
||||
'name': _("Last operations"),
|
||||
})
|
||||
try:
|
||||
tab_list.append({
|
||||
'url': reverse_lazy('stock:take_items',
|
||||
kwargs={'stock_id': self.object.stock.id if hasattr(self.object, 'stock') else self.object.stock_owner.id}),
|
||||
'slug': 'take_items_from_stock',
|
||||
'name': _("Take items from stock"),
|
||||
})
|
||||
except: pass # The counter just have no stock
|
||||
return tab_list
|
||||
|
||||
class CounterMain(CounterTabsMixin, CanViewMixin, DetailView, ProcessFormView, FormMixin):
|
||||
|
Loading…
Reference in New Issue
Block a user