diff --git a/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json b/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json index dbe8b7b8..16e86a4b 100644 --- a/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json +++ b/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json @@ -1,6 +1,16 @@ { "name": "ChartOfAccounts Item — план счетов с флагами и субконто", "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ChartOfCharacteristicTypes", + "name": "ВидыСубконто", + "valueType": "String(100)", + "predefined": ["Номенклатура: String(100)"] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, { "script": "meta-compile/scripts/meta-compile", "input": { @@ -8,6 +18,7 @@ "name": "Хозрасчетный", "codeLength": 9, "descriptionLength": 100, + "extDimensionTypes": "ChartOfCharacteristicTypes.ВидыСубконто", "maxExtDimensionCount": 3, "accountingFlags": [ { "name": "Валютный" }, diff --git a/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json b/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json index 3aec24bb..97e2d26e 100644 --- a/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json +++ b/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json @@ -1,6 +1,16 @@ { "name": "ChartOfAccounts List — план счетов, форма списка", "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ChartOfCharacteristicTypes", + "name": "ВидыСубконто", + "valueType": "String(100)", + "predefined": ["Номенклатура: String(100)"] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, { "script": "meta-compile/scripts/meta-compile", "input": { @@ -8,6 +18,7 @@ "name": "Хозрасчетный", "codeLength": 9, "descriptionLength": 100, + "extDimensionTypes": "ChartOfCharacteristicTypes.ВидыСубконто", "maxExtDimensionCount": 3, "accountingFlags": [ { "name": "Валютный" }, diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfAccounts/Хозрасчетный.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfAccounts/Хозрасчетный.xml index 6c745c4d..fd1b08a6 100644 --- a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfAccounts/Хозрасчетный.xml +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfAccounts/Хозрасчетный.xml @@ -43,7 +43,7 @@ true false - + ChartOfCharacteristicTypes.ВидыСубконто 3 9 diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто.xml new file mode 100644 index 00000000..af6b9707 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто.xml @@ -0,0 +1,97 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + UUID-006 + UUID-007 + + + UUID-008 + UUID-009 + + + UUID-010 + UUID-011 + + + UUID-012 + UUID-013 + + + + ВидыСубконто + + + ru + Виды субконто + + + + true + false + + + xs:string + + 100 + Variable + + + false + true + 9 + Variable + 100 + WholeCharacteristicKind + true + true + AsDescription + + Auto + InDialog + false + BothWays + + ChartOfCharacteristicTypes.ВидыСубконто.StandardAttribute.Description + ChartOfCharacteristicTypes.ВидыСубконто.StandardAttribute.Code + + DontUse + Begin + Directly + DontUse + Auto + + + + + + + + + + + + + Managed + Use + + + + + + DontUse + false + false + + + + diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/ObjectModule.bsl b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/ObjectModule.bsl new file mode 100644 index 00000000..e69de29b diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/Predefined.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/Predefined.xml new file mode 100644 index 00000000..29b24b84 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/Predefined.xml @@ -0,0 +1,16 @@ + + + + Номенклатура + + Номенклатура + + xs:string + + 100 + Variable + + + false + + diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/Configuration.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/Configuration.xml index 2dfd33d3..51e7edc8 100644 --- a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/Configuration.xml +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-item-simple/Configuration.xml @@ -246,6 +246,7 @@ Русский + ВидыСубконто Хозрасчетный diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfAccounts/Хозрасчетный.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfAccounts/Хозрасчетный.xml index 07b569ef..c19cfe0d 100644 --- a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfAccounts/Хозрасчетный.xml +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfAccounts/Хозрасчетный.xml @@ -43,7 +43,7 @@ true false - + ChartOfCharacteristicTypes.ВидыСубконто 3 9 diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто.xml new file mode 100644 index 00000000..af6b9707 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто.xml @@ -0,0 +1,97 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + UUID-006 + UUID-007 + + + UUID-008 + UUID-009 + + + UUID-010 + UUID-011 + + + UUID-012 + UUID-013 + + + + ВидыСубконто + + + ru + Виды субконто + + + + true + false + + + xs:string + + 100 + Variable + + + false + true + 9 + Variable + 100 + WholeCharacteristicKind + true + true + AsDescription + + Auto + InDialog + false + BothWays + + ChartOfCharacteristicTypes.ВидыСубконто.StandardAttribute.Description + ChartOfCharacteristicTypes.ВидыСубконто.StandardAttribute.Code + + DontUse + Begin + Directly + DontUse + Auto + + + + + + + + + + + + + Managed + Use + + + + + + DontUse + false + false + + + + diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/ObjectModule.bsl b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/ObjectModule.bsl new file mode 100644 index 00000000..e69de29b diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/Predefined.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/Predefined.xml new file mode 100644 index 00000000..29b24b84 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/ChartsOfCharacteristicTypes/ВидыСубконто/Ext/Predefined.xml @@ -0,0 +1,16 @@ + + + + Номенклатура + + Номенклатура + + xs:string + + 100 + Variable + + + false + + diff --git a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/Configuration.xml b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/Configuration.xml index 2dfd33d3..51e7edc8 100644 --- a/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/Configuration.xml +++ b/tests/skills/cases/form-compile-from-object/snapshots/chartofaccounts-list-simple/Configuration.xml @@ -246,6 +246,7 @@ Русский + ВидыСубконто Хозрасчетный diff --git a/tests/skills/verify-snapshots.mjs b/tests/skills/verify-snapshots.mjs index 887f1f33..dd13b7e5 100644 --- a/tests/skills/verify-snapshots.mjs +++ b/tests/skills/verify-snapshots.mjs @@ -135,9 +135,8 @@ function extractTypeRefs(input) { function getStructuralDeps(input) { const deps = []; - const hostEdits = []; // edits applied to the host (the input that triggered the dep) const inputs = Array.isArray(input) ? input : [input]; - if (!inputs[0] || !inputs[0].type) return { deps, hostEdits }; + if (!inputs[0] || !inputs[0].type) return deps; for (const inp of inputs) { const regTypePrefix = { @@ -178,28 +177,9 @@ function getStructuralDeps(input) { } } break; - case 'ChartOfAccounts': { - // ExtDimensionTypes (виды субконто) link is required when the chart uses - // any ExtDimension at all — otherwise platform rejects forms that bind to - // Объект.ExtDimensionTypes.*. - const usesExtDim = (inp.maxExtDimensionCount && inp.maxExtDimensionCount > 0) - || (Array.isArray(inp.extDimensionAccountingFlags) && inp.extDimensionAccountingFlags.length > 0); - if (usesExtDim && !inp.extDimensionTypes) { - const stubName = `ВидыСубконтоСтаб${inp.name}`; - deps.push({ - type: 'ChartOfCharacteristicTypes', name: stubName, - dsl: { type: 'ChartOfCharacteristicTypes', name: stubName, codeLength: 9, descriptionLength: 100 }, - }); - hostEdits.push({ - hostType: 'ChartOfAccounts', hostName: inp.name, - op: 'modify-property', val: `ExtDimensionTypes=ChartOfCharacteristicTypes.${stubName}`, - }); - } - break; - } } } - return { deps, hostEdits }; + return deps; } // ─── Stub creation ────────────────────────────────────────────────────────── @@ -483,10 +463,10 @@ async function verifyCase(skillName, caseName, skillConfig, caseData, opts) { if (configDir && allInputs.length > 0) { const mainNames = new Set(allInputs.map(i => `${i.type}.${i.name}`)); - // Structural deps (scanned across both main input and preRun inputs) - const { deps: structDeps, hostEdits: structHostEdits } = getStructuralDeps(allInputs); - // Stash host edits on the result so we can apply them after preRun. - result._structHostEdits = structHostEdits; + // Structural deps (scanned across both main input and preRun inputs). + // NB: только зависимости (стабы объектов, на которые ССЫЛАЕТСЯ вход). Верификатор НЕ правит сам + // проверяемый объект — иначе в 1С грузится не то, что выдал компилятор (маскировка дефекта DSL). + const structDeps = getStructuralDeps(allInputs); const structDSLs = new Map(); const structPostEdits = new Map(); for (const dep of structDeps) { @@ -550,26 +530,6 @@ async function verifyCase(skillName, caseName, skillConfig, caseData, opts) { return result; } - // ── Step 3.5: host-level structural edits (apply to objects created in preRun) ── - if (configDir && result._structHostEdits?.length) { - for (const he of result._structHostEdits) { - const dir = TYPE_TO_DIR[he.hostType]; - const objPath = dir ? join(configDir, dir, he.hostName) : null; - if (!objPath || !existsSync(objPath)) { - result.warnings.push(`HostEdit skipped (object not found): ${he.hostType}.${he.hostName}`); - continue; - } - try { - execSkill(opts.runtime, 'meta-edit/scripts/meta-edit', - ['-ObjectPath', objPath, '-Operation', he.op, '-Value', he.val]); - log(`hostEdit: ${he.hostType}.${he.hostName}`, true, `${he.op} ${he.val}`); - } catch (e) { - log(`hostEdit: ${he.hostType}.${he.hostName}`, false, e.stderr || e.message); - result.warnings.push(`HostEdit failed: ${he.hostType}.${he.hostName}`); - } - } - } - // ── Step 4: Main skill script ── let inputFile = null; if (caseData.input !== undefined) {