mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-09 23:49:29 -06:00
Feature: support split documents based on tag barcodes (#11645)
This commit is contained in:
committed by
GitHub
parent
5577f70c69
commit
d16d3fb618
@@ -116,6 +116,7 @@ class BarcodeConfig(BaseConfig):
|
||||
barcode_max_pages: int = dataclasses.field(init=False)
|
||||
barcode_enable_tag: bool = dataclasses.field(init=False)
|
||||
barcode_tag_mapping: dict[str, str] = dataclasses.field(init=False)
|
||||
barcode_tag_split: bool = dataclasses.field(init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
app_config = self._get_config_instance()
|
||||
@@ -153,6 +154,9 @@ class BarcodeConfig(BaseConfig):
|
||||
self.barcode_tag_mapping = (
|
||||
app_config.barcode_tag_mapping or settings.CONSUMER_TAG_BARCODE_MAPPING
|
||||
)
|
||||
self.barcode_tag_split = (
|
||||
app_config.barcode_tag_split or settings.CONSUMER_TAG_BARCODE_SPLIT
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.1.7 on 2025-12-15 21:30
|
||||
|
||||
from django.db import migrations
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("paperless", "0005_applicationconfiguration_ai_enabled_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="applicationconfiguration",
|
||||
name="barcode_tag_split",
|
||||
field=models.BooleanField(
|
||||
null=True,
|
||||
verbose_name="Enables splitting on tag barcodes",
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -279,6 +279,12 @@ class ApplicationConfiguration(AbstractSingletonModel):
|
||||
null=True,
|
||||
)
|
||||
|
||||
# PAPERLESS_CONSUMER_TAG_BARCODE_SPLIT
|
||||
barcode_tag_split = models.BooleanField(
|
||||
verbose_name=_("Enables splitting on tag barcodes"),
|
||||
null=True,
|
||||
)
|
||||
|
||||
"""
|
||||
AI related settings
|
||||
"""
|
||||
|
||||
@@ -1149,6 +1149,10 @@ CONSUMER_TAG_BARCODE_MAPPING = dict(
|
||||
),
|
||||
)
|
||||
|
||||
CONSUMER_TAG_BARCODE_SPLIT: Final[bool] = __get_boolean(
|
||||
"PAPERLESS_CONSUMER_TAG_BARCODE_SPLIT",
|
||||
)
|
||||
|
||||
CONSUMER_ENABLE_COLLATE_DOUBLE_SIDED: Final[bool] = __get_boolean(
|
||||
"PAPERLESS_CONSUMER_ENABLE_COLLATE_DOUBLE_SIDED",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user