Add row count as available column to batch header grids

This commit is contained in:
Lance Edgar 2017-06-21 12:59:13 -05:00
parent 0fb789fc2c
commit 83dbf405f6
2 changed files with 14 additions and 3 deletions

View file

@ -149,6 +149,7 @@ class BatchMasterView(MasterView):
g.id.set(label="ID", renderer=forms.renderers.BatchIDFieldRenderer) g.id.set(label="ID", renderer=forms.renderers.BatchIDFieldRenderer)
g.created_by.set(label="Created by", renderer=forms.renderers.UserFieldRenderer) g.created_by.set(label="Created by", renderer=forms.renderers.UserFieldRenderer)
g.cognized_by.set(renderer=forms.renderers.UserFieldRenderer) g.cognized_by.set(renderer=forms.renderers.UserFieldRenderer)
g.rowcount.set(label="Rows")
g.executed_by.set(label="Executed by", renderer=forms.renderers.UserFieldRenderer) g.executed_by.set(label="Executed by", renderer=forms.renderers.UserFieldRenderer)
def configure_grid(self, g): def configure_grid(self, g):
@ -177,6 +178,7 @@ class BatchMasterView(MasterView):
fs.created_by.set(label="Created by", renderer=forms.renderers.UserFieldRenderer, fs.created_by.set(label="Created by", renderer=forms.renderers.UserFieldRenderer,
readonly=True) readonly=True)
fs.cognized_by.set(label="Cognized by", renderer=forms.renderers.UserFieldRenderer) fs.cognized_by.set(label="Cognized by", renderer=forms.renderers.UserFieldRenderer)
fs.rowcount.set(label="Row Count")
fs.executed_by.set(label="Executed by", renderer=forms.renderers.UserFieldRenderer) fs.executed_by.set(label="Executed by", renderer=forms.renderers.UserFieldRenderer)
fs.notes.set(renderer=fa.TextAreaFieldRenderer, size=(80, 10)) fs.notes.set(renderer=fa.TextAreaFieldRenderer, size=(80, 10))

View file

@ -93,6 +93,7 @@ class HandheldBatchView(FileBatchMasterView):
g.device_name, g.device_name,
g.created, g.created,
g.created_by, g.created_by,
g.rowcount,
g.executed, g.executed,
], ],
readonly=True) readonly=True)
@ -117,6 +118,7 @@ class HandheldBatchView(FileBatchMasterView):
fs.filename, fs.filename,
fs.created, fs.created,
fs.created_by, fs.created_by,
fs.rowcount,
fs.executed, fs.executed,
fs.executed_by, fs.executed_by,
]) ])
@ -130,17 +132,24 @@ class HandheldBatchView(FileBatchMasterView):
kwargs['device_name'] = batch.device_name kwargs['device_name'] = batch.device_name
return kwargs return kwargs
def _preconfigure_row_grid(self, g):
super(HandheldBatchView, self)._preconfigure_row_grid(g)
g.upc.set(label="UPC")
g.brand_name.set(label="Brand")
g.cases.set(renderer=forms.renderers.QuantityFieldRenderer)
g.units.set(renderer=forms.renderers.QuantityFieldRenderer)
def configure_row_grid(self, g): def configure_row_grid(self, g):
g.configure( g.configure(
include=[ include=[
g.sequence, g.sequence,
g.upc.label("UPC"), g.upc,
g.brand_name.label("Brand"), g.brand_name,
g.description, g.description,
g.size, g.size,
g.cases, g.cases,
g.units, g.units,
g.status_code.label("Status"), g.status_code,
], ],
readonly=True) readonly=True)