From 7826897b355fbe2f010c3c4d35a6752f6dbbf5f4 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 9 Nov 2021 11:44:00 +0100 Subject: [PATCH] refactor(contextmenu): excludes now ensures negation --- front/core/components/contextmenu/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/front/core/components/contextmenu/index.js b/front/core/components/contextmenu/index.js index 76a25e701..9c1206865 100755 --- a/front/core/components/contextmenu/index.js +++ b/front/core/components/contextmenu/index.js @@ -172,9 +172,14 @@ export default class Contextmenu { excludeSelection() { let where = {[this.fieldName]: {neq: this.fieldValue}}; if (this.exprBuilder) { - where = buildFilter(where, (param, value) => - this.exprBuilder({param, value}) - ); + where = buildFilter(where, (param, value) => { + const expr = this.exprBuilder({param, value}); + const props = Object.keys(expr); + const newExpr = {}; + for (let prop of props) + newExpr[prop] = {neq: this.fieldValue}; + return newExpr; + }); } this.model.addFilter({where});