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

Hi,

I have a reference field in a model:


class Example(models.Model):
    _name='example'
    
    refers_to=fields.Reference(
[('res.users', 'User'), ('res.partner', 'Partner')],
string='User or Contact',
required=True)


And I try to use it in a view, to display the fields of the referenced model:


<record id='example_form_view' model="ir.ui.view">
    <field name="name">Example Form View</field>
    <field name="model">example</field>
    <field name="arch" type="xml">
        <form>
            <field name="refers_to" />
            <field name="refers_to.name" />
        </form>
    </field>
</record>


But, I have an error saying the field "refers_to.name" does not exist. I am wondering if their is a way to navigate through the reference field in a form view ?

Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 15
4460
3
يوليو 24
1801
6
أبريل 22
42841
1
مارس 24
30687
2
مارس 15
19655