Add proper enum for inventory batch "count mode" filter
This commit is contained in:
parent
46aa7d5824
commit
d35dc5582e
|
@ -41,7 +41,7 @@ import colander
|
||||||
import formencode as fe
|
import formencode as fe
|
||||||
from webhelpers2.html import HTML, tags
|
from webhelpers2.html import HTML, tags
|
||||||
|
|
||||||
from tailbone import forms
|
from tailbone import forms, grids
|
||||||
from tailbone.views import MasterView3 as MasterView
|
from tailbone.views import MasterView3 as MasterView
|
||||||
from tailbone.views.batch import BatchMasterView3 as BatchMasterView
|
from tailbone.views.batch import BatchMasterView3 as BatchMasterView
|
||||||
|
|
||||||
|
@ -136,10 +136,16 @@ class InventoryBatchView(BatchMasterView):
|
||||||
|
|
||||||
def configure_grid(self, g):
|
def configure_grid(self, g):
|
||||||
super(InventoryBatchView, self).configure_grid(g)
|
super(InventoryBatchView, self).configure_grid(g)
|
||||||
|
|
||||||
|
# mode
|
||||||
g.set_enum('mode', self.enum.INVENTORY_MODE)
|
g.set_enum('mode', self.enum.INVENTORY_MODE)
|
||||||
g.set_type('total_cost', 'currency')
|
g.filters['mode'].set_value_renderer(
|
||||||
|
grids.filters.EnumValueRenderer(self.enum.INVENTORY_MODE))
|
||||||
g.set_label('mode', "Count Mode")
|
g.set_label('mode', "Count Mode")
|
||||||
|
|
||||||
|
# total_cost
|
||||||
|
g.set_type('total_cost', 'currency')
|
||||||
|
|
||||||
def render_mobile_listitem(self, batch, i):
|
def render_mobile_listitem(self, batch, i):
|
||||||
return "({}) {} rows - {}, {}".format(
|
return "({}) {} rows - {}, {}".format(
|
||||||
batch.id_str,
|
batch.id_str,
|
||||||
|
|
Loading…
Reference in a new issue