mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-14 09:54:56 +03:00
fix(meta-compile): strip FillFromFillingValue/FillValue/DataHistory for Chart* attributes
ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes attributes don't support FillFromFillingValue, FillValue, DataHistory properties — platform rejects them with "Неверное свойство объекта метаданных". Add "chart" context to Emit-Attribute to skip these. Found via platform snapshot verification (Finding A1). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# meta-compile v1.5 — Compile 1C metadata object from JSON
|
# meta-compile v1.6 — 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,13 @@ 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 (non-stored objects don't have these)
|
# FillFromFillingValue — not for tabular/processor/chart (Chart* types don't support these)
|
||||||
if ($context -notin @("tabular", "processor")) {
|
if ($context -notin @("tabular", "processor", "chart")) {
|
||||||
X "$indent`t`t<FillFromFillingValue>false</FillFromFillingValue>"
|
X "$indent`t`t<FillFromFillingValue>false</FillFromFillingValue>"
|
||||||
}
|
}
|
||||||
|
|
||||||
# FillValue — not for tabular/processor
|
# FillValue — not for tabular/processor/chart
|
||||||
if ($context -notin @("tabular", "processor")) {
|
if ($context -notin @("tabular", "processor", "chart")) {
|
||||||
Emit-FillValue "$indent`t`t" $typeStr
|
Emit-FillValue "$indent`t`t" $typeStr
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -828,7 +828,10 @@ 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>"
|
||||||
X "$indent`t`t<DataHistory>Use</DataHistory>"
|
# DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes)
|
||||||
|
if ($context -ne "chart") {
|
||||||
|
X "$indent`t`t<DataHistory>Use</DataHistory>"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
X "$indent`t</Properties>"
|
X "$indent`t</Properties>"
|
||||||
@@ -2633,6 +2636,7 @@ if ($objType -in $typesWithAttrTS) {
|
|||||||
"Catalog" { "catalog" }
|
"Catalog" { "catalog" }
|
||||||
"Document" { "document" }
|
"Document" { "document" }
|
||||||
{ $_ -in @("DataProcessor","Report") } { "processor" }
|
{ $_ -in @("DataProcessor","Report") } { "processor" }
|
||||||
|
{ $_ -in @("ChartOfAccounts","ChartOfCharacteristicTypes","ChartOfCalculationTypes") } { "chart" }
|
||||||
default { "object" }
|
default { "object" }
|
||||||
}
|
}
|
||||||
foreach ($a in $attrs) {
|
foreach ($a in $attrs) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# meta-compile v1.5 — Compile 1C metadata object from JSON
|
# meta-compile v1.6 — 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,9 @@ 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'):
|
if context not in ('tabular', 'processor', 'chart'):
|
||||||
X(f'{indent}\t\t<FillFromFillingValue>false</FillFromFillingValue>')
|
X(f'{indent}\t\t<FillFromFillingValue>false</FillFromFillingValue>')
|
||||||
if context not in ('tabular', 'processor'):
|
if context not in ('tabular', 'processor', 'chart'):
|
||||||
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,7 +777,9 @@ 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>')
|
||||||
X(f'{indent}\t\t<DataHistory>Use</DataHistory>')
|
# DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes)
|
||||||
|
if context != 'chart':
|
||||||
|
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>')
|
||||||
|
|
||||||
@@ -2305,6 +2307,8 @@ if obj_type in types_with_attr_ts:
|
|||||||
context = 'document'
|
context = 'document'
|
||||||
elif obj_type in ('DataProcessor', 'Report'):
|
elif obj_type in ('DataProcessor', 'Report'):
|
||||||
context = 'processor'
|
context = 'processor'
|
||||||
|
elif obj_type in ('ChartOfAccounts', 'ChartOfCharacteristicTypes', 'ChartOfCalculationTypes'):
|
||||||
|
context = 'chart'
|
||||||
else:
|
else:
|
||||||
context = 'object'
|
context = 'object'
|
||||||
for a in attrs:
|
for a in attrs:
|
||||||
|
|||||||
-3
@@ -308,8 +308,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/>
|
||||||
@@ -321,7 +319,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>
|
||||||
|
|||||||
-3
@@ -340,8 +340,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/>
|
||||||
@@ -353,7 +351,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>
|
||||||
|
|||||||
Reference in New Issue
Block a user