You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
654 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Therp BV <http://therp.nl>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. import socket
  5. import inspect
  6. def post_load_hook():
  7. """do some trickery to have demo data/model on runbot, but nowhere else"""
  8. if socket.getfqdn().endswith('odoo-community.org'): # pragma: nocover
  9. from . import demo # flake8: noqa
  10. for frame, filename, lineno, funcname, line, index in inspect.stack():
  11. if 'package' in frame.f_locals:
  12. frame.f_locals['package'].info['demo'] =\
  13. frame.f_locals['package'].info['demo_deactivated']
  14. break