c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #36112
[Bug 800789] Re: [TRUNK] The class external_osv has to have a _name attribute
I'm on windows 7 and I'm using version 6 of OpenERP. So when I install the module megentoerpconnector
I got the following error:
File "C:\AX_OV\OPT_HOME\OPENERP\SERVER\addons\magentoerpconnect\product.py", line 72, in <module>
File "C:\AX_OV\OPT_HOME\OPENERP\SERVER\addons\magentoerpconnect\product.py", line 103, in product_category
AttributeError: 'module' object has no attribute 'sparse'
I understand that this is a missing library in python but I do not know
how to do that
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/800789
Title:
[TRUNK] The class external_osv has to have a _name attribute
Status in Magento OpenERP Connector:
Fix Released
Bug description:
Using server, web client, addons, extra-addons and magentoerpconnect
from trunk, I get this error message when installing the
magentoerpconnect module:
<class 'openerp.osv.orm.except_orm'>
Python 2.7.1+: /usr/bin/python
Wed Jun 22 12:33:21 2011
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
/home/max/openerp/server/trunk/openerp/netsvc.py in dispatch(self=<TinySocketClientThread(netrpc-client-127.0.0.1:37077, started -1268638864)>, service_name='object', method='execute', params=('Magento', 1, 'admin', 'base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False}))
435 self.log('service', tuple(replace_request_password(params)), depth=(None if logger.isEnabledFor(logging.DEBUG_RPC_ANSWER) else 1), fn='%s.%s'%(service_name,method))
436 auth = getattr(self, 'auth_provider', None)
437 result = ExportService.getService(service_name).dispatch(method, auth, params)
438 self.log('result', result, channel=logging.DEBUG_RPC_ANSWER)
439 return result
result undefined
global ExportService = <class 'openerp.netsvc.ExportService'>
ExportService.getService = <bound method type.getService of <class 'openerp.netsvc.ExportService'>>
service_name = 'object'
).dispatch undefined
method = 'execute'
auth = None
params = ('Magento', 1, 'admin', 'base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False})
/home/max/openerp/server/trunk/openerp/service/web_services.py in dispatch(self=<openerp.service.web_services.objects_proxy object>, method='execute', auth=None, params=('base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False}))
577 ls = netsvc.LocalService('object_proxy')
578 fn = getattr(ls, method)
579 res = fn(db, uid, *params)
580 return res
581
res undefined
fn = <bound method object_proxy.execute of <openerp.osv.osv.object_proxy object>>
db = 'Magento'
uid = 1
params = ('base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False})
/home/max/openerp/server/trunk/openerp/osv/osv.py in wrapper(self=<openerp.osv.osv.object_proxy object>, dbname='Magento', *args=(1, 'base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False}), **kwargs={})
122 if inst.name == 'AccessError':
123 self.logger.debug("AccessError", exc_info=True)
124 self.abortResponse(1, inst.name, 'warning', inst.value)
125 except except_osv, inst:
126 self.abortResponse(1, inst.name, inst.exc_type, inst.value)
self = <openerp.osv.osv.object_proxy object>
self.abortResponse = <bound method object_proxy.abortResponse of <openerp.osv.osv.object_proxy object>>
inst = except_orm('ValueError', 'The class external_osv has to have a _name attribute')
inst.name = 'ValueError'
inst.value = 'The class external_osv has to have a _name attribute'
/home/max/openerp/server/trunk/openerp/osv/osv.py in wrapper(self=<openerp.osv.osv.object_proxy object>, dbname='Magento', *args=(1, 'base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False}), **kwargs={})
118 if pooler.get_pool(dbname)._init:
119 raise except_osv('Database not ready', 'Currently, this database is not fully loaded and can not be used.')
120 return f(self, dbname, *args, **kwargs)
121 except orm.except_orm, inst:
122 if inst.name == 'AccessError':
f = <function execute>
self = <openerp.osv.osv.object_proxy object>
dbname = 'Magento'
args = (1, 'base.module.upgrade', 'upgrade_module', [1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False})
kwargs = {}
/home/max/openerp/server/trunk/openerp/osv/osv.py in execute(self=<openerp.osv.osv.object_proxy object>, db='Magento', uid=1, obj='base.module.upgrade', method='upgrade_module', *args=([1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False}), **kw={})
172 if method.startswith('_'):
173 raise except_osv('Access Denied', 'Private methods (such as %s) cannot be called remotely.' % (method,))
174 res = self.execute_cr(cr, uid, obj, method, *args, **kw)
175 if res is None:
176 self.logger.warning('The method %s of the object %s can not return `None` !', method, obj)
res undefined
self = <openerp.osv.osv.object_proxy object>
self.execute_cr = <bound method object_proxy.execute_cr of <openerp.osv.osv.object_proxy object>>
cr = <openerp.sql_db.Cursor object>
uid = 1
obj = 'base.module.upgrade'
method = 'upgrade_module'
args = ([1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False})
kw = {}
/home/max/openerp/server/trunk/openerp/osv/osv.py in execute_cr(self=<openerp.osv.osv.object_proxy object>, cr=<openerp.sql_db.Cursor object>, uid=1, obj='base.module.upgrade', method='upgrade_module', *args=([1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False}), **kw={})
163 if not object:
164 raise except_osv('Object Error', 'Object %s doesn\'t exist' % str(obj))
165 return getattr(object, method)(cr, uid, *args, **kw)
166
167 @check
builtingetattr = <built-in function getattr>
object = <base.module.wizard.base_module_upgrade.base_module_upgrade object>
method = 'upgrade_module'
cr = <openerp.sql_db.Cursor object>
uid = 1
args = ([1], {'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False})
kw = {}
/home/max/openerp/server/trunk/openerp/addons/base/module/wizard/base_module_upgrade.py in upgrade_module(self=<base.module.wizard.base_module_upgrade.base_module_upgrade object>, cr=<openerp.sql_db.Cursor object>, uid=1, ids=[457, 619, 300, 616, 514, 618, 299], context={'_terp_view_name': u'Apply Scheduled Upgrades', 'active_id': 616, 'active_ids': [616], 'active_model': 'ir.module.module', 'client': 'web', 'lang': u'fr_FR', 'tz': False})
96 mod_obj.download(cr, uid, ids, context=context)
97 cr.commit()
98 _db, pool = pooler.restart_pool(cr.dbname, update_module=True)
99
100 data_obj = pool.get('ir.model.data')
_db undefined
pool undefined
global pooler = <module 'openerp.pooler' from '/home/max/openerp/server/trunk/openerp/pooler.pyc'>
pooler.restart_pool = <function restart_pool>
cr = <openerp.sql_db.Cursor object>
cr.dbname = 'Magento'
update_module undefined
builtinTrue = True
/home/max/openerp/server/trunk/openerp/pooler.py in restart_pool(db_name='Magento', force_demo=False, status=None, update_module=True)
42 def restart_pool(db_name, force_demo=False, status=None, update_module=False):
43 """Delete an existing registry and return a database connection and a newly initialized registry."""
44 registry = RegistryManager.new(db_name, force_demo, status, update_module, True)
45 return registry.db, registry
46
registry undefined
global RegistryManager = <class 'openerp.modules.registry.RegistryManager'>
RegistryManager.new = <bound method type.new of <class 'openerp.modules.registry.RegistryManager'>>
db_name = 'Magento'
force_demo = False
status = None
update_module = True
builtinTrue = True
/home/max/openerp/server/trunk/openerp/modules/registry.py in new(cls=<class 'openerp.modules.registry.RegistryManager'>, db_name='Magento', force_demo=False, status=None, update_module=True, pooljobs=True)
130 try:
131 # This should be a method on Registry
132 openerp.modules.load_modules(registry.db, force_demo, status, update_module)
133 except Exception:
134 del cls.registries[db_name]
openerp = <module 'openerp' from '/home/max/openerp/server/trunk/openerp/__init__.pyc'>
openerp.modules = <module 'openerp.modules' from '/home/max/openerp/server/trunk/openerp/modules/__init__.pyc'>
openerp.modules.load_modules = <function load_modules>
registry = <openerp.modules.registry.Registry object>
registry.db = <openerp.sql_db.Connection object>
force_demo = False
status = None
update_module = True
/home/max/openerp/server/trunk/openerp/modules/loading.py in load_modules(db=<openerp.sql_db.Connection object>, force_demo=False, status=None, update_module=True)
335
336 logger.notifyChannel('init', netsvc.LOG_DEBUG, 'Updating graph with %d more modules' % (len(module_list)))
337 processed_modules.extend(load_module_graph(cr, graph, status, report=report, skip_modules=processed_modules))
338
339 # load custom models
processed_modules = []
processed_modules.extend = <built-in method extend of list object>
global load_module_graph = <function load_module_graph>
cr = <openerp.sql_db.Cursor object>
graph = {u'base_json_fields': <openerp.modules.graph.Nod...<openerp.modules.graph.Node object at 0xb84e1ec>}
status = None
report = <openerp.tools.convert.assertion_report object>
skip_modules undefined
/home/max/openerp/server/trunk/openerp/modules/loading.py in load_module_graph(cr=<openerp.sql_db.Cursor object>, graph={u'base_json_fields': <openerp.modules.graph.Nod...<openerp.modules.graph.Node object at 0xb84e1ec>}, status={}, perform_checks=True, skip_modules=[], report=<openerp.tools.convert.assertion_report object>)
165 migrations.migrate_module(package, 'pre')
166 register_module_classes(package.name)
167 models = pool.instanciate(package.name, cr)
168 if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'):
169 init_module_models(cr, package.name, models)
models = [<board.board.board_board object>, <board.board.board_line object>, <board.board.board_note_type object>, <board.board.board_note object>, <board.board.res_log_report object>, <board.wizard.board_menu_create.board_menu_create object>]
pool = <openerp.modules.registry.Registry object>
pool.instanciate = <bound method Registry.instanciate of <openerp.modules.registry.Registry object>>
package = <openerp.modules.graph.Node object>
package.name = u'base_external_referentials'
cr = <openerp.sql_db.Cursor object>
/home/max/openerp/server/trunk/openerp/modules/registry.py in instanciate(self=<openerp.modules.registry.Registry object>, module=u'base_external_referentials', cr=<openerp.sql_db.Cursor object>)
79 for cls in openerp.osv.orm.MetaModel.module_to_models.get(module, []):
80 if cls not in openerp.osv.orm.module_class_list.get(module, []):
81 res.append(cls.createInstance(self, cr))
82
83 return res
res = [<base_external_referentials.base_external_referentials.external_referential_type object>, <base_external_referentials.base_external_referentials.external_mapping_template object>, <base_external_referentials.base_external_referentials.external_mappinglines_template object>, <base_external_referentials.base_external_referentials.external_referential object>, <base_external_referentials.base_external_referentials.external_mapping_line object>, <base_external_referentials.base_external_referentials.external_mapping object>, <openerp.osv.orm.external.mapping.line object>, <openerp.osv.orm.ir.model.data object>]
res.append = <built-in method append of list object>
cls = <class 'base_external_referentials.external_osv.external_osv'>
cls.createInstance = <bound method MetaModel.createInstance of <class...xternal_referentials.external_osv.external_osv'>>
self = <openerp.modules.registry.Registry object>
cr = <openerp.sql_db.Cursor object>
/home/max/openerp/server/trunk/openerp/osv/orm.py in createInstance(cls=<class 'base_external_referentials.external_osv.external_osv'>, pool=<openerp.modules.registry.Registry object>, cr=<openerp.sql_db.Cursor object>)
3019 def createInstance(cls, pool, cr):
3020 return cls.makeInstance(pool, cr, ['_columns', '_defaults',
3021 '_inherits', '_constraints', '_sql_constraints'])
3022
3023 def __init__(self, pool, cr):
/home/max/openerp/server/trunk/openerp/osv/orm.py in makeInstance(cls=<class 'base_external_referentials.external_osv.external_osv'>, pool=<openerp.modules.registry.Registry object>, cr=<openerp.sql_db.Cursor object>, attributes=['_columns', '_defaults', '_inherits', '_constraints', '_sql_constraints'])
677 cls = type(name, (cls, parent_class), dict(nattr, _register=False))
678 obj = object.__new__(cls)
679 obj.__init__(pool, cr)
680 return obj
681
obj = <base_external_referentials.external_osv.external_osv object>
obj.__init__ = <bound method external_osv.__init__ of <base_ext...l_referentials.external_osv.external_osv object>>
pool = <openerp.modules.registry.Registry object>
cr = <openerp.sql_db.Cursor object>
/home/max/openerp/server/trunk/openerp/osv/orm.py in __init__(self=<base_external_referentials.external_osv.external_osv object>, pool=<openerp.modules.registry.Registry object>, cr=<openerp.sql_db.Cursor object>)
3031
3032 """
3033 super(orm, self).__init__(pool, cr)
3034
3035 if not hasattr(self, '_log_access'):
builtinsuper = <type 'super'>
global orm = <class 'openerp.osv.orm.orm'>
self = <base_external_referentials.external_osv.external_osv object>
).__init__ = <bound method external_osv.__init__ of <base_ext...l_referentials.external_osv.external_osv object>>
pool = <openerp.modules.registry.Registry object>
cr = <openerp.sql_db.Cursor object>
/home/max/openerp/server/trunk/openerp/osv/orm.py in __init__(self=<base_external_referentials.external_osv.external_osv object>, pool=<openerp.modules.registry.Registry object>, cr=<openerp.sql_db.Cursor object>)
714 logger = netsvc.Logger()
715 logger.notifyChannel('orm', netsvc.LOG_ERROR, msg)
716 raise except_orm('ValueError', msg)
717
718 if not self._description:
global except_orm = <class 'openerp.osv.orm.except_orm'>
msg = 'The class external_osv has to have a _name attribute'
<class 'openerp.osv.orm.except_orm'>: ('ValueError', 'The class external_osv has to have a _name attribute')
__class__ = <class 'openerp.osv.orm.except_orm'>
__delattr__ = <method-wrapper '__delattr__' of except_orm object>
__dict__ = {'name': 'ValueError', 'value': 'The class external_osv has to have a _name attribute'}
__doc__ = None
__format__ = <built-in method __format__ of except_orm object>
__getattribute__ = <method-wrapper '__getattribute__' of except_orm object>
__getitem__ = <method-wrapper '__getitem__' of except_orm object>
__getslice__ = <method-wrapper '__getslice__' of except_orm object>
__hash__ = <method-wrapper '__hash__' of except_orm object>
__init__ = <bound method except_orm.__init__ of except_orm(...ass external_osv has to have a _name attribute')>
__module__ = 'openerp.osv.orm'
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of except_orm object>
__reduce_ex__ = <built-in method __reduce_ex__ of except_orm object>
__repr__ = <method-wrapper '__repr__' of except_orm object>
__setattr__ = <method-wrapper '__setattr__' of except_orm object>
__setstate__ = <built-in method __setstate__ of except_orm object>
__sizeof__ = <built-in method __sizeof__ of except_orm object>
__str__ = <method-wrapper '__str__' of except_orm object>
__subclasshook__ = <built-in method __subclasshook__ of type object>
__unicode__ = <built-in method __unicode__ of except_orm object>
__weakref__ = None
args = ('ValueError', 'The class external_osv has to have a _name attribute')
message = ''
name = 'ValueError'
value = 'The class external_osv has to have a _name attribute'
The above is a description of an error in a Python program. Here is
the original traceback:
Traceback (most recent call last):
File "/home/max/openerp/server/trunk/openerp/netsvc.py", line 437, in dispatch
result = ExportService.getService(service_name).dispatch(method, auth, params)
File "/home/max/openerp/server/trunk/openerp/service/web_services.py", line 579, in dispatch
res = fn(db, uid, *params)
File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 124, in wrapper
self.abortResponse(1, inst.name, 'warning', inst.value)
File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 120, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 174, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 165, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/max/openerp/server/trunk/openerp/addons/base/module/wizard/base_module_upgrade.py", line 98, in upgrade_module
_db, pool = pooler.restart_pool(cr.dbname, update_module=True)
File "/home/max/openerp/server/trunk/openerp/pooler.py", line 44, in restart_pool
registry = RegistryManager.new(db_name, force_demo, status, update_module, True)
File "/home/max/openerp/server/trunk/openerp/modules/registry.py", line 132, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/home/max/openerp/server/trunk/openerp/modules/loading.py", line 337, in load_modules
processed_modules.extend(load_module_graph(cr, graph, status, report=report, skip_modules=processed_modules))
File "/home/max/openerp/server/trunk/openerp/modules/loading.py", line 167, in load_module_graph
models = pool.instanciate(package.name, cr)
File "/home/max/openerp/server/trunk/openerp/modules/registry.py", line 81, in instanciate
res.append(cls.createInstance(self, cr))
File "/home/max/openerp/server/trunk/openerp/osv/orm.py", line 3021, in createInstance
'_inherits', '_constraints', '_sql_constraints'])
File "/home/max/openerp/server/trunk/openerp/osv/orm.py", line 679, in makeInstance
obj.__init__(pool, cr)
File "/home/max/openerp/server/trunk/openerp/osv/orm.py", line 3033, in __init__
super(orm, self).__init__(pool, cr)
File "/home/max/openerp/server/trunk/openerp/osv/orm.py", line 716, in __init__
raise except_orm('ValueError', msg)
except_orm: ('ValueError', 'The class external_osv has to have a _name attribute')
To manage notifications about this bug go to:
https://bugs.launchpad.net/magentoerpconnect/+bug/800789/+subscriptions
References