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',
|
'slug': 'last_ops',
|
||||||
'name': _("Last operations"),
|
'name': _("Last operations"),
|
||||||
})
|
})
|
||||||
tab_list.append({
|
try:
|
||||||
'url': reverse_lazy('stock:take_items',
|
tab_list.append({
|
||||||
kwargs={'stock_id': self.object.stock.id if hasattr(self.object, 'stock') else self.object.stock_owner.id}),
|
'url': reverse_lazy('stock:take_items',
|
||||||
'slug': 'take_items_from_stock',
|
kwargs={'stock_id': self.object.stock.id if hasattr(self.object, 'stock') else self.object.stock_owner.id}),
|
||||||
'name': _("Take items from stock"),
|
'slug': 'take_items_from_stock',
|
||||||
})
|
'name': _("Take items from stock"),
|
||||||
|
})
|
||||||
|
except: pass # The counter just have no stock
|
||||||
return tab_list
|
return tab_list
|
||||||
|
|
||||||
class CounterMain(CounterTabsMixin, CanViewMixin, DetailView, ProcessFormView, FormMixin):
|
class CounterMain(CounterTabsMixin, CanViewMixin, DetailView, ProcessFormView, FormMixin):
|
||||||
|
Loading…
Reference in New Issue
Block a user