Tweak display of inventory/label batches to reflect multiple handheld batches
This commit is contained in:
parent
1fc3133f8e
commit
a63f2e3623
5 changed files with 35 additions and 17 deletions
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8; -*-
|
||||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2016 Lance Edgar
|
||||
# Copyright © 2010-2017 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -28,6 +28,8 @@ from __future__ import unicode_literals, absolute_import
|
|||
|
||||
from rattail.db import model
|
||||
|
||||
import formalchemy as fa
|
||||
|
||||
from tailbone import forms
|
||||
from tailbone.views.batch import BatchMasterView
|
||||
|
||||
|
@ -49,7 +51,8 @@ class LabelBatchView(BatchMasterView):
|
|||
|
||||
def _preconfigure_fieldset(self, fs):
|
||||
super(LabelBatchView, self)._preconfigure_fieldset(fs)
|
||||
fs.handheld_batch.set(renderer=forms.renderers.HandheldBatchFieldRenderer, readonly=True)
|
||||
fs.append(fa.Field('handheld_batches', renderer=forms.renderers.HandheldBatchesFieldRenderer, readonly=True,
|
||||
value=lambda b: b._handhelds))
|
||||
|
||||
def configure_fieldset(self, fs):
|
||||
fs.configure(
|
||||
|
@ -57,13 +60,13 @@ class LabelBatchView(BatchMasterView):
|
|||
fs.id,
|
||||
fs.created,
|
||||
fs.created_by,
|
||||
fs.handheld_batch,
|
||||
fs.handheld_batches,
|
||||
fs.executed,
|
||||
fs.executed_by,
|
||||
])
|
||||
batch = fs.model
|
||||
if self.viewing and not batch.handheld_batch:
|
||||
del fs.handheld_batch
|
||||
if self.viewing and not batch._handhelds:
|
||||
del fs.handheld_batches
|
||||
|
||||
def _preconfigure_row_grid(self, g):
|
||||
super(LabelBatchView, self)._preconfigure_row_grid(g)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue