diff --git a/modules/company/CHANGELOG b/modules/company/CHANGELOG index b9b0e58c6c..92fd7719c2 100644 --- a/modules/company/CHANGELOG +++ b/modules/company/CHANGELOG @@ -1,3 +1,4 @@ +* Add companies and employees to the user context Version 8.0.0 - 2026-04-20 -------------------------- diff --git a/modules/company/res.py b/modules/company/res.py index eacecef327..b0a94447d5 100644 --- a/modules/company/res.py +++ b/modules/company/res.py @@ -85,7 +85,9 @@ class User(metaclass=PoolMeta): def __setup__(cls): super().__setup__() cls._context_fields.insert(0, 'company') + cls._context_fields.insert(0, 'companies') cls._context_fields.insert(0, 'employee') + cls._context_fields.insert(0, 'employees') cls._context_fields.insert(0, 'company_filter') @classmethod @@ -148,15 +150,6 @@ class User(metaclass=PoolMeta): if len(employees) == 1: self.employee, = employees - @classmethod - def _get_preferences(cls, user, context_only=False): - res = super()._get_preferences(user, - context_only=context_only) - if not context_only: - res['companies'] = [c.id for c in user.companies] - res['employees'] = [e.id for e in user.employees] - return res - @classmethod def get_companies(cls): '''