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
    • 3
    • 0
    • 0
    • 0
    • 6.44k
    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/", 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/", 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/", line 203, in get
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/", line 233, in new
        openerp.modules.load_modules(registry.db, force_demo, status, update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/", line 351, in load_modules
        force, status, report, loaded_modules, update_module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/", 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/", line 159, in load_module_graph
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/", 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/", line 628, in wsgi_postload
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/web/", line 517, in __init__
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/web/", line 580, in load_addons
        m = __import__('openerp.addons.' + module)
      File "/home/shiva/workspace1/openerp/OE7/openerp/modules/", 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/", line 1, in 
        import psms, controllers
      File "/home/shiva/workspace1/openerp/OE7/openerp/addons/partner_sms/", line 1, in 
        from openerp import models, fields, api
    ImportError: cannot import name models

 3 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

Sign up using

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: