diff --git a/product_supplierinfo_for_customer/models/product_product.py b/product_supplierinfo_for_customer/models/product_product.py index fdcdd9edf1c..2bef3fd0e77 100644 --- a/product_supplierinfo_for_customer/models/product_product.py +++ b/product_supplierinfo_for_customer/models/product_product.py @@ -26,12 +26,12 @@ def _name_search(self, name, domain=None, operator="ilike", limit=None, order=No limit = (limit - res_ids_len) if limit else False if ( not name - and limit or not self._context.get("partner_id") - or res_ids_len >= limit + or (limit and res_ids_len >= limit) ): return res_ids - limit -= res_ids_len + if limit: + limit -= res_ids_len customerinfo_ids = self.env["product.customerinfo"]._search( [ ("partner_id", "=", self._context.get("partner_id")),