Я пытаюсь создать различные варианты выбора в зависимости от другого поля в Модели. Я работаю в Odoo 8. Ниже приведен код:Изменить Выбор Поле odoo 8
Моя модель: (test.py)
type = fields.Selection(selection='_get_selection', string='Type')
@api.onchange('role_name')
def _get_selection(self):
choise = []
if self.role_name == 'primary':
choise.append(('unit','Unit Case'))
if self.role_name == 'reserve':
choise.append(('res','Reserve Case'))
return choise
The View: (template.xml)
<field name="type" widget="selection"/>
Но я дон В поле выбора не видите значения.
Пожалуйста, помогите.
Спасибо,
Привет, не работает. – user280960