From ea0e38277dbc1c0b7dd9a4e16bb6a3f0ba412e81 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 13 Feb 2019 11:17:13 +0200 Subject: [PATCH] fix contact filter by account is inactive --- .../metadata/entityDefs/Contact.json | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json index 846f79e817..feaadebd2e 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json @@ -193,15 +193,25 @@ ] }, "where": { - "=": { - "leftJoins": ["accounts"], - "sql": "accountsMiddle.is_inactive = {value}", - "distinct": true + "= TRUE": { + "leftJoins": [ + [ + "AccountContact", + "accountContactFilterIsInactive", + {"contact.accountId:": "accountContactFilterIsInactive.accountId"} + ] + ], + "sql": "accountContactFilterIsInactive.is_inactive = true" }, - "<>": { - "leftJoins": ["accounts"], - "sql": "accountsMiddle.is_inactive <> {value}", - "distinct": true + "= FALSE": { + "leftJoins": [ + [ + "AccountContact", + "accountContactFilterIsInactive", + {"contact.accountId:": "accountContactFilterIsInactive.accountId"} + ] + ], + "sql": "accountContactFilterIsInactive.is_inactive <> true OR accountContactFilterIsInactive.is_inactive IS NULL" } }, "layoutListDisabled": true,