我正在创建一个openerp 7模块,我一直在使用eclipse IDE和Python来运行代码。我想给出创建动态字段的功能。我对动态字段的创建没有这样的想法。请帮帮我。
对建议的希望
发布于 2013-07-19 14:32:19
您可以在osv中使用fields_view_get函数来创建动态字段。继承fields_view_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首先,检查您的应用程序。然后在它的基础上建立一个想法并继续进行。您可以在account模块、account_invoice.py文件中找到一个示例
https://stackoverflow.com/questions/17738566
复制相似问题