在Odoo中创建新模块-安装后无法在应用程序列表中看到该模块
我安装并安装了Odoo。安装之后,我搭建了一个测试模块。在该模块中,我添加了一些代码,该模块出现在我的模块列表下。但是,安装后,我在我的应用程序列表中看不到该模块。下面是我的代码: 按钮\u操作\u demo.py views.xml security.py在Odoo中创建新模块-安装后无法在应用程序列表中看到该模块,odoo,odoo-13,Odoo,Odoo 13,我安装并安装了Odoo。安装之后,我搭建了一个测试模块。在该模块中,我添加了一些代码,该模块出现在我的模块列表下。但是,安装后,我在我的应用程序列表中看不到该模块。下面是我的代码: 按钮\u操作\u demo.py views.xml security.py 有人能告诉我我的代码遗漏了什么吗。如果需要的话,我非常乐意分享更多的代码,但我想我已经提供了大部分代码,添加安全性或打开调试语气,然后单击odoo 13中的“成为超级用户”admin不是超级用户,但您可以通过执行上述操作使他成为超级用户。添
有人能告诉我我的代码遗漏了什么吗。如果需要的话,我非常乐意分享更多的代码,但我想我已经提供了大部分代码,添加安全性或打开调试语气,然后单击odoo 13中的“成为超级用户”admin不是超级用户,但您可以通过执行上述操作使他成为超级用户。添加安全性或打开调试语气,然后单击odoo 13 admin中的“成为超级用户”admin不是超级用户,而是超级用户若模块在应用程序列表中不可见,您可以通过执行上述操作来创建该模块,然后检查以下几项
- 重新启动服务器李>
- 更新应用程序列表李>
- 将模块放置在右侧加载项路径中
如果您的安全文件工作不正常,或者您的清单文件有问题,所有这些事情都会在安装期间或安装后发生。如果模块在应用程序列表中不可见,请检查以下几项
- 重新启动服务器李>
- 更新应用程序列表李>
- 将模块放置在右侧加载项路径中
如果您的安全文件工作不正常,或者清单文件有问题,所有这些事情都会在安装过程中或安装后发生。您是否在模块中添加了安全文件?如果模块未在应用程序列表中查看,则它不在正确的目录中。它应该在.conf文件中提到的目录中。您是否在模块中添加了安全文件?如果模块未在应用程序列表中查看,则它不在正确的目录中。它应该在.conf文件中提到的目录中。我试图查看我的安全文件是否有任何问题,但我没有看到成为超级用户后会发生什么@Muhammad您将能够在应用程序列表中看到它,就像在odoo 11中一样。您可以在odoo 13中以管理员的身份看到应用程序列表中的所有模块。如果您想让普通管理员看到这些模块,或者现在成为超级用户,其行为将与ODOO11中的管理员相同,但自定义模块在所有模式下都可见,即非调试模式或调试模式。否不在odoo 13中自定义模型需要有访问权限成为超级用户,然后查看您是否有该模块的访问权限如果仍然没有访问权限请确保它是清单文件中的一个应用程序我已尝试查看我的安全文件是否有任何问题,但我没有看到成为超级用户后会发生什么@Muhammad您将能够在应用程序列表中看到它,就像在odoo 11中一样。您可以在odoo 13中以管理员的身份看到应用程序列表中的所有模块。如果您想让普通管理员看到这些模块,或者现在成为超级用户,其行为将与ODOO11中的管理员相同,但自定义模块在所有模式下都可见,即非调试模式或调试模式。否不在odoo 13中自定义模型需要有访问权限,只需成为超级用户,然后查看您是否有该模块的访问权限,如果仍然没有访问权限,请确保它是清单文件中的应用程序
from odoo import models, fields, api
#Non-odoo library
import random
from random import randint
import string
class button_action_demo(models.Model):
_name = 'button.demo'
name = fields.Char(required=True,default='Click on generate name!')
password = fields.Char()
def generate_record_name(self):
self.ensure_one()
#Generates a random name between 9 and 15 characters long and writes it to the record.
self.write({'name': ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(randint(9,15)))})
def generate_record_password(self):
self.ensure_one()
#Generates a random password between 12 and 15 characters long and writes it to the record.
self.write({
'password': ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(randint(12,15)))
})
def clear_record_data(self):
self.ensure_one()
self.write({
'name': '',
'password': ''
})
<record model="ir.ui.view" id="view_buttons_form">
<field name="name">Buttons</field>
<field name="model">button.demo</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Button record">
<!--The header tag is built to add buttons within. This puts them at the top -->
<header>
<!--The oe_highlight class gives the button a red color when it is saved.
It is usually used to indicate the expected behaviour. -->
<button string="Generate name" type="object" name="generate_record_name" class="oe_highlight"/>
<button string="Generate password" type="object" name="generate_record_password"/>
<button string="Clear data" type="object" name="clear_record_data"/>
</header>
<group>
<field name="name"/>
<field name="password"/>
</group>
</form>
</field>
</record>
<!--The action -->
<record model="ir.actions.act_window" id="buttons_example_action">
<field name="name">Create new record</field>
<field name="res_model">button.demo</field>
<field name="view_mode">form,tree</field>
<field name='view_id' ref='view_buttons_form'/>
</record>
<!-- top level menu: no parent -->
<menuitem id="main_button_menu" name="Buttons demo"/>
<menuitem id="button_menu" name="Buttons demo"
parent="main_button_menu"/>
<menuitem id="menu_detail_logging"
action="buttons_example_action" parent="button_menu"
sequence="20"/>
</data>
</odoo>
{
'name': "button_action_demo",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long description of module's purpose
""",
'author': "My Company",
'website': "http://www.yourcompany.com",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/data/ir_module_category_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/views.xml',
'views/templates.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
}
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_button_action_demo_button_action_demo,button_action_demo.button_action_demo,model_button_action_demo_button_action_demo,base.group_user,1,1,1,1