Skip to content

Commit

Permalink
shopfloor.app: comp registry check reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
simahawk committed Dec 8, 2021
1 parent 383bc67 commit f95c2b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions shopfloor_base/models/shopfloor_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,12 @@ def _prepare_endpoint_vals(self, service, method_name, route, routing_params):
def _route_group(self):
return f"{self._name}:{self.tech_name}"

def _get_services(self):
def _is_component_registry_ready(self):
comp_registry = _component_databases.get(self.env.cr.dbname)
if not comp_registry or comp_registry and not comp_registry.ready:
return comp_registry and comp_registry.ready

def _get_services(self):
if not self._is_component_registry_ready():
# No service is available before the registry has been loaded.
# This is a very special case, when the odoo registry is being
# built, it calls odoo.modules.loading.load_modules().
Expand Down

0 comments on commit f95c2b6

Please sign in to comment.