Xml 如何在OpenERP中显示one2many字段(看板模式)上的列?
我创建了与表Xml 如何在OpenERP中显示one2many字段(看板模式)上的列?,xml,openerp,odoo,odoo-8,qweb,Xml,Openerp,Odoo,Odoo 8,Qweb,我创建了与表爱情日期相关的模型男孩和女孩(都带有属性name、姓氏、年龄)(男孩id、女孩id、关系级别) 模型boy有一个one2many列(love\u dates),通过boy\u id字段指向love\u date。通过字段girl\u id与型号girl相同。模型love\u date具有字段boy\u id和girl\u id,这是指向模型boy和girl的多个字段 现在我已经介绍了我的环境,我将解释问题: 我是一个男孩,我在看板视图中显示他的恋爱日期(就像res.partner表单
爱情日期
相关的模型男孩
和女孩
(都带有属性name、姓氏、年龄)(男孩id、女孩id、关系级别)
模型boy
有一个one2many列(love\u dates),通过boy\u id
字段指向love\u date
。通过字段girl\u id
与型号girl
相同。模型love\u date
具有字段boy\u id
和girl\u id
,这是指向模型boy
和girl
的多个字段
现在我已经介绍了我的环境,我将解释问题:
我是一个男孩
,我在看板视图中显示他的恋爱日期
(就像res.partner表单中的标签联系人一样,如果您随时可以看到)
问题是我无法显示与当前男孩约会的女孩的数据
<field name="love_dates" mode="kanban">
<kanban>
<field name="boy_id"/>
<field name="girl_id"/>
<field name="relationship_type"/>
<templates>
<t t-name="kanban-box">
<a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; display: inline-block">X</a>
<div class="oe_module_vignette">
<a type="open">
<t t-if="record.girl_id.has_image === true">
<img t-att-src="kanban_image('girl', 'image_small', record.girl_id.id.value)" class="oe_avatar oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.girl_id.image !== false">
<img t-att-src="'data:image/png;base64,'+record.girl_id.image" class="oe_avatar oe_kanban_avatar_smallbox"/>
</t>
</a>
<div class="oe_module_desc">
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
<table class="oe_kanban_table">
<tr>
<td class="oe_kanban_title1" align="left" valign="middle">
<h4>
<a type="open">
<t t-esc="record.girl_id.name"/>
<t t-esc="record.girl_id.surname"/>
<t t-esc="record.girl_id.age"/>
<t t-esc="record.relationship_type"/>
</a>
</t>
</td>
</table>
</div>
</div>
</div>
</t>
</kanban>
</field>
X
我看不到女孩的形象,姓氏,年龄。。。我只能看到他们的名字和关系类型
有人能帮我吗?提前谢谢。可能是我读过另一篇文章的副本,但问题不同。在我的例子中,关系是one2many和many2one,在另一个问题中,关系是many2many,在两个表中声明时都没有comodel名称。无论如何,谢谢你的建议。