mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-13 01:14:56 +03:00
fix(meta-compile): strip FillFrom/FillValue/DataHistory for non-Info register attributes
Custom attributes on AccumulationRegister, AccountingRegister and
CalculationRegister do NOT support FillFromFillingValue, FillValue or
DataHistory — platform logs "Неверное свойство объекта метаданных" and
silently drops them. InformationRegister DOES support these properties
(verified against erp_8.3.24 dump for both variants).
Split the single "register" Emit-Attribute context into:
- register-info → emits the three properties (InformationRegister)
- register-other → skips them (Accum/Acc/Calc)
Chart* context already handled by 3ba6072 remains as-is. Extended the
exclusion list in Emit-Attribute to cover register-other symmetrically
for FillFromFillingValue, FillValue and DataHistory.
Updated snapshots:
- accounting-register: removed the 3 bad lines on Содержание attribute
- accumulation-register/calculation-register: added test attributes
to exercise the register-other path and regenerate snapshots cleanly
Closes the silent-rejection class #4 from upload/form-baseline/gotchas.md,
now caught by verify-snapshots -StrictLog on the E2E platform load.
Bumped meta-compile.ps1 + .py to v1.8.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# meta-compile v1.7 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.8 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
@@ -789,13 +789,14 @@ function Emit-Attribute {
|
||||
X "$indent`t`t<MinValue xsi:nil=`"true`"/>"
|
||||
X "$indent`t`t<MaxValue xsi:nil=`"true`"/>"
|
||||
|
||||
# FillFromFillingValue — not for tabular/processor/chart (Chart* types don't support these)
|
||||
if ($context -notin @("tabular", "processor", "chart")) {
|
||||
# FillFromFillingValue — not for tabular/processor/chart/register-other
|
||||
# (Chart*, AccumulationRegister/AccountingRegister/CalculationRegister don't support these)
|
||||
if ($context -notin @("tabular", "processor", "chart", "register-other")) {
|
||||
X "$indent`t`t<FillFromFillingValue>false</FillFromFillingValue>"
|
||||
}
|
||||
|
||||
# FillValue — not for tabular/processor/chart
|
||||
if ($context -notin @("tabular", "processor", "chart")) {
|
||||
# FillValue — same restriction
|
||||
if ($context -notin @("tabular", "processor", "chart", "register-other")) {
|
||||
Emit-FillValue "$indent`t`t" $typeStr
|
||||
}
|
||||
|
||||
@@ -828,8 +829,8 @@ function Emit-Attribute {
|
||||
X "$indent`t`t<Indexing>$indexing</Indexing>"
|
||||
|
||||
X "$indent`t`t<FullTextSearch>Use</FullTextSearch>"
|
||||
# DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes)
|
||||
if ($context -ne "chart") {
|
||||
# DataHistory — not for Chart* types and non-InformationRegister register family
|
||||
if ($context -notin @("chart", "register-other")) {
|
||||
X "$indent`t`t<DataHistory>Use</DataHistory>"
|
||||
}
|
||||
}
|
||||
@@ -2732,8 +2733,11 @@ if ($objType -in @("InformationRegister","AccumulationRegister","AccountingRegis
|
||||
foreach ($d in $dims) {
|
||||
Emit-Dimension "`t`t`t" $d $objType
|
||||
}
|
||||
# InformationRegister.Attribute supports FillFromFillingValue/FillValue/DataHistory;
|
||||
# AccumulationRegister/AccountingRegister/CalculationRegister.Attribute do NOT.
|
||||
$regCtx = if ($objType -eq "InformationRegister") { "register-info" } else { "register-other" }
|
||||
foreach ($a in $regAttrs) {
|
||||
Emit-Attribute "`t`t`t" $a "register"
|
||||
Emit-Attribute "`t`t`t" $a $regCtx
|
||||
}
|
||||
X "`t`t</ChildObjects>"
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# meta-compile v1.7 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.8 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
@@ -747,9 +747,11 @@ def emit_attribute(indent, parsed, context):
|
||||
X(f'{indent}\t\t<ExtendedEdit>false</ExtendedEdit>')
|
||||
X(f'{indent}\t\t<MinValue xsi:nil="true"/>')
|
||||
X(f'{indent}\t\t<MaxValue xsi:nil="true"/>')
|
||||
if context not in ('tabular', 'processor', 'chart'):
|
||||
# FillFromFillingValue / FillValue — not for tabular/processor/chart/register-other
|
||||
# (Chart*, AccumulationRegister/AccountingRegister/CalculationRegister don't support these)
|
||||
if context not in ('tabular', 'processor', 'chart', 'register-other'):
|
||||
X(f'{indent}\t\t<FillFromFillingValue>false</FillFromFillingValue>')
|
||||
if context not in ('tabular', 'processor', 'chart'):
|
||||
if context not in ('tabular', 'processor', 'chart', 'register-other'):
|
||||
emit_fill_value(f'{indent}\t\t', type_str)
|
||||
fill_checking = 'DontCheck'
|
||||
if 'req' in parsed.get('flags', []):
|
||||
@@ -777,8 +779,8 @@ def emit_attribute(indent, parsed, context):
|
||||
indexing = parsed['indexing']
|
||||
X(f'{indent}\t\t<Indexing>{indexing}</Indexing>')
|
||||
X(f'{indent}\t\t<FullTextSearch>Use</FullTextSearch>')
|
||||
# DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes)
|
||||
if context != 'chart':
|
||||
# DataHistory — not for Chart* types and non-InformationRegister register family
|
||||
if context not in ('chart', 'register-other'):
|
||||
X(f'{indent}\t\t<DataHistory>Use</DataHistory>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
X(f'{indent}</Attribute>')
|
||||
@@ -2385,8 +2387,11 @@ if obj_type in ('InformationRegister', 'AccumulationRegister', 'AccountingRegist
|
||||
emit_resource('\t\t\t', r, obj_type)
|
||||
for d in dims:
|
||||
emit_dimension('\t\t\t', d, obj_type)
|
||||
# InformationRegister.Attribute supports FillFromFillingValue/FillValue/DataHistory;
|
||||
# AccumulationRegister/AccountingRegister/CalculationRegister.Attribute do NOT.
|
||||
reg_ctx = 'register-info' if obj_type == 'InformationRegister' else 'register-other'
|
||||
for a in reg_attrs:
|
||||
emit_attribute('\t\t\t', a, 'register')
|
||||
emit_attribute('\t\t\t', a, reg_ctx)
|
||||
X('\t\t</ChildObjects>')
|
||||
else:
|
||||
X('\t\t<ChildObjects/>')
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"name": "ОстаткиТоваров",
|
||||
"registerType": "Balance",
|
||||
"dimensions": ["Номенклатура: CatalogRef.Номенклатура", "Склад: CatalogRef.Склады"],
|
||||
"resources": ["Количество: Number(15,3)"]
|
||||
"resources": ["Количество: Number(15,3)"],
|
||||
"attributes": ["Комментарий: String(200)"]
|
||||
},
|
||||
"validatePath": "AccumulationRegisters/ОстаткиТоваров",
|
||||
"expect": {
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"chartOfCalculationTypes": "ChartOfCalculationTypes.ВидыНачислений",
|
||||
"periodicity": "Month",
|
||||
"dimensions": ["Сотрудник: CatalogRef.Сотрудники"],
|
||||
"resources": ["Результат: Number(15,2)", "ОтработаноДней: Number(5,0)"]
|
||||
"resources": ["Результат: Number(15,2)", "ОтработаноДней: Number(5,0)"],
|
||||
"attributes": ["Комментарий: String(200)"]
|
||||
},
|
||||
"validatePath": "CalculationRegisters/Начисления",
|
||||
"expect": {
|
||||
|
||||
-3
@@ -288,8 +288,6 @@
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillFromFillingValue>false</FillFromFillingValue>
|
||||
<FillValue xsi:type="xs:string"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
@@ -301,7 +299,6 @@
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<Indexing>DontIndex</Indexing>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
<DataHistory>Use</DataHistory>
|
||||
</Properties>
|
||||
</Attribute>
|
||||
</ChildObjects>
|
||||
|
||||
+40
@@ -271,6 +271,46 @@
|
||||
<UseInTotals>true</UseInTotals>
|
||||
</Properties>
|
||||
</Dimension>
|
||||
<Attribute uuid="UUID-017">
|
||||
<Properties>
|
||||
<Name>Комментарий</Name>
|
||||
<Synonym>
|
||||
<v8:item>
|
||||
<v8:lang>ru</v8:lang>
|
||||
<v8:content>Комментарий</v8:content>
|
||||
</v8:item>
|
||||
</Synonym>
|
||||
<Comment/>
|
||||
<Type>
|
||||
<v8:Type>xs:string</v8:Type>
|
||||
<v8:StringQualifiers>
|
||||
<v8:Length>200</v8:Length>
|
||||
<v8:AllowedLength>Variable</v8:AllowedLength>
|
||||
</v8:StringQualifiers>
|
||||
</Type>
|
||||
<PasswordMode>false</PasswordMode>
|
||||
<Format/>
|
||||
<EditFormat/>
|
||||
<ToolTip/>
|
||||
<MarkNegatives>false</MarkNegatives>
|
||||
<Mask/>
|
||||
<MultiLine>false</MultiLine>
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
<ChoiceParameters/>
|
||||
<QuickChoice>Auto</QuickChoice>
|
||||
<CreateOnInput>Auto</CreateOnInput>
|
||||
<ChoiceForm/>
|
||||
<LinkByType/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<Indexing>DontIndex</Indexing>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
</Properties>
|
||||
</Attribute>
|
||||
</ChildObjects>
|
||||
</AccumulationRegister>
|
||||
</MetaDataObject>
|
||||
|
||||
+40
@@ -330,6 +330,46 @@
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
</Properties>
|
||||
</Dimension>
|
||||
<Attribute uuid="UUID-019">
|
||||
<Properties>
|
||||
<Name>Комментарий</Name>
|
||||
<Synonym>
|
||||
<v8:item>
|
||||
<v8:lang>ru</v8:lang>
|
||||
<v8:content>Комментарий</v8:content>
|
||||
</v8:item>
|
||||
</Synonym>
|
||||
<Comment/>
|
||||
<Type>
|
||||
<v8:Type>xs:string</v8:Type>
|
||||
<v8:StringQualifiers>
|
||||
<v8:Length>200</v8:Length>
|
||||
<v8:AllowedLength>Variable</v8:AllowedLength>
|
||||
</v8:StringQualifiers>
|
||||
</Type>
|
||||
<PasswordMode>false</PasswordMode>
|
||||
<Format/>
|
||||
<EditFormat/>
|
||||
<ToolTip/>
|
||||
<MarkNegatives>false</MarkNegatives>
|
||||
<Mask/>
|
||||
<MultiLine>false</MultiLine>
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
<ChoiceParameters/>
|
||||
<QuickChoice>Auto</QuickChoice>
|
||||
<CreateOnInput>Auto</CreateOnInput>
|
||||
<ChoiceForm/>
|
||||
<LinkByType/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<Indexing>DontIndex</Indexing>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
</Properties>
|
||||
</Attribute>
|
||||
</ChildObjects>
|
||||
</CalculationRegister>
|
||||
</MetaDataObject>
|
||||
|
||||
Reference in New Issue
Block a user