Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3640 Zobrazení

how to pass value to reference field from code?

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Autor Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvc 22
4594
3
pro 21
4362
3
čvc 23
5722
2
bře 24
5732
1
lis 22
5546