我想创建一个按钮在机会的客户关系管理在奥多11。我想打开一个窗口,里面有这个机会(模型)的所有信息邮件.message)在
我试着创建我的第一个插件。在
这是我的结构:
这是我的代码:
/odoo/addons/test/\u清单
{
'name': 'test',
'version': '2.0',
'category': 'Sales',
'sequence': 5,
'summary': 'test',
'description': "",
'website': 'https://test.net',
'depends': [
'crm'
],
'data': [
],
'demo': [
],
'css': [],
'installable': True,
'application': True,
'auto_install': False,
}
/odoo/addons/test/\uu init\uy.py
^{pr2}$/odoo/addons/test/models/\uu init\uy.py
from . import test
/odoo/addons/test/模型/测试.py在
from odoo import models, fields
class test_test(models.Model):
_inherit = 'crm.lead'
@api.multi
def test_test(self):
return {
'name': 'test_test',
'res_model': 'mail.message',
'view_type': 'list',
'view_mode': 'tree,list',
'type': 'ir.actions.act_window',
'target': 'inline'
}
在crm.lead.form.机会
<button name='%(test_test)d' string="test" type="action" />
我安装了我的应用程序,但按钮不起作用,它没有显示任何错误。我无法在UI中看到我的操作。在
要从视图中调用函数,您需要像下面这样定义对象类型按钮。在
它将调用模型
crm.lead
中的函数test_test
(确保按钮位于crm.lead
模型视图中)你需要像下面这样改变你的功能
^{pr2}$希望这有帮助!在
相关问题 更多 >
编程相关推荐