From 6c940679c9bb23b98cd6e27dd2f488a041995fe2 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 23 May 2023 16:36:01 +0200 Subject: [PATCH] [REM] product: unused company fallback logic This method & logic is not used nor necessary anymore with the multi-company fixes and improvements done in the recent years. * All requests coming from website are automatically done in the website company. * check_company restrictions forbid the use of records from different companies * multi-company security rules restrict the access to records from the current company. Part-of: odoo/odoo#121986 --- addons/product/models/product_template.py | 28 ----------------------- 1 file changed, 28 deletions(-) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index 6b850ba296d..f3f57d86bbd 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -1322,34 +1322,6 @@ class ProductTemplate(models.Model): return _("There are no possible combination.") combination = combination[:-1] - def _get_current_company(self, **kwargs): - """Get the most appropriate company for this product. - - If the company is set on the product, directly return it. Otherwise, - fallback to a contextual company. - - :param kwargs: kwargs forwarded to the fallback method. - - :return: the most appropriate company for this product - :rtype: recordset of one `res.company` - """ - self.ensure_one() - return self.company_id or self._get_current_company_fallback(**kwargs) - - def _get_current_company_fallback(self, **kwargs): - """Fallback to get the most appropriate company for this product. - - This should only be called from `_get_current_company` but is defined - separately to allow override. - - The final fallback will be the current user's company. - - :return: the fallback company for this product - :rtype: recordset of one `res.company` - """ - self.ensure_one() - return self.env.company - def _get_placeholder_filename(self, field): image_fields = ['image_%s' % size for size in [1920, 1024, 512, 256, 128]] if field in image_fields: