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:
Nick Shirokov
2026-04-11 18:00:12 +03:00
co-authored by Claude Opus 4.6
parent 96d1dea552
commit d34ddd41ff
7 changed files with 107 additions and 19 deletions
@@ -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 # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param( param(
[Parameter(Mandatory)] [Parameter(Mandatory)]
@@ -789,13 +789,14 @@ function Emit-Attribute {
X "$indent`t`t<MinValue xsi:nil=`"true`"/>" X "$indent`t`t<MinValue xsi:nil=`"true`"/>"
X "$indent`t`t<MaxValue xsi:nil=`"true`"/>" X "$indent`t`t<MaxValue xsi:nil=`"true`"/>"
# FillFromFillingValue — not for tabular/processor/chart (Chart* types don't support these) # FillFromFillingValue — not for tabular/processor/chart/register-other
if ($context -notin @("tabular", "processor", "chart")) { # (Chart*, AccumulationRegister/AccountingRegister/CalculationRegister don't support these)
if ($context -notin @("tabular", "processor", "chart", "register-other")) {
X "$indent`t`t<FillFromFillingValue>false</FillFromFillingValue>" X "$indent`t`t<FillFromFillingValue>false</FillFromFillingValue>"
} }
# FillValue — not for tabular/processor/chart # FillValue — same restriction
if ($context -notin @("tabular", "processor", "chart")) { if ($context -notin @("tabular", "processor", "chart", "register-other")) {
Emit-FillValue "$indent`t`t" $typeStr Emit-FillValue "$indent`t`t" $typeStr
} }
@@ -828,8 +829,8 @@ function Emit-Attribute {
X "$indent`t`t<Indexing>$indexing</Indexing>" X "$indent`t`t<Indexing>$indexing</Indexing>"
X "$indent`t`t<FullTextSearch>Use</FullTextSearch>" X "$indent`t`t<FullTextSearch>Use</FullTextSearch>"
# DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes) # DataHistory — not for Chart* types and non-InformationRegister register family
if ($context -ne "chart") { if ($context -notin @("chart", "register-other")) {
X "$indent`t`t<DataHistory>Use</DataHistory>" X "$indent`t`t<DataHistory>Use</DataHistory>"
} }
} }
@@ -2732,8 +2733,11 @@ if ($objType -in @("InformationRegister","AccumulationRegister","AccountingRegis
foreach ($d in $dims) { foreach ($d in $dims) {
Emit-Dimension "`t`t`t" $d $objType 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) { foreach ($a in $regAttrs) {
Emit-Attribute "`t`t`t" $a "register" Emit-Attribute "`t`t`t" $a $regCtx
} }
X "`t`t</ChildObjects>" X "`t`t</ChildObjects>"
} else { } else {
@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/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 # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse 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<ExtendedEdit>false</ExtendedEdit>')
X(f'{indent}\t\t<MinValue xsi:nil="true"/>') X(f'{indent}\t\t<MinValue xsi:nil="true"/>')
X(f'{indent}\t\t<MaxValue 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>') 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) emit_fill_value(f'{indent}\t\t', type_str)
fill_checking = 'DontCheck' fill_checking = 'DontCheck'
if 'req' in parsed.get('flags', []): if 'req' in parsed.get('flags', []):
@@ -777,8 +779,8 @@ def emit_attribute(indent, parsed, context):
indexing = parsed['indexing'] indexing = parsed['indexing']
X(f'{indent}\t\t<Indexing>{indexing}</Indexing>') X(f'{indent}\t\t<Indexing>{indexing}</Indexing>')
X(f'{indent}\t\t<FullTextSearch>Use</FullTextSearch>') X(f'{indent}\t\t<FullTextSearch>Use</FullTextSearch>')
# DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes) # DataHistory — not for Chart* types and non-InformationRegister register family
if context != 'chart': if context not in ('chart', 'register-other'):
X(f'{indent}\t\t<DataHistory>Use</DataHistory>') X(f'{indent}\t\t<DataHistory>Use</DataHistory>')
X(f'{indent}\t</Properties>') X(f'{indent}\t</Properties>')
X(f'{indent}</Attribute>') X(f'{indent}</Attribute>')
@@ -2385,8 +2387,11 @@ if obj_type in ('InformationRegister', 'AccumulationRegister', 'AccountingRegist
emit_resource('\t\t\t', r, obj_type) emit_resource('\t\t\t', r, obj_type)
for d in dims: for d in dims:
emit_dimension('\t\t\t', d, obj_type) 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: for a in reg_attrs:
emit_attribute('\t\t\t', a, 'register') emit_attribute('\t\t\t', a, reg_ctx)
X('\t\t</ChildObjects>') X('\t\t</ChildObjects>')
else: else:
X('\t\t<ChildObjects/>') X('\t\t<ChildObjects/>')
@@ -5,7 +5,8 @@
"name": "ОстаткиТоваров", "name": "ОстаткиТоваров",
"registerType": "Balance", "registerType": "Balance",
"dimensions": ["Номенклатура: CatalogRef.Номенклатура", "Склад: CatalogRef.Склады"], "dimensions": ["Номенклатура: CatalogRef.Номенклатура", "Склад: CatalogRef.Склады"],
"resources": ["Количество: Number(15,3)"] "resources": ["Количество: Number(15,3)"],
"attributes": ["Комментарий: String(200)"]
}, },
"validatePath": "AccumulationRegisters/ОстаткиТоваров", "validatePath": "AccumulationRegisters/ОстаткиТоваров",
"expect": { "expect": {
@@ -6,7 +6,8 @@
"chartOfCalculationTypes": "ChartOfCalculationTypes.ВидыНачислений", "chartOfCalculationTypes": "ChartOfCalculationTypes.ВидыНачислений",
"periodicity": "Month", "periodicity": "Month",
"dimensions": ["Сотрудник: CatalogRef.Сотрудники"], "dimensions": ["Сотрудник: CatalogRef.Сотрудники"],
"resources": ["Результат: Number(15,2)", "ОтработаноДней: Number(5,0)"] "resources": ["Результат: Number(15,2)", "ОтработаноДней: Number(5,0)"],
"attributes": ["Комментарий: String(200)"]
}, },
"validatePath": "CalculationRegisters/Начисления", "validatePath": "CalculationRegisters/Начисления",
"expect": { "expect": {
@@ -288,8 +288,6 @@
<ExtendedEdit>false</ExtendedEdit> <ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true"/> <MinValue xsi:nil="true"/>
<MaxValue xsi:nil="true"/> <MaxValue xsi:nil="true"/>
<FillFromFillingValue>false</FillFromFillingValue>
<FillValue xsi:type="xs:string"/>
<FillChecking>DontCheck</FillChecking> <FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems> <ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks/> <ChoiceParameterLinks/>
@@ -301,7 +299,6 @@
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput> <ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Indexing>DontIndex</Indexing> <Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch> <FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties> </Properties>
</Attribute> </Attribute>
</ChildObjects> </ChildObjects>
@@ -271,6 +271,46 @@
<UseInTotals>true</UseInTotals> <UseInTotals>true</UseInTotals>
</Properties> </Properties>
</Dimension> </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> </ChildObjects>
</AccumulationRegister> </AccumulationRegister>
</MetaDataObject> </MetaDataObject>
@@ -330,6 +330,46 @@
<FullTextSearch>Use</FullTextSearch> <FullTextSearch>Use</FullTextSearch>
</Properties> </Properties>
</Dimension> </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> </ChildObjects>
</CalculationRegister> </CalculationRegister>
</MetaDataObject> </MetaDataObject>