Fix default row grid config logic for batches

make sure we don't overwrite configured row labels
This commit is contained in:
Lance Edgar 2020-03-20 14:58:29 -05:00
parent 1570871884
commit 297ca3fe11

View file

@ -583,22 +583,20 @@ class BatchMasterView(MasterView):
def configure_row_grid(self, g): def configure_row_grid(self, g):
super(BatchMasterView, self).configure_row_grid(g) super(BatchMasterView, self).configure_row_grid(g)
g.set_sort_defaults('sequence')
g.set_link('sequence')
g.set_label('sequence', "Seq.")
if 'sequence' in g.filters:
g.filters['sequence'].label = "Sequence"
if 'status_code' in g.filters: if 'status_code' in g.filters:
g.filters['status_code'].set_value_renderer(grids.filters.EnumValueRenderer(self.model_row_class.STATUS)) g.filters['status_code'].set_value_renderer(grids.filters.EnumValueRenderer(self.model_row_class.STATUS))
g.set_sort_defaults('sequence')
if self.model_row_class: if self.model_row_class:
g.set_enum('status_code', self.model_row_class.STATUS) g.set_enum('status_code', self.model_row_class.STATUS)
g.set_renderer('status_code', self.render_row_status) g.set_renderer('status_code', self.render_row_status)
g.set_label('sequence', "Seq.")
g.set_label('status_code', "Status")
g.set_label('item_id', "Item ID")
g.set_link('sequence')
def get_row_status_enum(self): def get_row_status_enum(self):
return self.model_row_class.STATUS return self.model_row_class.STATUS