mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-20 01:33:22 +00:00
Model and migration
This commit is contained in:
@@ -1672,6 +1672,18 @@ class WorkflowAction(models.Model):
|
||||
7,
|
||||
_("Remote OCR"),
|
||||
)
|
||||
APPLY_AI_SUGGESTIONS = (
|
||||
8,
|
||||
_("Apply AI suggestions"),
|
||||
)
|
||||
|
||||
class AISuggestionField(models.TextChoices):
|
||||
TITLE = ("title", _("Title"))
|
||||
TAGS = ("tags", _("Tags"))
|
||||
CORRESPONDENT = ("correspondent", _("Correspondent"))
|
||||
DOCUMENT_TYPE = ("document_type", _("Document type"))
|
||||
STORAGE_PATH = ("storage_path", _("Storage path"))
|
||||
CREATED = ("created", _("Created date"))
|
||||
|
||||
type = models.PositiveSmallIntegerField(
|
||||
_("Workflow Action Type"),
|
||||
@@ -1910,6 +1922,33 @@ class WorkflowAction(models.Model):
|
||||
),
|
||||
)
|
||||
|
||||
ai_suggestion_fields = models.JSONField(
|
||||
_("AI suggestion fields"),
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text=_(
|
||||
"Which of the AI-suggested fields to apply to the document.",
|
||||
),
|
||||
)
|
||||
|
||||
ai_create_missing = models.BooleanField(
|
||||
_("create missing objects"),
|
||||
default=False,
|
||||
help_text=_(
|
||||
"Create suggested tags, correspondents, document types and storage "
|
||||
"paths that do not already exist instead of skipping them.",
|
||||
),
|
||||
)
|
||||
|
||||
ai_overwrite_existing = models.BooleanField(
|
||||
_("overwrite existing values"),
|
||||
default=False,
|
||||
help_text=_(
|
||||
"Apply suggestions even if the document already has a value for that "
|
||||
"field. Tags are always added to, never replaced.",
|
||||
),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("workflow action")
|
||||
verbose_name_plural = _("workflow actions")
|
||||
|
||||
Reference in New Issue
Block a user