跳至內容
選單
此問題已被標幟
3884 瀏覽次數

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
3月 15
4460
3
7月 24
1806
6
4月 22
42841
1
3月 24
30688
2
3月 15
19661