mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-01 17:27:45 +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:
co-authored by
Claude Opus 4.6
parent
96d1dea552
commit
d34ddd41ff
@@ -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/>')
|
||||
|
||||
Reference in New Issue
Block a user