Fix wrong relationship select

This commit is contained in:
Adria Navarro 2024-12-16 12:53:40 +01:00
parent e6a27ad4d5
commit 2d771c96dd
1 changed files with 8 additions and 1 deletions

View File

@ -206,7 +206,14 @@ export async function buildSqlFieldList(
if (isView) {
Object.entries(source.schema?.[field.name]?.columns || {})
.filter(([_, column]) => helpers.views.isVisible(column))
.filter(
([columnName, columnConfig]) =>
relatedTable.schema[columnName] &&
helpers.views.isVisible(columnConfig) &&
![FieldType.LINK, FieldType.FORMULA].includes(
relatedTable.schema[columnName].type
)
)
.forEach(([field]) => viewFields.add(field))
}