From 6ffadd1fd4906f201dca33b2b290d04d0bfee708 Mon Sep 17 00:00:00 2001 From: hungdztrau123 Date: Mon, 3 Jun 2024 12:01:35 +0700 Subject: [PATCH 1/2] fix:filter-workflow --- .env | 16 ++++++++-------- src/documents/matching.py | 11 +---------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.env b/.env index 475fed8f2..e943f5e33 100644 --- a/.env +++ b/.env @@ -1,15 +1,15 @@ COMPOSE_PROJECT_NAME=paperless PAPERLESS_DEBUG=true -# PAPERLESS_REDIS=redis://localhost:6379 -PAPERLESS_REDIS=redis://:@123bytech@172.16.100.203:9377 +PAPERLESS_REDIS=redis://localhost:6379 +# PAPERLESS_REDIS=redis://:@123bytech@172.16.100.203:9377 -PAPERLESS_DBHOST=172.16.100.203 -PAPERLESS_DBPORT=5432 -PAPERLESS_DBNAME=tc_edoc -PAPERLESS_DBUSER=tc_edoc -PAPERLESS_DBPASS=27M2MV58Re2Y -PAPERLESS_DBSSLMODE=prefer +# PAPERLESS_DBHOST=172.16.100.203 +# PAPERLESS_DBPORT=5432 +# PAPERLESS_DBNAME=tc_edoc +# PAPERLESS_DBUSER=tc_edoc +# PAPERLESS_DBPASS=27M2MV58Re2Y +# PAPERLESS_DBSSLMODE=prefer URL_UPLOAD_FILE=https://ocr-core-api.tcgroup.vn/api/v1/file/upload diff --git a/src/documents/matching.py b/src/documents/matching.py index 5c5629003..90190b788 100644 --- a/src/documents/matching.py +++ b/src/documents/matching.py @@ -380,16 +380,7 @@ def existing_document_matches_workflow( ) trigger_matched = False - # Document warehouse vs trigger has_warehouse - if ( - trigger.filter_has_warehouse is not None - and document.warehouse != trigger.filter_has_warehouse - ): - reason = ( - f"Document warehouse {document.warehouse} does not match {trigger.filter_has_warehouse}", - ) - trigger_matched = False - + # Document document_type vs trigger has_document_type if ( trigger.filter_has_document_type is not None From 03157ed0c2da252371bd85f1e42463b6e96ff39a Mon Sep 17 00:00:00 2001 From: hungdztrau123 Date: Mon, 3 Jun 2024 13:29:13 +0700 Subject: [PATCH 2/2] fix:filter-workflow --- src/documents/serialisers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index 27ebe15e6..65dc9bf99 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -1537,7 +1537,6 @@ class WorkflowTriggerSerializer(serializers.ModelSerializer): "filter_has_tags", "filter_has_correspondent", "filter_has_document_type", - "filter_has_warehouse", ] def validate(self, attrs):