如何在视图中使用关系字段访问其他模型中的字段(odoo) [英] How to acess fields in other model using relational field in view (odoo)

查看:342
本文介绍了如何在视图中使用关系字段访问其他模型中的字段(odoo)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Odoo中关系领域的问题.

I've a question concerning relational field in Odoo.

我有一个与模型B相关的关联字段X进入模型A(一个Many2Many字段),我为模型A创建了一个视图(viewA.xml),我想访问位于的字段(例如Y)使用我的关系字段(X)进入modelB.如何在xml视图中做到这一点.我尝试使用点表示法(X.Y),但在xml视图中不起作用.

i have a relational field X into modelA (a Many2Many field) related with the modelB, i create a view (viewA.xml) for the ModelA, and i'd like to get acess to field (Y for example) located into modelB using my relational field (X). How to do that in xml view. i've tried to use the dot notation (X.Y), but it doesn't work in xml view.

提前谢谢.

推荐答案

您只能通过使用视图内X的列表来访问Y:

You can access Y only by using the list for X inside the view:

<field name="X">
    <tree>
        <field name="Y">
    </tree>
</field>

这篇关于如何在视图中使用关系字段访问其他模型中的字段(odoo)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆