Added feature "CONSUMER_ENABLE_ASN0_SPLITTING"
This feature will change the behaviour of the document barcode consumer. If CONSUMER_ENABLE_ASN0_SPLITTING=true, detection a ASN of value 0 will NOT write that ASN into the new document metadata. This achieves document splitting on ASN0
This commit is contained in:
parent
d8c96b6e4a
commit
f3bf86c016
@ -154,6 +154,7 @@ class BarcodePlugin(ConsumeTaskPlugin):
|
|||||||
and (located_asn := self.asn) is not None
|
and (located_asn := self.asn) is not None
|
||||||
):
|
):
|
||||||
logger.info(f"Found ASN in barcode: {located_asn}")
|
logger.info(f"Found ASN in barcode: {located_asn}")
|
||||||
|
if not settings.CONSUMER_ENABLE_ASN0_SPLITTING or located_asn > 0:
|
||||||
self.metadata.asn = located_asn
|
self.metadata.asn = located_asn
|
||||||
|
|
||||||
def cleanup(self) -> None:
|
def cleanup(self) -> None:
|
||||||
|
@ -893,6 +893,10 @@ CONSUMER_ENABLE_ASN_BARCODE: Final[bool] = __get_boolean(
|
|||||||
"PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE",
|
"PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
CONSUMER_ENABLE_ASN0_SPLITTING: Final[bool] = __get_boolean(
|
||||||
|
"PAPERLESS_CONSUMER_ENABLE_ASN0_SPLITTING",
|
||||||
|
)
|
||||||
|
|
||||||
CONSUMER_ASN_BARCODE_PREFIX: Final[str] = os.getenv(
|
CONSUMER_ASN_BARCODE_PREFIX: Final[str] = os.getenv(
|
||||||
"PAPERLESS_CONSUMER_ASN_BARCODE_PREFIX",
|
"PAPERLESS_CONSUMER_ASN_BARCODE_PREFIX",
|
||||||
"ASN",
|
"ASN",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user