当前位置:网站首页>odoo manifest. Py file details
odoo manifest. Py file details
2022-07-16 09:08:00 【Jiang Zhenjian 15954039008】
manifest.py File is used to python Package declared as Odoo Module and specify module metadata .
It is named __manifest__.py And contains a single Python Dictionary file , Each key specifies the module metadata .
{
'name': "A Module",
'version': '1.0',
'depends': ['base'],
'author': "Author Name",
'category': 'Category',
'description': """
Description text
""",
# data files always loaded at installation
'data': [
'views/mymodule_view.xml',
],
# data files containing optionally loaded demonstration data
'demo': [
'demo/demo_data.xml',
],
}
Available fields include :
name( str, Required )
Readable name of the module
version( str)
Version of this module , Semantic version control rules should be followed
description( str)
Extended description of the module , stay reStructuredText
author( str)
Module author name
website( str)
Module author's website URL
license(str, The default value is LGPL-3:)
Distribution license of the module . Possible value :
GPL-2
GPL-2 or any later version
GPL-3
GPL-3 or any later version
AGPL-3
LGPL-3
Other OSI approved licence
OEEL-1(Odoo Enterprise license v1.0)
OPL-1(Odoo Exclusive license v1.0)
Other proprietary
category( str, The default value is : Uncategorized)
Odoo Category in , Rough business areas of the module .
Although it is recommended to use existing categories , But this field is free-form , And will immediately create unknown categories . You can use delimiters to create category hierarchies .
depends( list(str))
Must be loaded before Odoo modular , Because this module uses the functions they created , Or because it changes the resources they define .
When installing a module , All its dependencies are installed before it . Again , Load dependencies before loading modules .
explain :
modular base Always install on any Odoo In the example . But you still need to specify it as a dependency , To ensure that your module is updated base Get updated .
data( list(str))
List of data files that must always be installed or updated with the module . A list of paths from the module root
demo( list(str))
List of data files installed or updated only in demo mode
auto_install(bool or list(str), The default value is False:)
If True, If all dependencies are installed , Then the module will be installed automatically .
auto_install It is usually used for “ Link module ”, Realize the collaborative integration between two originally independent modules .
If it's a list , It must contain a subset of dependencies . After installing all dependencies in the subset , This module will be installed automatically .
external_dependencies( dict(key=list(str)))
contain python and / Or a dictionary of binary dependencies .
Such as :
'external_dependencies': {
'python': ['ldap'],
},
about python rely on python term , Keys must be defined for this dictionary , And should be assigned to import python Module list .
For binary dependencies bin term , Keys must be defined for this dictionary , And it should be assigned a binary executable name list .
If... Is not installed in the host python Module or on the host PATH Binary executable not found in environment variable , The module will not be installed .
application( bool, The default value is : False)
This module should be considered as a mature application ( True) Or is it just a technical module ( False), It provides some additional functions for existing application modules .
assets( dict)
Define how to load all static files in various asset packages . More details on how to describe bundles , Please refer to the assets page .
installable(bool Default True:)
Whether users should be able to learn from Web UI Install the module .
maintainer( str)
The person or entity responsible for the maintenance of this module , By default, the author is assumed to be the maintainer .
{
pre_init, post_init, uninstall}_hook( str)
For module installation / Unloaded hook , Their value should be a string , It refers to init.py.
pre_init_hook Take the cursor as its only parameter , This function is executed before the module is installed .
post_init_hook Take cursor and registry as its parameters , This function is executed immediately after the module is installed .
uninstall_hook Take cursor and registry as its parameters , This function is executed after the module is unloaded .
Only if the setting required by this module / Cleaning is very difficult or impossible api In progress , These hooks should be used .
active( bool)
Have been abandoned . Replace with auto_install.
边栏推荐
猜你喜欢

曹洁 Spark编程Scala版本课后习题答案

HCIP第四天实验

Vscode input! No prompt, unable to automatically complete the solution (latest)

Hcip static routing

HCIP第五天实验

孤儿进程、僵尸进程和进程退出(针对面试)

Judge whether two binary trees are isomorphic, and three implementation methods (recursion, queue, stack)
![[go] Ⅱ. Introduction à l'API reposante et au processus et à la structure du Code de l'API](/img/fd/8ae3d6a4c0d0c973ce81672c1c529c.png)
[go] Ⅱ. Introduction à l'API reposante et au processus et à la structure du Code de l'API

Shutter renderflex overflowed by pixels on the bottom keyboard pop-up warning exception

Hcip day 4 notes
随机推荐
dtcloud Qweb实战之看板视图
三种方法模拟实现库函数strlen,加深对strlen的理解
odoo的assets详述
模块
odoo owl解释
Hcip day 5 notes
先序和中序遍历序列确定一颗二叉树(还原二叉树)
odoo eval详解
032 SQL知识点小记
我打开 datastutio的权限,自动生成了一个sql任务,一直在执行,这是说明权限分配还没执行完
Qstring regular expression of QT
Is it safe to open an account for stock speculation through the online account manager?
[go] II. Introduction to restful API, API process and code structure
031 Log4j日志框架
C language register skills (struct and union)
基于STM32F405的硬件IIC+DMA操作分享
mac通过brew方式安装mysql5.7
常用邮箱访问协议
The difference between wait and waitpid
I opened the permission of datastutio and automatically generated an SQL task that has been executing, which indicates that the permission allocation has not been completed