我正在尝试向学院课程添加讨论和通知但却出错了。 我的代码: models.py
class Courses(models.Model):
_name = 'academy.courses'
_inherit = 'mail.thread'
views.xml
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
openerp.py
'取决于':['网站'],
错误:
2016-04-01 22:05:02,467 11535 ERROR academy openerp.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/home/module_odoo/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/module_odoo/openerp/modules/loading.py", line 334, in load_modules
force, status, report, loaded_modules, update_module)
File "/home/module_odoo/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/home/module_odoo/openerp/modules/loading.py", line 132, in load_module_graph
models = registry.load(cr, package)
File "/home/module_odoo/openerp/modules/registry.py", line 169, in load
model = cls._build_model(self, cr)
File "/home/module_odoo/openerp/models.py", line 599, in _build_model
'You may need to add a dependency on the parent class\' module.' % (name, parent))
TypeError: The model "academy.courses" specifies an unexisting parent class "mail.thread"
You may need to add a dependency on the parent class' module.
2016-04-01 22:05:02,469 11535 CRITICAL academy openerp.service.server: Failed to initialize database `academy`.
Traceback (most recent call last):
File "/home/module_odoo/openerp/service/server.py", line 885, in preload_registries
registry = RegistryManager.new(dbname, update_module=update_module)
File "/home/module_odoo/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/module_odoo/openerp/modules/loading.py", line 334, in load_modules
force, status, report, loaded_modules, update_module)
File "/home/module_odoo/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/home/module_odoo/openerp/modules/loading.py", line 132, in load_module_graph
models = registry.load(cr, package)
File "/home/module_odoo/openerp/modules/registry.py", line 169, in load
model = cls._build_model(self, cr)
File "/home/module_odoo/openerp/models.py", line 599, in _build_model
'You may need to add a dependency on the parent class\' module.' % (name, parent))
TypeError: The model "academy.courses" specifies an unexisting parent class "mail.thread"
You may need to add a dependency on the parent class' module.
我尝试了什么:
openerp.py
'取决于':[''网站','邮件'],
然后:
models.py
课程(models.Model): _name ='academy.courses' _inherits = ['academy.courses','mail.thread']
但没有任何帮助:(
答案 0 :(得分:3)
感谢您的回答。我想我找到了解决方案。
对我而言,__openerp__.py
in帮助改变website
- &gt; base
。我不知道为什么但它有帮助。也许有人知道为什么?
depends': ['base', 'mail']