تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3768 أدوات العرض

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 :)

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 22
4746
3
ديسمبر 21
4560
3
يوليو 23
5881
2
مارس 24
5871
1
نوفمبر 22
5749