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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
6014
Tampilan
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
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar
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.