From 5cbd7aee97b66ab7cf253cbb3839f4513178a7e6 Mon Sep 17 00:00:00 2001 From: jingrow Date: Thu, 23 Oct 2025 21:06:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=BAPageField?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crm/api/doc.py | 30 +++++++++++++++--------------- crm/install.py | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crm/api/doc.py b/crm/api/doc.py index 2291a2b9..52f28475 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -71,9 +71,9 @@ def get_filterable_fields(pagetype: str): res = [] - # append DocFields - DocField = jingrow.qb.PageType("DocField") - pg_fields = get_pagetype_fields_meta(DocField, pagetype, allowed_fieldtypes, restricted_fields) + # append PageFields + PageField = jingrow.qb.PageType("PageField") + pg_fields = get_pagetype_fields_meta(PageField, pagetype, allowed_fieldtypes, restricted_fields) res.extend(pg_fields) # append Custom Fields @@ -161,21 +161,21 @@ def get_group_by_fields(pagetype: str): return fields -def get_pagetype_fields_meta(DocField, pagetype, allowed_fieldtypes, restricted_fields): - parent = "parent" if DocField._table_name == "tabDocField" else "dt" +def get_pagetype_fields_meta(PageField, pagetype, allowed_fieldtypes, restricted_fields): + parent = "parent" if PageField._table_name == "tabPageField" else "dt" return ( - jingrow.qb.from_(DocField) + jingrow.qb.from_(PageField) .select( - DocField.fieldname, - DocField.fieldtype, - DocField.label, - DocField.name, - DocField.options, + PageField.fieldname, + PageField.fieldtype, + PageField.label, + PageField.name, + PageField.options, ) - .where(DocField[parent] == pagetype) - .where(DocField.hidden == False) # noqa: E712 - .where(Criterion.any([DocField.fieldtype == i for i in allowed_fieldtypes])) - .where(Criterion.all([DocField.fieldname != i for i in restricted_fields])) + .where(PageField[parent] == pagetype) + .where(PageField.hidden == False) # noqa: E712 + .where(Criterion.any([PageField.fieldtype == i for i in allowed_fieldtypes])) + .where(Criterion.all([PageField.fieldname != i for i in restricted_fields])) .run(as_dict=True) ) diff --git a/crm/install.py b/crm/install.py index 7765b360..f9b1d820 100644 --- a/crm/install.py +++ b/crm/install.py @@ -430,7 +430,7 @@ def add_assignment_rule_property_setters(): default_fields = { "pagetype": "Property Setter", - "pagetype_or_field": "DocField", + "pagetype_or_field": "PageField", "pg_type": "Assignment Rule", "property_type": "Data", "is_system_generated": 1,