Add "mark complete" button for inventory batch row entry page

This commit is contained in:
Lance Edgar 2023-10-06 15:53:17 -05:00
parent d84b98041f
commit 2f4877a264
2 changed files with 65 additions and 16 deletions

View file

@ -228,7 +228,7 @@ class InventoryBatchView(BatchMasterView):
Desktop workflow view for adding items to inventory batch.
"""
batch = self.get_instance()
if batch.executed:
if batch.executed or batch.complete:
return self.redirect(self.get_action_url('view', batch))
schema = DesktopForm().bind(session=self.Session())
@ -360,11 +360,17 @@ class InventoryBatchView(BatchMasterView):
# TODO: deprecate / remove (?)
def find_product(self, entry):
lookup_by_code = self.rattail_config.getbool(
'tailbone', 'inventory.lookup_by_code', default=False)
lookup_fields = [
'uuid',
'_product_key_',
]
return self.handler.locate_product_for_entry(
self.Session(), entry, lookup_by_code=lookup_by_code)
if self.rattail_config.getbool('tailbone', 'inventory.lookup_by_code',
default=False):
lookup_fields.append('alt_code')
return self.handler.locate_product_for_entry(self.Session(), entry,
lookup_fields=lookup_fields)
def product_info(self, product):
data = {}