跳至内容
菜单
此问题已终结

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
4461
3
7月 24
1813
6
4月 22
42856
1
3月 24
30697
2
3月 15
19670