gpt4 book ai didi

openerp - Odoo _inherit = 'mail.thread' 错误

转载 作者:行者123 更新时间:2023-12-01 12:29:01 24 4
gpt4 key购买 nike

我正在尝试向学院类(class)添加讨论和通知,但出现错误。我的代码:模型.py

class Courses(models.Model):
_name = 'academy.courses'
_inherit = 'mail.thread'

View .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.

我尝试了什么:

  1. openerp.py

    '取决于': ['网站', '邮件'],

  2. 然后:

    模型.py

    类(class)(模型.模型):_name = '学院.类(class)'_inherits = ['academy.courses', 'mail.thread']

但没有任何帮助:(

最佳答案

感谢您的回答。我想我找到了解决方案。

对我来说,__openerp__.py 中的帮助取决于更改 website -> base。我不知道为什么,但它有帮助。也许有人知道为什么?

depends': ['base', 'mail']

关于openerp - Odoo _inherit = 'mail.thread' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36366653/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com