Add proper enum for inventory batch "count mode" filter

This commit is contained in:
Lance Edgar 2018-02-01 14:12:04 -06:00
parent 46aa7d5824
commit d35dc5582e

View file

@ -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,