public function aroundAddFilter(
        \Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFilterToCollection $subject,
        \Closure $proceed,
        \Magento\Catalog\Model\ResourceModel\Product\Collection $collection,
        $field,
        $condition = null
    ) {
        /* skip identical conditions () */
        $regKey = print_r($condition, true);
        if (!isset($this->_regCond[$regKey])) {
            $conn = $collection->getConnection();
            $select = $collection->getSelect();
            $equation = $this->_repoModifierProductGFrid->getEquationQty();
            $prepared = $conn->prepareSqlCondition($equation, $condition);
            $select->having($prepared);
            $this->_regCond[$regKey] = true;
        }
        return;
    }
public function aroundAddFilter(
        \Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFilterToCollection $subject,
        \Closure $proceed,
        \Magento\Catalog\Model\ResourceModel\Product\Collection $collection,
        $field,
        $condition = null
    ) {
        /* skip identical conditions () */
        $regKey = print_r($condition, true);
        if (!isset($this->_regCond[$regKey])) {
            $conn = $collection->getConnection();
            $select = $collection->getSelect();
            $equation = $this->_repoModifierProductGFrid->getEquationQty();
            $prepared = $conn->prepareSqlCondition($equation, $condition);
            $select->having($prepared);
            $this->_regCond[$regKey] = true;
        }
        return;
    }
public function aroundAddFilter ( \ Magento \ CatalogInventory \ Ui \ DataProvider \ Product \ AddQuantityFilterToCollection $ subject , \ Closure $ proceed , \ Magento \ Catalog \ Model \ ResourceModel \ Product \ Collection $ collection , $ field , $ condition = null ) { /* skip identical conditions () */ $ regKey = print_r ( $ condition , true ) ; if ( ! isset ( $ this -> _regCond [ $ regKey ] ) ) { $ conn = $ collection -> getConnection ( ) ; $ select = $ collection -> getSelect ( ) ; $ equation = $ this -> _repoModifierProductGFrid -> getEquationQty ( ) ; $ prepared = $ conn -> prepareSqlCondition ( $ equation , $ condition ) ; $ select -> having ( $ prepared ) ; $ this -> _regCond [ $ regKey ] = true ; } return ; }
Replace WHERE-filtering by HAVING-filtering.

@param \Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFilterToCollection $subject
@param \Closure $proceed
@param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection
@param $field
@param null $condition
Replace WHERE - filtering by HAVING - filtering .