diff --git a/plugins/1c/parser/scd_payload.py b/plugins/1c/parser/scd_payload.py index c12330a..e6ba92e 100644 --- a/plugins/1c/parser/scd_payload.py +++ b/plugins/1c/parser/scd_payload.py @@ -148,6 +148,9 @@ def scd_node_item(root: ET.Element, node: ET.Element, category: str) -> dict[str expression = child_text(node, "expression") if expression: item["expression"] = expression + presentation = child_text(node, "presentation") + if presentation: + item["presentation"] = presentation query = child_text(node, "query") if query: item["query"] = query diff --git a/tests/1c/test_payload_codec.py b/tests/1c/test_payload_codec.py index 0dea93a..43eb844 100644 --- a/tests/1c/test_payload_codec.py +++ b/tests/1c/test_payload_codec.py @@ -221,7 +221,7 @@ def test_scd_payload_decoder_reads_xml_after_platform_prefix() -> None: СуммаСумма Период Сумма - Основной + ОсновнойruОсновной вариант """ payload = b"\x00\x00\x00\x00\x01\x00\x00\x00" + xml.encode("utf-8") @@ -235,6 +235,7 @@ def test_scd_payload_decoder_reads_xml_after_platform_prefix() -> None: assert result["sections"]["calculated_fields"][0]["expression"] == "Сумма * 1.2" assert result["sections"]["groupings"] == [{"name": "Период", "source": {"kind": "scd_xml", "path": "/dataCompositionSchema[1]/group"}}] assert result["sections"]["variants"][0]["name"] == "Основной" + assert result["sections"]["variants"][0]["presentation"] == "ruОсновной вариант" assert result["analysis"]["query_parameter_references"] == [{"dataset": "ОсновнойНабор", "parameters": ["Период"]}] assert result["analysis"]["schema_outline"] == { "kind": "exact_xml_tag_inventory", @@ -249,7 +250,7 @@ def test_scd_payload_decoder_reads_xml_after_platform_prefix() -> None: {"tag": "settingsVariant", "count": 1, "paths": ["/dataCompositionSchema[1]/settingsVariant"]}, {"tag": "totalField", "count": 1, "paths": ["/dataCompositionSchema[1]/totalField"]}, ], - "all_tag_counts": {"calculatedField": 1, "dataCompositionSchema": 1, "dataPath": 2, "dataSet": 1, "dataSource": 1, "dataSourceType": 1, "expression": 2, "field": 2, "group": 1, "name": 6, "parameter": 1, "query": 1, "resource": 1, "settingsVariant": 1, "totalField": 1, "valueType": 1}, + "all_tag_counts": {"calculatedField": 1, "content": 1, "dataCompositionSchema": 1, "dataPath": 2, "dataSet": 1, "dataSource": 1, "dataSourceType": 1, "expression": 2, "field": 2, "group": 1, "item": 1, "lang": 1, "name": 6, "parameter": 1, "presentation": 1, "query": 1, "resource": 1, "settingsVariant": 1, "totalField": 1, "valueType": 1}, } assert result["analysis"]["referenced_not_declared_in_schema"] == [] assert result["analysis"]["total_field_references"] == {"fields": ["Сумма"], "missing_from_declared_fields": [], "status": "checked"}