EZQMS-1145: Fixes doc import tool (#6204)

* EZQMS-1145: Fixes doc import tool
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2024-08-01 12:05:07 +07:00
committed by GitHub
parent 0bb4bb04ac
commit c55e6f00b0
15 changed files with 346 additions and 60 deletions
+4 -2
View File
@@ -206,7 +206,7 @@ export async function createDocumentTemplate (
parent: Ref<ProjectDocument> | undefined,
templateId: Ref<ControlledDocument>,
prefix: string,
spec: AttachedData<ControlledDocument>,
spec: Omit<AttachedData<ControlledDocument>, 'prefix'>,
category: Ref<DocumentCategory>,
author?: Ref<Employee>,
defaultSection?: { title: string }
@@ -224,6 +224,7 @@ export async function createDocumentTemplate (
)
const seqNumber = (incResult as any).object.sequence as number
const collaborativeDocId = getCollaborativeDocForDocument('TPL-DOC', seqNumber, 0, 1)
const code = spec.code === '' ? `${TEMPLATE_PREFIX}-${seqNumber}` : spec.code
let path: Array<Ref<DocumentMeta>> = []
@@ -239,7 +240,7 @@ export async function createDocumentTemplate (
})
ops.notMatch(documents.class.Document, {
code: spec.code
code
})
ops.notMatch(documents.mixin.DocumentTemplate, {
@@ -280,6 +281,7 @@ export async function createDocumentTemplate (
'documents',
{
...spec,
code,
seqNumber,
category,
prefix: TEMPLATE_PREFIX,