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
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 :
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 !
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 4/1/13, 1:19 PM|
|Seen: 1013 times|
|Last updated: 3/16/15, 8:10 AM|