Openerp 使用基本导入模块在线安装Odoo的自定义模块
我正在使用在线Odoo,并试图安装一个自定义模块,我已经建立。我安装了以允许在Odoo Online实例上安装自定义模块 然后,我创建了一个简单的模块,包括以下内容:Openerp 使用基本导入模块在线安装Odoo的自定义模块,openerp,Openerp,我正在使用在线Odoo,并试图安装一个自定义模块,我已经建立。我安装了以允许在Odoo Online实例上安装自定义模块 然后,我创建了一个简单的模块,包括以下内容: mymodule/ __init__.py __manifeset__.py product.py views/ product_product_tree.xml 以下是文件的内容: \uuuu init\uuuuu.py from . import product { 'n
mymodule/
__init__.py
__manifeset__.py
product.py
views/
product_product_tree.xml
以下是文件的内容:
\uuuu init\uuuuu.py
from . import product
{
'name': "My Module",
'version': '1.0',
'depends': ['stock', 'sale', 'contacts', 'purchase'],
'description': """
Add custom functionality.
""",
# data files always loaded at installation
'data': [
'views/product_product_tree.xml',
],
}
from odoo import models, fields, api
class ProductProduct(models.Model):
_inherit = 'product.product'
x_reserved_qty = fields.Float(string='Reserved', readonly=True)
\uuuu清单\uuuuu.py
from . import product
{
'name': "My Module",
'version': '1.0',
'depends': ['stock', 'sale', 'contacts', 'purchase'],
'description': """
Add custom functionality.
""",
# data files always loaded at installation
'data': [
'views/product_product_tree.xml',
],
}
from odoo import models, fields, api
class ProductProduct(models.Model):
_inherit = 'product.product'
x_reserved_qty = fields.Float(string='Reserved', readonly=True)
product.py
from . import product
{
'name': "My Module",
'version': '1.0',
'depends': ['stock', 'sale', 'contacts', 'purchase'],
'description': """
Add custom functionality.
""",
# data files always loaded at installation
'data': [
'views/product_product_tree.xml',
],
}
from odoo import models, fields, api
class ProductProduct(models.Model):
_inherit = 'product.product'
x_reserved_qty = fields.Float(string='Reserved', readonly=True)
视图/product\u product\u tree.xml
<odoo>
<data>
<record model="ir.ui.view" id="mymodule.product_product_tree">
<field name="name">x_product.product.tree</field>
<field name="model">product.product</field>
<field name="priority" eval="16"/>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<field name="x_reserved_qty"/>
</xpath>
</field>
</record>
</data>
</odoo>
x_product.product.tree
产品
然后我压缩文件并通过基本导入模块导入它。这样做会导致错误,并且模块不会安装。发生此错误是因为模型上不存在x\u reserved\u qty
字段,即使我已在product.py
中对其进行了定义。模块的python部分似乎从未执行过
我可以通过注释掉
行并重新导入模块来确认这一点。这一次它成功导入,但当我浏览到设置>技术>数据库结构>字段时
,我看不到我的新字段列在任何地方
有人知道通过这个基本导入模块方法导入的自定义模块是否支持python文件吗?模块说明中说:
此模块允许授权用户导入自定义数据模块
(.xml文件和静态资产)用于自定义
它特别提到了.xml和静态资产,但没有提到python文件。所以,我只是想知道我的python文件中是否有什么错误导致它无法工作,或者它实际上是为了不支持模块中的python文件而设计的。它不支持python文件(可能出于安全目的)。为了让odoo服务器编译python文件,必须重新启动它。当您使用runbot或Odoo托管您的实例时,您无法执行某些操作。是否有任何在线解决方案!!或者我们总是要为我们的客户购买服务器?并在本地网络中使用