Enhancement: support retain barcode split pages (#7912)

This commit is contained in:
shamoon
2024-10-13 20:51:39 -07:00
committed by GitHub
parent cb617531bc
commit 9b84dc06b6
4 changed files with 52 additions and 1 deletions

View File

@@ -387,7 +387,12 @@ class BarcodePlugin(ConsumeTaskPlugin):
"""
# filter all barcodes for the separator string
# get the page numbers of the separating barcodes
separator_pages = {bc.page: False for bc in self.barcodes if bc.is_separator}
retain = settings.CONSUMER_BARCODE_RETAIN_SPLIT_PAGES
separator_pages = {
bc.page: retain
for bc in self.barcodes
if bc.is_separator and (not retain or (retain and bc.page > 0))
} # as below, dont include the first page if retain is enabled
if not settings.CONSUMER_ENABLE_ASN_BARCODE:
return separator_pages