Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
3614 Представления

how to pass value to reference field from code?

Аватар
Отменить
Лучший ответ

HI,

The field value is .

Reference field Basically stored as a :class:`string ` following the pattern "res_model,res_id" in the database. It Display as the selection . If you want to pass the value to the reference field, then you have to pass the formation value in the field where the first argument is the record model and second argument will be the id of that model.
Like:

    reference_record = '%s,%s' % (res_model, res_id)

    reference_field_record = '%s,%s' % ('ir.actions.act_window', 11)

Hope it will help you.
Thanks.

Аватар
Отменить
Автор Лучший ответ

thanks, i also know that _name return the model name :)

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
июл. 22
4576
3
дек. 21
4338
3
июл. 23
5704
2
мар. 24
5723
1
нояб. 22
5527