Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3902 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
4463
Add current user in form field แก้ไขแล้ว
3
ก.ค. 24
1819
6
เม.ย. 22
42866
1
มี.ค. 24
30713
Default field value of a form view แก้ไขแล้ว
2
มี.ค. 15
19678