Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Resource

Entity: res.company

Compute Method: _compute_tz

View 20.0
Inputs Method Outputs
  • country_id
  • country_id.code
+ country_tz = _country_timezones()
+ for company in self:
+             company.tz = self.env.context.get('tz') or self.env.user.tz or 'UTC'
+             if company.country_id:
+                 country_timezones = country_tz.get(company.country_id.code, [])
+                 if len(country_timezones) == 1:
+                     company.tz = country_timezones[0]
  • tz

Back to entity