def initialize_sys_path():
 global ad_paths
 global hooked
 dd = tools.config.addons_data_dir
 if (dd not in ad_paths):
  ad_paths.append(dd)
 for ad in tools.config['addons_path'].split(','):
  ad = os.path.abspath(tools.ustr(ad.strip()))
  if (ad not in ad_paths):
   ad_paths.append(ad)
 base_path = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'addons'))
 if (base_path not in ad_paths):
  ad_paths.append(base_path)
 for ad in __import__('odoo.addons').addons.__path__:
  ad = os.path.abspath(ad)
  if (ad not in ad_paths):
   ad_paths.append(ad)
 if (not hooked):
  sys.meta_path.append(AddonsHook())
  sys.meta_path.append(OdooHook())
  hooked = True

def initialize_sys_path ( ) : global ad_paths global hooked dd = tools . config . addons_data_dir if ( dd not in ad_paths ) : ad_paths . append ( dd ) for ad in tools . config [ 'addons_path' ] . split ( ',' ) : ad = os . path . abspath ( tools . ustr ( ad . strip ( ) ) ) if ( ad not in ad_paths ) : ad_paths . append ( ad ) base_path = os . path . abspath ( os . path . join ( os . path . dirname ( os . path . dirname ( __file__ ) ) , 'addons' ) ) if ( base_path not in ad_paths ) : ad_paths . append ( base_path ) for ad in __import__ ( 'odoo.addons' ) . addons . __path__ : ad = os . path . abspath ( ad ) if ( ad not in ad_paths ) : ad_paths . append ( ad ) if ( not hooked ) : sys . meta_path . append ( AddonsHook ( ) ) sys . meta_path . append ( OdooHook ( ) ) hooked = True
setup an import-hook to be able to import openerp addons from the different addons paths .