From d48492800cb1c8ca008ac02881fbcec08c2c72e2 Mon Sep 17 00:00:00 2001 From: Marina Alapont Date: Thu, 12 Dec 2024 11:29:56 +0100 Subject: [PATCH] [IMP] product_category_company: allow the company to be false in search domain This PR modifies the search method so that categories without company set are also returned. This is needed because without this change, product categories without company were not appearing in the product category list neither by searching. --- product_category_company/models/product_category.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_category_company/models/product_category.py b/product_category_company/models/product_category.py index e89d417f2b5..31c42755bc8 100644 --- a/product_category_company/models/product_category.py +++ b/product_category_company/models/product_category.py @@ -20,5 +20,5 @@ class ProductCategory(models.Model): @api.model def _search(self, domain, *args, **kwargs): if "company_id" not in (item[0] for item in domain): - domain += [("company_id", "in", self.env.user.company_ids.ids)] + domain += [("company_id", "in", [False] + self.env.user.company_ids.ids)] return super()._search(domain, *args, **kwargs)