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

Module: Employees

Entity: hr.version

Compute Method: _compute_allowed_country_state_ids

View 20.0
Inputs Method Outputs
  • private_country_id
  • private_country_id.state_ids
+ versions_with_countries = self.filtered("private_country_id")
+ for version in versions_with_countries:
+             version.allowed_country_state_ids = version.private_country_id.state_ids
+ if versions_without_countries := (self - versions_with_countries):
+             states = self.env["res.country.state"].search([])
+             for version in versions_without_countries:
+                 version.allowed_country_state_ids = states
  • allowed_country_state_ids

Back to entity