Fixed all known bugs, and added formulas for table rows.
This commit is contained in:
parent
36e1402a77
commit
1d7a662901
|
|
@ -7,17 +7,29 @@ def get_doctype_fields(doctype):
|
|||
for field in meta.fields:
|
||||
if field.fieldtype in ["Int", "Float", "Currency"]:
|
||||
fields.append({"fieldname": field.fieldname, "label": field.label, "fieldtype": field.fieldtype})
|
||||
# Проверяем таблицы внутри DocType (например, items в Sales Invoice)
|
||||
|
||||
# Проверяем таблицы внутри DocType
|
||||
for child in meta.fields:
|
||||
if child.fieldtype == "Table":
|
||||
child_meta = frappe.get_meta(child.options)
|
||||
for sub_field in child_meta.fields:
|
||||
if sub_field.fieldtype in ["Int", "Float", "Currency"]:
|
||||
# Обычные поля табличной части (для суммирования)
|
||||
fields.append({
|
||||
"fieldname": f"{child.fieldname}_{sub_field.fieldname}",
|
||||
"label": f"{child.label} → {sub_field.label}",
|
||||
"fieldtype": sub_field.fieldtype
|
||||
})
|
||||
|
||||
# Добавляем поля для конкретных строк таблицы (первые 10 строк)
|
||||
for row_idx in range(1, 11):
|
||||
fields.append({
|
||||
"fieldname": f"{child.fieldname}_{row_idx}_{sub_field.fieldname}",
|
||||
"label": f"{child.label} → Строка {row_idx} → {sub_field.label}",
|
||||
"fieldtype": sub_field.fieldtype,
|
||||
"is_row_specific": True,
|
||||
"row_index": row_idx
|
||||
})
|
||||
return fields
|
||||
|
||||
@frappe.whitelist()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -8,6 +8,7 @@
|
|||
"target_doctype",
|
||||
"formula_storage",
|
||||
"universal_fields_storage",
|
||||
"table_row_formulas_storage",
|
||||
"formula_fields",
|
||||
"test"
|
||||
],
|
||||
|
|
@ -20,7 +21,7 @@
|
|||
},
|
||||
{
|
||||
"fieldname": "formula_storage",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Long Text",
|
||||
"label": "formula_storage"
|
||||
},
|
||||
{
|
||||
|
|
@ -34,13 +35,18 @@
|
|||
},
|
||||
{
|
||||
"fieldname": "universal_fields_storage",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Long Text",
|
||||
"label": "universal_fields_storage"
|
||||
},
|
||||
{
|
||||
"fieldname": "table_row_formulas_storage",
|
||||
"fieldtype": "Long Text",
|
||||
"label": "table_row_formulas_storage"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2025-03-06 13:11:19.311286",
|
||||
"modified": "2025-04-03 16:25:00.731153",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Formula Editor",
|
||||
"name": "Formula Editor",
|
||||
|
|
|
|||
Loading…
Reference in New Issue