Commit 6ad7d6a3 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_dms: fix archiveVersion archives already archived document

parent b9e8089f
......@@ -90,7 +90,7 @@ if not language:\n
# language, we can not do anything\n
for old_document in portal_catalog(**search_kw):\n
old_document = old_document.getObject()\n
if not old_document.getLanguage():\n
if old_document.getValidationState() in validation_state and not old_document.getLanguage():\n
old_document.archive()\n
return\n
\n
......@@ -98,7 +98,8 @@ if not language:\n
search_kw[\'language\'] = language\n
for old_document in portal_catalog(**search_kw):\n
old_document = old_document.getObject()\n
old_document.archive()\n
if old_document.getValidationState() in validation_state:\n
old_document.archive()\n
]]></string> </value>
......
......@@ -2813,6 +2813,12 @@ return 1
self.assertEqual('archived', document_nolang_005.getValidationState())
self.assertEqual('shared_alive', document_nolang_006.getValidationState())
# should ignore already archived document
document_nolang_007 = document_nolang_006.Base_createCloneDocument(batch_mode=1)
document_nolang_006.archive()
document_nolang_007.shareAlive()
self.tic()
def testFileWithNotDefinedMimeType(self):
upload_file = makeFileUpload('TEST-001-en.dummy')
kw = dict(file=upload_file, synchronous_metadata_discovery=True,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment