From d35dc5582e08a32d5093acb60d1066ad85791846 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 1 Feb 2018 14:12:04 -0600 Subject: [PATCH] Add proper enum for inventory batch "count mode" filter --- tailbone/views/inventory.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tailbone/views/inventory.py b/tailbone/views/inventory.py index eb88c65a..a34dedfe 100644 --- a/tailbone/views/inventory.py +++ b/tailbone/views/inventory.py @@ -41,7 +41,7 @@ import colander import formencode as fe 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.batch import BatchMasterView3 as BatchMasterView @@ -136,10 +136,16 @@ class InventoryBatchView(BatchMasterView): def configure_grid(self, g): super(InventoryBatchView, self).configure_grid(g) + + # 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") + # total_cost + g.set_type('total_cost', 'currency') + def render_mobile_listitem(self, batch, i): return "({}) {} rows - {}, {}".format( batch.id_str,