diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 5203c44b644..8c9e5246aaf 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -12,7 +12,7 @@ OPERATORS = { '>': py_operator.gt, '<=': py_operator.le, '>=': py_operator.ge, - '==': py_operator.eq, + '=': py_operator.eq, '!=': py_operator.ne } @@ -240,9 +240,6 @@ class Product(models.Model): if not isinstance(value, (float, int)): raise UserError('Invalid domain right operand') - if operator == '=': - operator = '==' - # TODO: Still optimization possible when searching virtual quantities ids = [] for product in self.search([]): @@ -252,7 +249,7 @@ class Product(models.Model): def _search_qty_available(self, operator, value): # TDE FIXME: should probably clean the search methods - if value == 0.0 and operator in ('==', '>=', '<='): + if value == 0.0 and operator in ('=', '>=', '<='): return self._search_product_quantity(operator, value, 'qty_available') product_ids = self._search_qty_available_new(operator, value, self._context.get('lot_id'), self._context.get('owner_id'), self._context.get('package_id')) return [('id', 'in', product_ids)]