2013-07-19 44 views
1

我正在創建一個openerp 7模塊,我一直在使用Python的eclipse IDE來運行代碼。我想給出創建動態字段的功能。我想調用一個表單,其中用戶提供該字段的詳細信息(名稱,數據類型,大小)以創建該新字段。我對創建動態字段沒有這樣的想法。 PLZ幫助我。如何在openerp 7模塊中創建動態字段?

的希望sugestion

+0

副本發佈http://stackoverflow.com/questions/6569828/how-to-create-a-dynamic-view-on-openerp/6731739#6731739 – OmaL

回答

1

可以使用fields_view_get功能的OSV用於創建動態字段。繼承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_invoice.py文件中找到一個示例

+0

我沒有得到你,我無法找到account_invoice.py文件中的這個func –