Fixed ambiguous column when field name exists in some join table (#4649)

This commit is contained in:
alejandro-tss
2021-03-24 15:16:14 +01:00
committed by GitHub
parent f2bc53ca84
commit fba39e0c3a

View File

@@ -169,7 +169,10 @@ export function applyFilter(
const pkField = `${collection}.${o2mRelation.one_primary}`;
dbQuery[logical].whereIn(pkField, (subQueryKnex) => {
subQueryKnex.select([o2mRelation.many_field]).from(o2mRelation.many_collection);
const field = o2mRelation.many_field
const collection = o2mRelation.many_collection
const column = `${collection}.${field}`
subQueryKnex.select({[field]: column}).from(collection);
applyQuery(
o2mRelation.many_collection,