콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5947 화면

hi to all I want to create a new field type "selection". there is the same example in the stock module product is the category selection list,, how to do?? Thanks

아바타
취소

You need to give some more details on what you want to accomplish. Please put in the module and field you want to edit along with the version of openERP you are using.

베스트 답변

Hello Kizayko,

Syntax for creating selection field is

selection(values, string, ...)

values: list of values (key-label tuples) or function returning such a list

For creating dynamic values in the selection. You can add a function like :

fields.selection(_get_selection,'myselection')

then you can define this function as:

def _get_selection(self, cr, uid, context=None):

 """ Your logic to get the values """

return[(key1,value1),(key2,value2)]

Hope this helps !

Thanks, Naresh

아바타
취소