Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to solve "cannot import name models error" ?

    • 0
    • 0
    • 0
    • 2
    • 0
    • 0
    • 0
    • 2.98k
    Answer it

    Hi Friends,
    Please help me with the error, When I am installing partner_sms module in openerp. It is giving me below mentioned error -

    Traceback (most recent call last):
      File "/home/shiva/workspace1/openerp/OE7/openerp/cli/server.py", line 97, in preload_registry
        db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/pooler.py", line 33, in get_db_and_pool
        registry = RegistryManager.get(db_name, force_demo, status, update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/registry.py", line 203, in get
        update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/registry.py", line 233, in new
        openerp.modules.load_modules(registry.db, force_demo, status, update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/loading.py", line 351, in load_modules
        force, status, report, loaded_modules, update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/loading.py", line 256, in load_marked_modules
        loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/loading.py", line 159, in load_module_graph
        load_openerp_module(package.name)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/module.py", line 415, in load_openerp_module
        getattr(sys.modules['openerp.addons.' + module_name], info['post_load'])()
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/web/http.py", line 628, in wsgi_postload
        openerp.wsgi.register_wsgi_handler(Root())
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/web/http.py", line 517, in __init__
        self.load_addons()
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/web/http.py", line 580, in load_addons
        m = __import__('openerp.addons.' + module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/module.py", line 133, in load_module
        mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/partner_sms/__init__.py", line 1, in 
        import psms, controllers
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/partner_sms/psms.py", line 1, in 
        from openerp import models, fields, api
    ImportError: cannot import name models
     

 2 Answer(s)

  • It seems that you are trying to install V8 module in V7. You don't have models in OpenERP7 , it is only in OpenERP8, to solve that you can import osv instead of model, from openerp.osv import osv, fields

    then change: models.Model = osv.osv Fields = fields Many2one = many2one Char = char One2many = one2many Many2many = many2many Float = float Integer = integer

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: