Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在openerp 7模块中创建动态字段?_Python_Eclipse_Openerp - Fatal编程技术网

Python 如何在openerp 7模块中创建动态字段?

Python 如何在openerp 7模块中创建动态字段?,python,eclipse,openerp,Python,Eclipse,Openerp,我正在创建OpenERP7模块,我一直在使用eclipse IDE和Python来运行代码。我想给出创建动态字段的功能。我想调用一个表单,在该表单中,用户将提供字段的详细信息(名称、数据类型、大小)来创建新字段。我对动态场的创建没有这样的想法。请帮帮我 希望sugestion您可以使用osv中的fields\u view\u get函数来创建动态字段。继承fields\u view\u get()函数 def fields_view_get(self, cr, uid, view_id=None

我正在创建OpenERP7模块,我一直在使用eclipse IDE和Python来运行代码。我想给出创建动态字段的功能。我想调用一个表单,在该表单中,用户将提供字段的详细信息(名称、数据类型、大小)来创建新字段。我对动态场的创建没有这样的想法。请帮帮我


希望sugestion

您可以使用osv中的fields\u view\u get函数来创建动态字段。继承fields\u view\u get()函数

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False):
    result = super(<your_class_name>, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar)
    ###your modification in the view
    ###result['fields'] will give you the fields. modify it if needed
    ###result['arch'] will give you the xml architecture. modify it if needed
    return result
def fields\u view\u get(self,cr,uid,view\u id=None,view\u type='form',context={},toolbar=False):
结果=super(,self).fields\u view\u get(cr,uid,view\u id,view\u type,context=context,toolbar=toolbar)
###您在视图中的修改
###结果['fields']将为您提供字段。如果需要,请修改它
###结果['arch']将为您提供xml体系结构。如果需要,请修改它
返回结果

首先,检查您的产品得到了什么。然后在上面建立一个想法并继续。您可以在account模块account_invoice.py文件中找到一个示例,您可以使用osv中的fields_view_get函数创建动态字段。继承fields\u view\u get()函数

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False):
    result = super(<your_class_name>, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar)
    ###your modification in the view
    ###result['fields'] will give you the fields. modify it if needed
    ###result['arch'] will give you the xml architecture. modify it if needed
    return result
def fields\u view\u get(self,cr,uid,view\u id=None,view\u type='form',context={},toolbar=False):
结果=super(,self).fields\u view\u get(cr,uid,view\u id,view\u type,context=context,toolbar=toolbar)
###您在视图中的修改
###结果['fields']将为您提供字段。如果需要,请修改它
###结果['arch']将为您提供xml体系结构。如果需要,请修改它
返回结果

首先,检查您的产品得到了什么。然后在上面建立一个想法并继续。您可以在account模块中找到一个示例,account_invoice.py文件

post的副本post的副本我找不到您,我在account_invoice.py文件中找不到此函数我找不到您,我在account_invoice.py文件中找不到此函数