## paperless-ngx 2.0.1
+### Please Note
+
+Exports generated in Paperless-ngx v2.0.0–2.0.1 will **not** contain consumption templates or custom fields, we recommend users upgrade to at least v2.1.
+
### Bug Fixes
- Fix: Increase field the length for consumption template source [@stumpylog](https://github.com/stumpylog) ([#4719](https://github.com/paperless-ngx/paperless-ngx/pull/4719))
## paperless-ngx 2.0.0
+### Please Note
+
+Exports generated in Paperless-ngx v2.0.0–2.0.1 will **not** contain consumption templates or custom fields, we recommend users upgrade to at least v2.1.
+
### Breaking Changes
- Breaking: Rename the environment variable for self-signed email certificates [@stumpylog](https://github.com/stumpylog) ([#4346](https://github.com/paperless-ngx/paperless-ngx/pull/4346))
from documents.file_handling import delete_empty_directories
from documents.file_handling import generate_filename
+from documents.models import ConsumptionTemplate
from documents.models import Correspondent
+from documents.models import CustomField
+from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
serializers.serialize("json", GroupObjectPermission.objects.all()),
)
+ manifest += json.loads(
+ serializers.serialize("json", ConsumptionTemplate.objects.all()),
+ )
+
+ manifest += json.loads(
+ serializers.serialize("json", CustomField.objects.all()),
+ )
+
+ if not self.split_manifest:
+ manifest += json.loads(
+ serializers.serialize("json", CustomFieldInstance.objects.all()),
+ )
+
# 3. Export files from each document
for index, document_dict in tqdm.tqdm(
enumerate(document_manifest),
from guardian.shortcuts import assign_perm
from documents.management.commands import document_exporter
+from documents.models import ConsumptionTemplate
from documents.models import Correspondent
+from documents.models import CustomField
+from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
self.dt1 = DocumentType.objects.create(name="dt")
self.c1 = Correspondent.objects.create(name="c")
self.sp1 = StoragePath.objects.create(path="{created_year}-{title}")
+ self.cf1 = CustomField.objects.create(
+ name="Custom Field 1",
+ data_type=CustomField.FieldDataType.STRING,
+ )
+ self.cfi1 = CustomFieldInstance.objects.create(
+ field=self.cf1,
+ value_text="cf instance 1",
+ document=self.d1,
+ )
self.d1.tags.add(self.t1)
self.d1.correspondent = self.c1
self.d1.save()
self.d4.storage_path = self.sp1
self.d4.save()
+
+ self.ct1 = ConsumptionTemplate.objects.create(name="CT 1", filter_path="*")
+
super().setUp()
def _get_document_from_manifest(self, manifest, id):
manifest = self._do_export(use_filename_format=use_filename_format)
- self.assertEqual(len(manifest), 169)
+ self.assertEqual(len(manifest), 172)
# dont include consumer or AnonymousUser users
self.assertEqual(