Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
22693 Lượt xem

Hi,

I am developing a custom module. Everytime I change anything and restar the server I get this error:

 return self.app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1426, in dispatch
ir_http = request.registry['ir.http']
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 346, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 339, in get
update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 370, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 351, in load_modules
force, status, report, loaded_modules, update_module)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 255, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 152, in load_module_graph
models = registry.load(cr, package)
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 163, in load
model = cls._build_model(self, cr)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 595, in _build_model
original_module = pool[name]._original_module if name in parents else cls._module
File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 102, in __getitem__
return self.models[model_name]
KeyError: 'stock.picking'


I have to rename the module folder under /openerp/addons/custom, restart the server, uninstall the module and then I can reinstall it again.

Why is this happening? Is there any information in the error that could be used to debug this?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi! Looks like a dependency problem, did you add 'stock' into __openerp__.py depends? If this isnt the problem, you should post the file where you inherit stock.picking, and see if there is anything wrong on it. 


Ảnh đại diện
Huỷ bỏ
Tác giả

It was exactly the issue you pointed, I just added 'stock' as dependence into __openerp__.py and the issue is no longer there. Thanks Jose it was a really annoying issue.

Bài viết liên quan Trả lời Lượt xem Hoạt động
10
thg 5 20
8342
1
thg 3 18
4266
1
thg 1 16
6004
2
thg 3 15
5571
1
thg 3 15
10624