Add config flag to "force unit item" for inventory batch

This commit is contained in:
Lance Edgar 2019-10-21 15:35:30 -05:00
parent 65bcd8da2a
commit b311c6be7d

View file

@ -528,7 +528,8 @@ class InventoryBatchView(BatchMasterView):
product = self.find_product(entry) product = self.find_product(entry)
if product: if product:
force_unit_item = True # TODO: make configurable? force_unit_item = self.rattail_config.getbool(
'tailbone', 'inventory.force_unit_item', default=False)
if force_unit_item and product.is_pack_item(): if force_unit_item and product.is_pack_item():
product = product.unit product = product.unit
self.request.session.flash("You scanned a pack item, but must count the units instead.", 'error') self.request.session.flash("You scanned a pack item, but must count the units instead.", 'error')