Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
3546 Ansichten

how to pass value to reference field from code?

Avatar
Verwerfen
Beste Antwort

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
Verwerfen
Autor Beste Antwort

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

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juli 22
4515
3
Dez. 21
4270
3
Juli 23
5648
2
März 24
5661
1
Nov. 22
5457