Allow label batches to exist without a "label profile"
This commit is contained in:
parent
ed9a56cbb4
commit
29e981ff1d
|
@ -89,12 +89,11 @@ class LabelBatchHandler(BatchHandler):
|
|||
assert batch.handheld_batch or batch.filename or batch.products
|
||||
session = orm.object_session(batch)
|
||||
self.label_profile = self.get_label_profile(session)
|
||||
assert self.label_profile
|
||||
self.setup_populate(batch, progress=progress)
|
||||
|
||||
def append(item, i):
|
||||
row = model.LabelBatchRow()
|
||||
row.label_code = self.label_profile.code
|
||||
row.label_code = self.label_profile.code if self.label_profile else None
|
||||
row.label_profile = self.label_profile
|
||||
with session.no_autoflush:
|
||||
if isinstance(item, model.Product):
|
||||
|
|
Loading…
Reference in a new issue